PdfEncryptionDetails Class
Wordize.Saving.PdfEncryptionDetails class. Contains details for encrypting and access permissions for a PDF document.
PdfEncryptionDetails class
Contains details for encrypting and access permissions for a PDF document.
public class PdfEncryptionDetails
Constructors
Name | Description |
---|---|
PdfEncryptionDetails(string, string) | Initializes an instance of this class. |
PdfEncryptionDetails(string, string, PdfPermissions) | Initializes an instance of this class. |
Properties
Name | Description |
---|---|
OwnerPassword { get; set; } | Specifies the owner password for the encrypted PDF document. |
Permissions { get; set; } | Specifies the operations that are allowed to a user on an encrypted PDF document. The default value is DisallowAll. |
UserPassword { get; set; } | Specifies the user password required for opening the encrypted PDF document. |
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
- namespace Wordize.Saving
- assembly Wordize