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

Tilman Hausherr commented on PDFBOX-3738:
-----------------------------------------

I tried with other viewers:
- pdfbox: ok
- PDF.js: not ok (but that one has problems with other signatures too)
- Chrome: ok
- ic*pdf (older version): only get an icon, even with the unsigned file
- jp*dal: ok
- gsview: ok
- unnamed closed source commercial viewer: ok

I then made changes in the unsigned file. What worked was to overwrite 
"/NeedAppearances true" with blanks.

What itext did differently:
- /DR in signature with /FRM XObject
- /NeedAppearances removed

I only tested the second one, i.e. I added this code:
{code}
acroForm.getCOSObject().removeItem(COSName.NEED_APPEARANCES);
{code}
and now the file can be displayed. However I'm reluctant to add this to our 
code for all cases: what if a PDF file contains other fields where it is 
important to create the appearance? So I added it only for when this is the 
first field. You can put it into your own code too if you want, this way you 
don't have to wait for 2.0.6.  (See in the commit link what I did)

But hey, if itext knows it better, why not search for it... and yes, they hit 
this problem 10 years ago:
http://itext.2136553.n4.nabble.com/NeedAppearances-amp-Fields-td2146811.html
http://itext.2136553.n4.nabble.com/NeedAppearances-amp-signing-woes-td2146781.html

It's a long read but basically they confirm what I suspected.

IMHO the error is with Adobe. They should ignore the NeedAppearance entry for 
signature fields. I'll create a bug report but I'm not holding my breath.

Btw, setting blocker does not really have much influence on speed. This one was 
solved quickly because it was easy.

> Signature not visible on Acrobat
> --------------------------------
>
>                 Key: PDFBOX-3738
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3738
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Signing
>    Affects Versions: 2.0.5
>         Environment: Java 1.8
>            Reporter: Marco Monacelli
>            Priority: Blocker
>         Attachments: prova2_orig.pdf, prova2_orig_signed_iText.pdf, 
> prova2_orig_signed_pdfbox.pdf
>
>
> Signing this specific file with PDFBox, I get a non-visible signature in 
> Acrobat. 
> Using iText the signature is visible.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to