GetUserPermissions
Security and signatures
Description
Returns the raw /P permission word of the loaded document, exactly as stored in the encryption dictionary. A set bit means the operation is allowed and a cleared bit means it is refused; the common bits follow ISO 32000-1 Table 22
Syntax
Delphi
Function TPDFlib.GetUserPermissions: Integer;
Return values
| >= 0 | The raw /P permission word; test the individual bits to decode the rights granted |
|---|---|
| 0 | No document is loaded |
Remarks
Common permission bits: 4 = print, 8 = modify contents, 16 = copy text and graphics, 32 = annotate, 256 = fill in form fields, 512 = copy for accessibility, 1024 = assemble the document, 2048 = high-resolution printing. Permission restrictions only apply to 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 setting up encryption. The function takes no parameters
See also
IsEncrypted, GetEncryptionLevel, IsOwnerPassword, EncodePermissions, CheckPassword