Hello,
I am trying to change a form after signing. The flow is like this:
1. add a form to the existing document
2. Fill some of the fields and sign it
3. Change the above fields/ fill some other fields and sign it again.
1 and 2 are done. no problem with that. But the signature becomes invalid
when I do the 3rd. Both signatures are invisible and my first signature
allows form fill-in. NO problem when i edit it with adobe reader. This is
the code I am using for the part 3.
PDSignature signature = new PDSignature();
signature.setFilter(PDSignature.FILTER_ADOBE_PPKLITE);
signature.setSubFilter(PDSignature.SUBFILTER_ADBE_PKCS7_DETACHED);
signature.setReason("Signing second time");
signature.setSignDate(Calendar.getInstance());
PDAcroForm acroForm = doc.getDocumentCatalog().getAcroForm();
PDField field = acroForm.getField("field2");
COSString fieldValue = new COSString("FIELD2");
field.getDictionary().setItem(COSName.V, fieldValue);
doc.addSignature(signature, this);
doc.saveIncremental(fis, fos);// Of course, doc.save() wont work.
doc.close();
In short, I would like to know how to add form fill-ins by saveincremental
Thanks