Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

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

746591Dec 2 2009 — edited Dec 2 2009
Folks,
I have a byte[], which I convert to an java.awt.Image by
  BufferedImage image;  
         InputStream in = new ByteArrayInputStream(imageBytes);  
         try {  
             image = ImageIO.read(in);  
         } catch (IOException ioe) {  
             throw new RuntimeException(  
                     "Failed to render image",  
                     ioe);  
         }  
         return image;    
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 30 2009
Added on Dec 2 2009
2 comments
680 views