PdfEncryptionDetails.Permissions

PdfEncryptionDetails Permissions property. Specifies the operations that are allowed to a user on an encrypted PDF document. The default value is DisallowAll.

PdfEncryptionDetails.Permissions property

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

public PdfPermissions Permissions { get; set; }

Examples

Shows how to specify PDF document encryption details.

PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
pdfSaveOptions.EncryptionDetails = new PdfEncryptionDetails("userPass", "1234", PdfPermissions.Printing);

// Change permissions and password after creation of PdfEncryptionDetails object.
pdfSaveOptions.EncryptionDetails.OwnerPassword = "12345";
pdfSaveOptions.EncryptionDetails.UserPassword = "123";
pdfSaveOptions.EncryptionDetails.Permissions = PdfPermissions.ModifyAnnotations | PdfPermissions.DocumentAssembly;

Converter.Create()
    .From(MyDir + "Simple.docx")
    .To(ArtifactsDir + "PdfSaveOptions.EncryptionDetails.pdf", pdfSaveOptions)
    .Execute();

See Also