Enum DocumentPermissions
Flags specifying document permissions.
[Flags]
public enum DocumentPermissions : uint
Fields
Print = 4For LMKit.Document.Pdf.PdfDocument.SecurityHandlerRevision of 2: Print the document. For LMKit.Document.Pdf.PdfDocument.SecurityHandlerRevision of 3 or greater: Print the document (possibly not at the highest quality level, depending on whether PrintHighQuality is also set).
Modify = 8Modify the contents of the document by operations other than those controlled by ModifyAnnotations, FillInForms and AssembleDocument.
ExtractTextAndGraphics = 16For LMKit.Document.Pdf.PdfDocument.SecurityHandlerRevision of 2: Copy or otherwise extract text and graphics from the document, including extracting text and graphics (in support of accessibility to users with disabilities or for other purposes). For LMKit.Document.Pdf.PdfDocument.SecurityHandlerRevision of 3 or greater: Copy or otherwise extract text and graphics from the document by operations other than that controlled by ExtractTextAndGraphics2.
ModifyAnnotations = 32Add or modify text annotations, fill in interactive form fields, and, if Modify is also set, create or modify interactive form fields (including signature fields).
FillInForms = 256For LMKit.Document.Pdf.PdfDocument.SecurityHandlerRevision of 3 or greater: Fill in existing interactive form fields (including signature fields), even if ModifyAnnotations is not set.
ExtractTextAndGraphics2 = 512For LMKit.Document.Pdf.PdfDocument.SecurityHandlerRevision of 3 or greater: Extract text and graphics (in support of accessibility to users with disabilities or for other purposes).
AssembleDocument = 1024For LMKit.Document.Pdf.PdfDocument.SecurityHandlerRevision of 3 or greater: Assemble the document (insert, rotate, or delete pages and create bookmarks or thumbnail images), even if Modify is not set.
PrintHighQuality = 2048For LMKit.Document.Pdf.PdfDocument.SecurityHandlerRevision of 3 or greater: Print the document to a representation from which a faithful digital copy of the PDF content could be generated. When PrintHighQuality is not set (and Print is set), printing is limited to a low-level representation of the appearance, possibly of degraded quality.
Examples
Example: Check document permissions.
using LMKit.Document.Pdf;
DocumentPermissions perms = PdfInfo.GetPermissions("protected.pdf");
bool canPrint = perms.HasFlag(DocumentPermissions.Print);
bool canModify = perms.HasFlag(DocumentPermissions.Modify);
bool canCopy = perms.HasFlag(DocumentPermissions.ExtractTextAndGraphics);
Console.WriteLine($"Print: {canPrint}, Modify: {canModify}, Copy: {canCopy}");