I am using iText library to read PDF files. It’s working fine for all the pdf files, except for password protected ones. I used some way by using the overloading constructor of PdfReader class
PdfReader reader = new PdfReader("locked pdf file","password".getBytes());
But it is showing show error like :
Exception in thread “main” java.lang.NoClassDefFoundError: org/bouncycastle/asn1/ASN1OctetString
Is there any other to read password protected pdf file? or should I include bouncy castle into my project library?
Starting from iText 2.0.0 you need the BouncyCastle jars. You need to download it from its site. More info can be found from here:
java.lang.NoClassDefFoundError