How to read all the privileges from a PDF file


#1

The properties of DocumentPrivilege class, as currently official defined, can not match all the privileges of a PDF file.
Just please give a focus on the attachment picture. how to correspondingly match all the items which circled on the picture with the official privilege properties.image.png (106.4 KB)


#2

@CharlieChu

The properties of DocumentPrivilege Class corresponds as following:

  • AllowPrint -> Printing
  • AllowAssembly -> Document Assembly
  • AllowFillIn -> Filling of Form Fields
  • AllowCopy -> Content Copying
  • AllowScreenReaders -> Content Copying for Accessibility
  • AllowModifyingContents - > Filling of Form Fields, Signing, Creation of Template Pages
  • AllowModifyAnnotations -> Commenting, Filling of Form Fields, Signing
  • ChangeAllowLevel - > 0: None. 1: Inserting, Deleting and Rotating pages. 2: Filling in form fields and signing existing signature fields. 3: Commenting, filling in form fields, and signing existing signature fields. 4: Any except extracting pages.

#4

Thanks for your quickly responding.
According to your information, I find that some pdf privilege items correspond not only one property.
e.g. the ‘Filling of Form Fields’ item references four properties(AllowFillIn, AllowModifyingContents, AllowModifyAnnotations, ChangeAllowLevel).
So what is the interaction of those four properties. and in what condition I can distinguish the pdf’s ‘Filling of Form Fields’ is ‘Allowed’ or ‘Not Allowed’.


#5

@CharlieChu

In order to determine whether “Filling of Form Fields” is allowed or not, you can check AllowFillIn Property:

var pdf = new Document(dataDir + "changed.pdf");
Facades.PdfFileInfo info = new Facades.PdfFileInfo();
info.BindPdf(pdf);
Aspose.Pdf.Facades.DocumentPrivilege privilege = info.GetDocumentPrivilege();
bool FillingAllowed = privilege.AllowFillIn;

While setting the privileges above properties corresponds to Filling of Form Fields as well as to other security options as shared in our previous response. Please let us know in case you need further assistance.


#6

@asad.ali

I find that the ChangeAllowLevel property only can set value, it does not have a getter.
Is any other property can determine whether ‘Page extraction’ field is allowed?


#7

And the AllowAssembly property is aways being false for every pdf file.


#8

@CharlieChu

We have logged an enhancement request as PDFNET-46709 in our issue tracking system for your requirements.

An investigation ticket as PDFNET-46709 has also been logged in our issue management system for this issue. We will look into details of both tickets and keep you informed about their resolution ticket. Please be patient and spare us little time.

We are sorry for the inconvenience.