PdfDocument.SetEncryption Method (String, Permission)

PDF File Writer

PdfDocumentSetEncryption Method (String, Permission)

Set encryption

Namespace:  PdfFileWriter
Assembly:  PdfFileWriter (in PdfFileWriter.dll) Version: 1.1.24.0 (1.1.24.0)
Syntax
C#
public void SetEncryption(
	string UserPassword,
	Permission Permissions
)

Parameters

UserPassword
Type: SystemString
User password
Permissions
Type: PdfFileWriterPermission
Permission flags
Remarks
The PDF File Writer library will encrypt the PDF document using AES-128 encryption. User password is as per argument. Owner password is set to a random number. A PDF reader such as Acrobat will request the user to enter a password. The document can only be opened with the user password. The owner password being random is effectively unknown. Permissions flags are set as per argument.
See Also