PDF Document IsEncrypted value is true

Hi,


I have a PDF which i cannot share and below is the code being written

Aspose.Pdf.Facades.PdfFileInfo info = new PdfFileInfo();
info.BindPdf(InputData);

info.IsEncrypted value is ‘True’ for that PDF which is not password protected.

Please help.

Thanks
Gowtham A

Hi Gowtham,

Thanks for contacting support.

Please note that it is not necessary that file will only be encrypted if it is password protected. A file will be encrypted if there are some DocumentPrivileges are set. You may check DocumentPrivileges by following code snippet and see what privileges are set due to which the file is seemed to be encrypted.

Aspose.Pdf.Facades.PdfFileInfo info = new Aspose.Pdf.Facades.PdfFileInfo();

info.BindPdf("input.pdf");

var privilege = info.GetDocumentPrivilege();

I have noticed that you are using old Aspose.Pdf.Facades Approach which will be obsolete soon. We strongly recommend to use new Document Object Model (DOM) approach. You may check Aspose.Pdf (DOM) section in our API docs. In case if you need further assistance please feel free to contact us.

Best Regards,