pdfLoadMemWithPassword
Load a PDF file from a memory buffer, with a password.
int pdfLoadMemWithPassword(PDFHandle *pdfPtr,
const char *buffer, unsigned int bufferLength,
const char *password)
This function loads a PDF file from
bufferLength
bytes
at buffer
, applying the specified password, and
constructs a PDF handle as *pdfPtr
. This function must be
called before any of the other functions that access the PDF file.
The pdfLoadMemWithPassword
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, "secret");
if (err != pdfOk) {
/* handle the error */
...
}