1

I am trying to import a pdf in my application using PdfRenderer - Android's in-built solution.

With this i am facing problem mentioned on this link.

google issue

My requirement is to check if any password is password protected or not without using any 3rd party libs or jar.

How can this be done ?

Note : Similar reported issues discuss solution using 3rd party libs only but this is not i want.

I am already able to accomplish most of my job using PdfRenderer class. And just to check if any pdf is password protected, i do not want to use any library.

userv
  • 2,426
  • 3
  • 27
  • 34
  • ***without** using any 3rd party libs* means that you will have to re-invent parts of them. If your input documents are arbItrary, that is not trivial. – mkl Jul 03 '15 at 10:21
  • Where or how should i start ? If it asks for a lot i will reconsider using 3rd party libs. – userv Jul 03 '15 at 11:31
  • *Where or how should i start* - read the [PDF specification](http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf), especially the sections 7.5 "File Structure" and 7.6 "Encryption". Then write code to read the file trailer dictionary (which *may* be absorbed by a cross reference stream dictionary) and inspect its **Encrypt** entry. – mkl Jul 03 '15 at 11:43

0 Answers0