What you could do if is to add this in COSWriter.prepareIncrement():
PDAcroForm acroForm = doc.getDocumentCatalog().getAcroForm(null);
if (acroForm != null &&
!acroForm.getCOSObject().isNeedToBeUpdated())
{
// find fields that need to be updated, these may be missed
if there is no "path" to them
for (PDField field : acroForm.getFieldTree())
{
if (field.getCOSObject().isNeedToBeUpdated() &&
!objectsToWrite.contains(field.getCOSObject()))
{
objectsToWrite.add(field.getCOSObject());
}
}
}
In PDDocument, find the line
page.getCOSObject().setNeedToBeUpdated(true);
and move this line below the line
annotations.add(widget);
Also make sure that the first signing doesn't create a "certified" PDF.
That is what you get when calling SigUtils.setMDPPermission().
Tilman
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]