Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-3017 Improve document signing
  3. PDFBOX-3524

signatureField.setValue() not implemented

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.3
    • 2.0.4, 3.0.0 PDFBox
    • Signing
    • None

    Description

      In the CreateEmptySignatureForm example, adding

      signatureField.setValue(new PDSignature());
      

      before saving brings this

      Exception in thread "main" java.lang.UnsupportedOperationException: not implemented
      	at org.apache.pdfbox.pdmodel.interactive.form.PDSignatureField.constructAppearances(PDSignatureField.java:237)
      	at org.apache.pdfbox.pdmodel.interactive.form.PDTerminalField.applyChange(PDTerminalField.java:226)
      	at org.apache.pdfbox.pdmodel.interactive.form.PDSignatureField.setValue(PDSignatureField.java:121)
      	at org.apache.pdfbox.examples.signature.CreateEmptySignatureForm.main(CreateEmptySignatureForm.java:84)
      

      Although there's nothing to construct, visual signing is a different area of PDFBox.

      What does work is this:

      signatureField.getCOSObject().setItem(COSName.V, new PDSignature());
      

      I wanted to add this line because this would make it possible to sign this specific field with PDFBox, due to the findSignatureField() method in PDDocument, which would allow to pre-fill a PDSignature object.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            msahyoun Maruan Sahyoun
            tilman Tilman Hausherr
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment