pdfLoadMem
Load a PDF file from a memory buffer.
int pdfLoadMem(PDFHandle *pdfPtr, const char *buffer, unsigned int bufferLength)
This function loads a PDF file from
bufferLength
bytes
at buffer
and constructs a PDF handle
as *pdfPtr
. This function must be called before any of
the other functions that access the PDF file.
The pdfLoadMem
function returns pdfOk
if
successful, otherwise an error code.
IMPORTANT: The PDF file in memory must not be freed or modified
until after pdfFree
is called.
C:
char *buf;
unsigned int bufLength;
int err;
/* allocate buf, read PDF file into it, and set bufLength */
...
err = pdfLoadMem(&pdf, buf, bufLength);
if (err != pdfOk) {
/* handle the error */
...
}