0

I have a signature application using Pdfbox. When I add a signature, then some text, and then add another signature, the first signature becomes invalid. How can I allow one client to fill in input fields and checkboxes and sign, and then another client can add text and checkboxes and sign the document without invalidating the first signature?

  • 1
    After the first signer signed the pdf, only a very few kinds of changes are allowed, see [this answer](https://stackoverflow.com/a/16711745/1729265). Thus, you cannot *add text and checkboxes* without breaking the former signature. – mkl May 02 '23 at 22:13
  • unrelated, but 3.0.0-rc1 is not the latest of the 3.0 versions – Tilman Hausherr May 03 '23 at 09:08
  • Hi Tikyou mkl and Tilman, I have a few questions regarding PDFBox digital signatures: What is the default type of signature used in the example provided for PDFBox 3.0.0-rc1? Which version of PDFBox should I use for the latest features and improvements? Could you please share a simple code snippet that demonstrates how to fill fields after signing a PDF document without altering the first signature? Thank you in advance for your help. – rahim soufiane May 04 '23 at 08:00
  • The latest 3.0 is 3.0.0-alpha3. The latest 2.0 is 2.0.28, this is best if you're a beginner. Download the source code and search for the `testSaveIncrementalAfterSign` method in the file `TestCreateSignature.java` in the examples subproject. This does just that. The relevant part is to use `saveIncremental` with an object list (the correct choice of the objects is a bit tricky, sadly) – Tilman Hausherr May 04 '23 at 09:49
  • Thank you for your comments.How can I display the list of signatures and changes in Adobe Acrobat Reader in the left panel of signatures? Specifically, I would like the list to be formatted as follows: Signature 1 Fields changed Signature 2 Is this possible, and if so, how can I achieve this? – rahim soufiane May 04 '23 at 15:32
  • I can't help you about Adobe Reader. Re PDFBox it is possible to display the signatures (see the `ShowSignature.java` example and adjust the output to your needs), but not what was changed. – Tilman Hausherr May 04 '23 at 15:51
  • To clarify, I am wondering whether it is possible to add fields to a PDF document after the first signature has been applied, or if I can only modify the values of existing fields after the first signature. – rahim soufiane May 04 '23 at 16:28
  • Sorry, your text was clear. No you can't add fields, I just tried it. Adobe will complain. mkl also mentioned in his first comment. – Tilman Hausherr May 04 '23 at 17:27
  • tankyou, can i use a variety of fonts apart from Helvetica and can i applying text properties such as bold, italics, and underlining – rahim soufiane May 05 '23 at 15:10
  • Is this a new question? Anyway, just try it. It worked for me but I signed only once and Adobe noticed that the content and properties had changed. The example `CreateSimpleFormWithEmbeddedFont.java` shows how to set a font to a field. Btw "bold, italics, and underlining" isn't a property. You have to choose a font that is bold or italic. Underlining isn't available as a font, you'd have to implement underlining yourself. – Tilman Hausherr May 05 '23 at 17:36

0 Answers0