IsEncrypted
Security and signatures
Description
Reports whether the selected document is encrypted. The call returns 1 when the loaded document carries an /Encrypt dictionary in its trailer, and 0 when the document is stored in plain text or no document is loaded
Use this flag to branch before editing: an encrypted file must pass CheckPassword or be cleared with Decrypt before its content can be modified and resaved
Syntax
Delphi
Function TPDFlib.IsEncrypted: Integer;
Return values
| 0 | The selected document is not encrypted or no document is loaded |
|---|---|
| 1 | The selected document carries an /Encrypt dictionary |
Remarks
The flag reflects the document exactly as it was loaded; pair it with GetEncryptionLevel for the cipher strength and GetUserPermissions for the raw /P permission word
See also
GetEncryptionLevel, GetUserPermissions, IsOwnerPassword, CheckPassword, Decrypt, SecurityInfo