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.
Copy Code
|
|
---|---|
typedef AT_PDF_BOOL (LPACCUAPI LPFNIG_PDF_AUTHPROC)( HIG_PDF_DOC hDoc, LPVOID clientData ); |
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. |
TRUE if the user is authorized to open the document; FALSE otherwise.
This function does not process image pixels.
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.