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 held in plain text, or when no document is loaded

Test this flag before editing: an encrypted file must first pass CheckPassword, or be cleared with Decrypt, before its content can be changed and saved again

Syntax

Delphi

Function TPDFlib.IsEncrypted: Integer;

Return values

0The selected document is not encrypted, or no document is loaded
1The selected document carries an /Encrypt dictionary

Remarks

The flag mirrors 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