Click or drag to resize
Pdftools logo

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.Pdf
Assembly: PdfTools (in PdfTools.dll) Version: 1.7.0+cfcc11b476b3e1eb4320f0f37269191f64e36bd8
Syntax
C#
public 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
ExceptionCondition
ArgumentExceptionIf restricted permissions (i.e. not All) are specified without ownerPassword.
ArgumentNullExceptionif ownerPassword is .
See Also