Table of Contents

Class PdfSecurity

Namespace
Spire.Xls.Pdf.Security
Assembly
Spire.XLS.dll

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

PdfEncryptionKeySize

OwnerPassword

Gets the owner password.

public string OwnerPassword { get; }

Property Value

string

Permissions

Gets the document's permission flags

public PdfPermissionsFlags Permissions { get; }

Property Value

PdfPermissionsFlags

UserPassword

Gets the user password.

public string UserPassword { get; }

Property Value

string

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 string

The 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 string

The permission password

permissions PdfPermissionsFlags

A 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 string

The open password

permissionPassword string

The permission password

permissions PdfPermissionsFlags

A set of flags specifying which operations are permitted when the document is opened with user access

keySize PdfEncryptionKeySize

The bit length of the encryption key