PdfPermissions Enum
Wordize.Saving.PdfPermissions enum. Specifies the operations that are allowed to a user on an encrypted PDF document.
PdfPermissions enumeration
Specifies the operations that are allowed to a user on an encrypted PDF document.
[Flags]
public enum PdfPermissions
Values
Name | Value | Description |
---|---|---|
DisallowAll | 0 | Disallows all operations on the PDF document. This is the default value. |
AllowAll | FFFF | Allows all operations on the PDF document. |
ContentCopy | 10 | Copy or otherwise extract text and graphics from the document by operations other than that controlled by ContentCopyForAccessibility. |
ContentCopyForAccessibility | 200 | Extract text and graphics (in support of accessibility to users with disabilities or for other purposes). |
ModifyContents | 8 | Modify the contents of the document by operations other than those controlled by ModifyAnnotations, FillIn, and DocumentAssembly. |
ModifyAnnotations | 20 | Add or modify text annotations, fill in interactive form fields, and, if ModifyContents is also set, create or modify interactive form fields (including signature fields). |
FillIn | 100 | Fill in existing interactive form fields (including signature fields), even if ModifyContents is clear. |
DocumentAssembly | 400 | Assemble the document (insert, rotate, or delete pages and create document outline items or thumbnail images), even if ModifyContents is clear. |
Printing | 4 | Print the document (possibly not at the highest quality level, depending on whether HighResolutionPrinting is also set). |
HighResolutionPrinting | 804 | Print the document to a representation from which a faithful digital copy of the PDF content could be generated, based on an implementation-dependent algorithm. When this flag is clear (and Printing is set), printing shall be limited to a low-level representation of the appearance, possibly of degraded quality. |
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