You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2016/10/07 15:24:20 UTC

[jira] [Created] (PDFBOX-3524) signatureField.setValue() not implemented

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: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org