Discuss this help topic in SecureBlackbox Forum

Decrypt PDF document using password

First load the document as described in the corresponding how-to article.

Check the value of Encrypted property of TElPDFDocument class to check that the document is encrypted.

If the document is encrypted, an instance of TElPDFPasswordSecurityHandler class is contained in EncryptionHandler property of TElPDFDocument class.

Adjust the properties of TElPDFPasswordSecurityHandler class (referenced by EncryptionHandler property) as needed. You will need to set passwords in order to decrypt the data. Passwords are set using OwnerPassword and UserPassword properties. You can use IsUserPasswordValid() and/or IsOwnerPasswordValid() methods of TElPDFPasswordSecurityHandler class to check, if the provided passwords are valid.

Call Decrypt() method of TElPDFDocument to decrypt the document.

Save and close the document using Close() method.

How To articles about PDF encryption

Discuss this help topic in SecureBlackbox Forum