EncryptPDFDocument, EncryptPDFDocument128 Functions
The EncryptPDFDocumentand EncryptPDFDocument128functions canbe used to password protect a PDF document and
restrict users to viewing, modifying or even printing the document. Thesefunctionsrequires a call to SetLicenseKey before it
can be used.The EncryptPDFDocument function uses 40 bits encryption, whereas the EncryptPDFDocument128 function uses 128
bits encryption compatible with Adobe® Acrobat® 5 and higher.
BOOL EncryptPDFDocument( LPCSTR FileName, LPCSTR Owner, LPCSTR User, DWORD Permissions );
BOOL EncryptPDFDocument128( LPCSTR FileName, LPCSTR Owner, LPCSTR User, DWORD Permissions );
[in]Full path of PDF file to encrypt
[in] Owner password
[in] User password
[in] Options to restrict users opening the document using the User password
The return value is True if the document was encrypted, False otherwise.
This function is only available if the activation code is for a professional version of the Amyuni PDF Converter. In the case of the
evaluation version, the passwords are always set to "aaaaaa" and "bbbbbb" and cannot be changed.
-64 + 4
Enable document modification
-64 + 8
Enable copying text and graphics
-64 + 16
Enable adding and changing notes
-64 + 32
To combine multiple options, use -64 plus the values 4, 8, 16 or 32. E.g. to enable both printing and adding notes, use -64 + 4 +
32 = -28. To disable all 4 options, use -64.
Owner and user passwords
Two passwords are associated to an encrypted PDF document. The owner password is for the author of the document, and the
user password for the destinator oruser of the document.
The owner password is optionaland allows the author having this password to do any operation he/she wishes on this document,
including modifying its security settings.It can be blank, same password as the user, or a password different from the user.
The user password is optional and can be one of the following:
A blank password. In this case, the user is not prompted for a password when opening a document, but is restricted to the
operations allowed by the author.
The same password as the owner. In this case the user is prompted for a password and the author of the document will not
be able to open this document as an owner to change its security settings.
A password different from the owner. In this case, the user will not be able to open the document unless he/she enters a
valid password. When a valid password is entered, the document can be viewed but its usage restricted to the operations
allowed by the author.