aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-pdfbox/src
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2016-06-07 11:10:29 +0200
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2016-06-07 11:10:29 +0200
commit0f415f248c680aded58af52394fa46043b484578 (patch)
treea5f4ebef8b556aa619271797d15e592c034ce16d /pdf-as-pdfbox/src
parent8998df18e776b4bf17a4c731e0b9c3aad926ca6d (diff)
downloadpdf-as-4-0f415f248c680aded58af52394fa46043b484578.tar.gz
pdf-as-4-0f415f248c680aded58af52394fa46043b484578.tar.bz2
pdf-as-4-0f415f248c680aded58af52394fa46043b484578.zip
fixed error, with indirect fields array in acro forms object
Diffstat (limited to 'pdf-as-pdfbox/src')
-rw-r--r--pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java12
1 files changed, 12 insertions, 0 deletions
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) {