Am 30.09.2010 19:35, schrieb Vinayak Mishra:
Hi all,
Hi

Forgive my naiveness but I am new to PdfBox, and trying my best to understand 
the library. I am stuck at a point and need someone to show a work around, pls 
see the mail below for details.

No problem, i think no one have a helping solution, so no one answer you.

I mailed this to the list a few days back, and receiving no response feels 
weird. I am not sure if my mails are getting through.

The mailing list works great. If you subscribed the list correctly, you should also got your mail from the mailing list, as well as the other subscriber.

-----Original Message-----
From: Vinayak
Sent:  28/09/2010 12:42:24
Subject:  Re: Embed PNG/GIF image into existing PDF Document

I am loading PNG image using ImageIO and loading into PDJpeg using
PDJpeg(PDDocument, BufferedImage).

You are trying to load a PNG with the PDJpeg which is only for JPGs.

Some times ago i used iText for adding images like PNG and JPG in PDF documents and find out, that ...
- JPGs are stored directly byte-by-byte in the document
- PNGs are stored manipulated, i mean iText do something with the images befor storing it in the document.

So i think it would be tricky to implement a similar class for PNGs.
BUT you can convert the images with java on the fly in JPG like i did it and then store the image with the PDJpeg. If the image is transparent, you should add a white background color befor storing it.

Thank you very much.
--
Vinayak

regards

Thomas

Reply via email to