1

我正在尝试使用bcprov-jdk15on-1.56.jaritextpdf-5.5.10.jar解锁受密码保护的 PDF,但出现以下异常。我正在使用“用户定义的 Java 类”转换任务。

例外:类“org.bouncycastle.asn1.ASN1Primitive”的签名者信息与同一包中其他类的签名者信息不匹配

这是我写的代码行,

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());
}

任何想法,这有什么问题?

谢谢,尼莱什

4

1 回答 1

2

您的类路径中似乎有多个 BouncyCastle 罐子。尝试使用1.49iText5.5.10编译的版本,如果它没有帮助,你将不得不找出哪些 jars 恰好在你的类路径中并删除重复项。

于 2017-01-26T16:19:20.690 回答