From 0f415f248c680aded58af52394fa46043b484578 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Tue, 7 Jun 2016 11:10:29 +0200 Subject: fixed error, with indirect fields array in acro forms object --- .../pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'pdf-as-pdfbox/src/main/java') diff --git a/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java b/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java index 6d035b30..954d4e92 100644 --- a/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java +++ b/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java @@ -399,6 +399,18 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants { doc.addSignature(signature, signer, options); + // set need to update indirect fields array in acro form + COSDictionary trailer = doc.getDocument().getTrailer(); + COSDictionary troot = (COSDictionary) trailer + .getDictionaryObject(COSName.ROOT); + COSDictionary acroForm = (COSDictionary) troot + .getDictionaryObject(COSName.ACRO_FORM); + COSArray tfields = (COSArray) acroForm + .getDictionaryObject(COSName.FIELDS); + if(!tfields.isDirect()) { + tfields.setNeedToBeUpdate(true); + } + String sigFieldName = signatureProfileSettings.getSignFieldValue(); if (sigFieldName == null) { -- cgit v1.2.3