Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Unlock the password protected PDF using itextpdf and bcprov

  1. #1
    Join Date
    Nov 2014
    Posts
    15

    Default Unlock the password protected PDF using itextpdf and bcprov

    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
    Last edited by nileshnaseet; 01-26-2017 at 10:22 AM.

  2. #2
    Join Date
    Nov 2014
    Posts
    15

    Default

    Found solution...There was already a bcprov-jdk14-138.jar which comes default with Pentaho (along with all other libraries). Deleted it and not getting the above error. But now I am running into other issue. It's not able to open the PDF file with that password. Password is correct; I can open PDF with same password from Acrobat reader. I get error "PdfReader not opened with owner password" from Pentaho UDJC task. I am having owner password.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.