pdfLoadMemWithPassword

Load a PDF file from a memory buffer, with a password.
int pdfLoadMemWithPassword(PDFViewerHandle viewer, char *buffer, unsigned int bufferLength, char *password)
This function loads a PDF file from bufferLength bytes at buffer, applying the specified password, and displays its first page.

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 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, "secret"); if (err != pdfOk) { /* handle the error */ ... }
pdfLoadFile
pdfLoadFileW
pdfLoadFileWithPassword
pdfLoadFileWithPasswordW
pdfLoadMem
pdfLoadStream
pdfLoadStreamWithPassword
pdfCloseFile