[ 
https://issues.apache.org/jira/browse/PDFBOX-4556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16865727#comment-16865727
 ] 

Tilman Hausherr commented on PDFBOX-4556:
-----------------------------------------

You passed a PNG, but in 1.8 only JPEG images are supported. This is mentioned 
in the javadoc of the PDVisibleSignDesigner constructor. I'll add this in an 
extra comment in the example above "main", sorry about that. Btw I found this 
quickly by looking at the file with PDFDebugger 2.0.16, there is an error 
message, you should use this to inspect your files, it helps a lot.

The {{visibleSignature.pdf}} file seems to look OK besides that, i.e. it has 
the annotation and the field.

I don't understand re the NullPointerException. {{PDAppearanceDictionary 
appearance = new PDAppearanceDictionary();}} cannot not throw this. You should 
check whether {{form.getCOSStream()}} has a null {{form}} object or returns 
{{null}}? If you can't solve this, please post the stack trace in full.

The {{pdfAnnotation.pdf}} file has the annotation and the field but the /AP is 
missing.

Maybe the {{widget}} object wasn't connected to the field? I see that in the 
code you posted initially, there was
 {code}
 PDAnnotationWidget Widget = new PDAnnotationWidget();
 {code}
 so this is alone. The correct way to go is
 {code}
 PDAnnotationWidget widget = signatureField.getWidgets().get(0);
 {code}
 or (deprecated in 2.0 but not in 1.8):
 {code}
 PDAnnotationWidget widget = signatureField.getWidget();
 {code}
{quote}can i go with the implementation of the PDFTemplateBuilder, 
PDVisibleSigBuilder for the visual representation of the signature will it work?
{quote}
Yes, as I wrote last week, the example works fine with it.

> how the visual representation of the signature is achieved  
> ------------------------------------------------------------
>
>                 Key: PDFBOX-4556
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4556
>             Project: PDFBox
>          Issue Type: Wish
>          Components: .NET
>    Affects Versions: 1.8.16
>            Reporter: bal
>            Priority: Major
>         Attachments: pdfAnnotation.pdf, visibleSignature.pdf
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to