Class PdfEncryptionDetails

Class PdfEncryptionDetails

Namespace: Aspose.Words.Saving
Assembly: Aspose.Words.dll (25.3.0)

Contains details for encrypting and access permissions for a PDF document.

To learn more, visit the Protect or Encrypt a Document documentation article.

public class PdfEncryptionDetails

Inheritance

objectPdfEncryptionDetails

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

PdfEncryptionDetails(string, string)

Initializes an instance of this class.

public PdfEncryptionDetails(string userPassword, string ownerPassword)

Parameters

userPassword string

ownerPassword string

PdfEncryptionDetails(string, string, PdfPermissions)

Initializes an instance of this class.

public PdfEncryptionDetails(string userPassword, string ownerPassword, PdfPermissions permissions)

Parameters

userPassword string

ownerPassword string

permissions PdfPermissions

Properties

OwnerPassword

Specifies the owner password for the encrypted PDF document.

public string OwnerPassword { get; set; }

Property Value

string

Remarks

The owner password allows the user to open an encrypted PDF document without any access restrictions specified in Aspose.Words.Saving.PdfEncryptionDetails.Permissions.

The owner password cannot be the same as the user password.

Permissions

Specifies the operations that are allowed to a user on an encrypted PDF document. The default value is Aspose.Words.Saving.PdfPermissions.DisallowAll.

public PdfPermissions Permissions { get; set; }

Property Value

PdfPermissions

UserPassword

Specifies the user password required for opening the encrypted PDF document.

public string UserPassword { get; set; }

Property Value

string

Remarks

The user password will be required to open an encrypted PDF document for viewing. The permissions specified in Aspose.Words.Saving.PdfEncryptionDetails.Permissions will be enforced by the reader software.

The user password can be null or empty string, in this case no password will be required from the user when opening the PDF document. The user password cannot be the same as the owner password.