How to get the Pdf Document Privilage : Page Commenting Property is Allowed or no

Hi ,
i have pdf document which has a pdf security (Commenting) ,so i want to check commenting is allowed or not…


Would you please share your sample PDF document with us. We will test the scenario in our environment and address it accordingly.


added the document please find the solutiontoc.pdf (42.2 KB)

In this file have security as commenting is allowed ,but hot get get allowed or not allowed by through api.


Please use following code snippet to get AllowCopy permission status:

var pdf = new Document(dataDir + "toc.pdf");
Facades.PdfFileInfo info = new Facades.PdfFileInfo();
Aspose.Pdf.Facades.DocumentPrivilege privilege = info.GetDocumentPrivilege();
bool AllowCopy = privilege.AllowCopy;

need allowed and not allowed commenting security api not for copying please check issue description


Comments can be added in PDF documents using Annotations and in order to check related permission, please use following code snippet:

bool AllowCommenting = privilege.AllowModifyAnnotations;