ImageGear for C and C++ on Linux v18.8 - Updated
LPFNIG_PDF_AUTHPROC
API Reference Guide > PDF Component API Reference > PDF Component Callback Functions Reference > LPFNIG_PDF_AUTHPROC

This callback is used by document open routine; it is called when an encrypted document is being opened to determine whether or not the user is authorized to open the file.

Declaration:

 
Copy Code
typedef AT_PDF_BOOL (LPACCUAPI LPFNIG_PDF_AUTHPROC)(
        HIG_PDF_DOC hDoc,
        LPVOID clientData
);

Arguments:

Name Type Description
hDoc HIG_PDF_DOC The PDF document to open.
clientData LPVOID User-supplied data that was passed in the call to IG_PDF_register_authproc.

Return Value:

TRUE if the user is authorized to open the document; FALSE otherwise.

Supported Raster Image Formats:

This function does not process image pixels.

Remarks:

This callback implements whatever authorization strategy you choose and calls the callbacks of the appropriate security handler (the one that was used to secure the document) to obtain and check authorization data.

The LPFNIG_PDF_AUTHPROC should obtain the authorization data (a password) and call IG_PDF_doc_perm_request(). IG_PDF_doc_perm_request in turn calls the document encryption handler's Authorize function, which returns the permissions that the authorization data enables. IG_PDF_doc_perm_request adds these permissions to those currently allowed, and returns the new set of allowed permissions.