Click or drag to resize

PdfSecurity Encrypt Method (String, String, PdfPermissionsFlags, PdfEncryptionKeySize, String)

To Encrypt the PDF document with open password and permission password,and set the encryption key size and permissions. Note:If set empty string value to open password or permission password, it indicates that the PDF document can be operated without providing corresponding password.

Namespace: Spire.Pdf.Security
Assembly: Spire.Pdf (in Spire.Pdf.dll) Version: 11.3.7.0 (11.3.7.1046)
Syntax
public void Encrypt(
	string openPassword,
	string permissionPassword,
	PdfPermissionsFlags permissions,
	PdfEncryptionKeySize keySize,
	string originalPermissionPassword
)

Parameters

openPassword
Type: System String
The open password
permissionPassword
Type: System String
The permission password
permissions
Type: Spire.Pdf.Security PdfPermissionsFlags
A set of flags specifying which operations are permitted when the document is opened with user access
keySize
Type: Spire.Pdf.Security PdfEncryptionKeySize
The bit length of the encryption key
originalPermissionPassword
Type: System String
The original permissionPassword of the document
See Also