Class PdfSecurity
Represents the security settings of the PDF document.
public class PdfSecurity
- Inheritance
-
PdfSecurity
- Inherited Members
Constructors
PdfSecurity()
Initializes a new instance of the class.
public PdfSecurity()
Properties
KeySize
Gets the size of the key.
public PdfEncryptionKeySize KeySize { get; }
Property Value
OwnerPassword
Gets the owner password.
public string OwnerPassword { get; }
Property Value
Permissions
Gets the document's permission flags
public PdfPermissionsFlags Permissions { get; }
Property Value
UserPassword
Gets the user password.
public string UserPassword { get; }
Property Value
Methods
Encrypt(string)
To Encrypt the PDF document with open password. Note:If set empty string value to open password, it indicates that the PDF document can be operated without providing corresponding password. Note: the document owner password should not be exist.
public void Encrypt(string openPassword)
Parameters
openPassword
stringThe open password
Encrypt(string, PdfPermissionsFlags)
To Encrypt the PDF document with permission password and permissions. Note:The Permission password can't be empty string.
public void Encrypt(string permissionPassword, PdfPermissionsFlags permissions)
Parameters
permissionPassword
stringThe permission password
permissions
PdfPermissionsFlagsA set of flags specifying which operations are permitted when the document is opened with user access
Encrypt(string, string, PdfPermissionsFlags, PdfEncryptionKeySize)
To Encrypt the PDF document 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.
public void Encrypt(string openPassword, string permissionPassword, PdfPermissionsFlags permissions, PdfEncryptionKeySize keySize)
Parameters
openPassword
stringThe open password
permissionPassword
stringThe permission password
permissions
PdfPermissionsFlagsA set of flags specifying which operations are permitted when the document is opened with user access
keySize
PdfEncryptionKeySizeThe bit length of the encryption key