Home > Blockchain >  Fill out field for pdf revision when signing with PDFbox
Fill out field for pdf revision when signing with PDFbox

Time:01-05

I am trying to add input to my existing field in a pdf that should be signed at the end. I used the library from swisscom (enter image description here

Is it possible with pdfbox to achieve the same output as AdobeSign like where you can store more detailed information in the revision metadata? I am not able to open the file with itext rups because the pdf gets locked with a password at the end....

enter image description here

And what would be the best way to look the fields when everyone is done (so the fields are not shown as editable fields anymore):

  • setting a lock like in Adobe
  • setting some protection after the field was filled

CodePudding user response:

The update flag must be set on the field itself

field.getCOSObject().setNeedToBeUpdated(true);

and on the appearance of the widget of the field

field.getWidgets().get(0).getAppearance().getCOSObject().setNeedToBeUpdated(true);

(this assumes that the field is its own widget and that there is only one)

It might still work if the second code part is missing because Adobe Reader updates the appearance when displaying.

  • Related