GetUserPermissions
Security and signatures
Description
Returns the raw /P permission word of the loaded document, verbatim as stored in the encryption dictionary. A set bit means the operation is permitted and a cleared bit means it is denied; the common bits follow ISO 32000-1 Table 22
Syntax
Delphi
Function TPDFlib.GetUserPermissions: Integer;
Return values
| >= 0 | The raw /P permission word; test individual bits to decode the granted rights |
|---|---|
| 0 | No document is loaded |
Remarks
Common permission bits: 4 = print, 8 = modify contents, 16 = copy text and graphics, 32 = annotate, 256 = fill form fields, 512 = copy for accessibility, 1024 = assemble the document, 2048 = print high resolution. Permission restrictions only take effect in an encrypted document opened with the user password; use IsOwnerPassword to check whether the owner credential with full rights was used, and EncodePermissions to pack permission booleans when configuring encryption. The function takes no parameters
See also
IsEncrypted, GetEncryptionLevel, IsOwnerPassword, EncodePermissions, CheckPassword