pdfLoadMem
Load a PDF file from a memory buffer.
int pdfLoadMem(PDFViewerHandle viewer, char *buffer, unsigned int bufferLength)
This function loads a PDF file from
bufferLength
bytes
at buffer
and displays its first page.
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 pdfCloseFile
is called.
C:
char *buf;
unsigned int bufLength;
int err;
/* allocate buf, read PDF file into it, and set bufLength */
...
err = pdfLoadMem(viewer, buf, bufLength);
if (err != pdfOk) {
/* handle the error */
...
}