This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes convert java.awt.Image to com.lowagie.text.Image Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Reply Bookmark "convert java.awt.Image to com.lowagie.text.Image" Watch "convert java.awt.Image to com.lowagie.text.Image" New topic
Author

convert java.awt.Image to com.lowagie.text.Image

vinitha simon
Ranch Hand

Joined: Dec 13, 2007
Posts: 64
Folks,
I have a byte[], which I convert to an java.awt.Image by



Now, I need to write this image to a PDF using iText, but, iText accepts 'com.lowagie.text.Image'... Any suggestions on how to convert between the 2 image formats....

Any help is appreciated.

TIA
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35249
    
    7
There's no need to convert the byte array into a BufferedImage - the iText Image class has methods for creating images from lots of sources, including byte arrays. Check its javadocs for details.


Android appsImageJ pluginsJava web charts
vinitha simon
Ranch Hand

Joined: Dec 13, 2007
Posts: 64
Thanks Ulf.

I also figured out



should work as well.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: convert java.awt.Image to com.lowagie.text.Image
 
Similar Threads
Inserting Image in a PDF File generated using JAVA PdfWriter object
Image not dispaying in RTF document (Worddocument) using iText API
how to insert rectangle with color in table using itext API
Barcode39 image display in JSP
TIFF. DOC, EXCEL to PDF Converter