pvginkel / PdfiumViewer

PDF viewer based on Google's PDFium.
Apache License 2.0
972 stars 418 forks source link

Unable to open PDF file with Permissions Password #190

Open iimax opened 5 years ago

iimax commented 5 years ago

build and run the latest source, open PdfiumViewer.Demo.exe with a secured PDF file, PdfError.InvalidFormat "File not in PDF format or corrupted" PdfException throws. The pdf can be opened by foxit or Acrobat Reader, and the security tab says: Security Method: Password Security. Document Open Password: No. Permissions Password: Yes. Encryption Level: 128-bit AES.

There are two different types of password in PDF document, one is Document Open Password (represented by "user password" in Spire.PDF), and the other one is Permission Password (represented by "owner password" in Spire.PDF). By setting a user password, PDF cannot be opened without entering the password. While an owner password allows PDF owner to fully access to PDF file such as reset password and change security permission. ref#https://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/Security/How-to-Change-Security-Permission-of-PDF-Document-in-C-VB.NET.html How to open it? Thanks for any guidance