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

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

Your annotation has (again) a PNG image encoded as a JPEG image. Open the PDF 
file with an editor you'll see "%PNG" at offset 7274. As I wrote, it's the 
annotation that counts, not the page content stream. Just don't use it! If you 
want to use a PNG, then use the {{PDPixelMap}} class. You did this, but your 
code has:
{code:java}
//resources.addXObject(xobj, "Im"); // just prefix
resources.addXObject(new PDJpeg(doc, new FileInputStream(tickImagePath)), "Im");
{code}
so you commented out the correct code and kept the rest.

Had you used PDFDebugger 2.0.16 on your file, then you would have seen the 
error message that it isn't a JPEG.

So please retry with the corrected code.

Another (small) mistake: "150 150 150 150 re" won't paint the rectangle at the 
correct place. It should have been "0 0 150 150 re"

Btw you have hit a bug, i.e. that no exception is thrown if a PNG is passed to 
a PDJpeg constructor. This has been fixed in PDFBOX-4582.

> 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: as_TobeSigned.pdf, pdfImage-modified-by-tilman.pdf, 
> pdfImage.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