Tilman Hausherr created PDFBOX-3524:
---------------------------------------

             Summary: signatureField.setValue() not implemented
                 Key: PDFBOX-3524
                 URL: https://issues.apache.org/jira/browse/PDFBOX-3524
             Project: PDFBox
          Issue Type: Sub-task
          Components: Signing
    Affects Versions: 2.0.3
            Reporter: Tilman Hausherr


In the CreateEmptySignatureForm example, adding
{code}
signatureField.setValue(new PDSignature());
{code}
before saving brings this
{code}
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)
{code}
What does work is this:
{code}
signatureField.getCOSObject().setItem(COSName.V, new PDSignature());
{code}

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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to