Quantcast
Channel: Pentaho Community Forums
Viewing all articles
Browse latest Browse all 16689

Unlock the password protected PDF using itextpdf and bcprov

$
0
0
Hi Guys,

I am trying to unlock the password protected PDF using bcprov-jdk15on-1.56.jar and itextpdf-5.5.10.jar but I am getting following exception. I am using 'User Defined Java Class' task of transformation.

Exception: class "org.bouncycastle.asn1.ASN1Primitive"'s signer information does not match signer information of other classes in the same package

Here is the lines of code I wrote,

String pdfFilePath = get(Fields.In, "PDFFilePath").getString(r);
String dest = pdfFilePath +"_unlocked.pdf";


try
{
PdfReader reader = new PdfReader(pdfFilePath,owner_password.getBytes());
PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(dest));

stamper.close();
reader.close();
}
catch(Exception e)
{
logBasic("EXCEPTION WHILE UNLOCKING PDF = " + e.getMessage());
}


Any idea, what's wrong with this?

Thanks,
Nilesh

Viewing all articles
Browse latest Browse all 16689

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>