 | EncryptionSetPermissions Method |
Set the owner password and access permissions.
Only the given permissions are granted when opening the document.
To the owner of the document, all permissions are granted.
For this, the document must be opened by specifying the owner password (see
OwnerPassword).
Namespace: PdfTools.PdfAssembly: PdfTools (in PdfTools.dll) Version: 1.18.0+b1d0ba2880e819b0af6ed309ecaa192439f42fd7
Syntaxpublic void SetPermissions(
string ownerPassword,
Permission permissions
)
Parameters
- ownerPassword String
-
The owner password to be set on the PDF document (see OwnerPassword).
- permissions Permission
-
The permissions to be set on the PDF document.
Exceptions| Exception | Condition |
|---|
| ArgumentException | If restricted permissions (i.e. not All) are specified without ownerPassword. |
| ArgumentNullException | if ownerPassword is . |
See Also