aspose file tools*
The moose likes Other Open Source Projects and the fly likes NullPointerException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "NullPointerException" Watch "NullPointerException" New topic
Author

NullPointerException

Sarika Sukumaran
Greenhorn

Joined: Oct 20, 2011
Posts: 10
Why "BufferedImage image = ImageIO.read(new ByteArrayInputStream(imageBytes));" returns null value?


Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
I'll bet you dollars to donuts that "instance.toString()" does not return anything remotely resembling what you seem to assume it returns.
Sarika Sukumaran
Greenhorn

Joined: Oct 20, 2011
Posts: 10
Thanks for your response. Could you please help me to achieve the target?
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Depends on what you intend to do. It looks like you're trying to convert a PDF to a (series of) images. I've never tried that, but I noticed that the com.lowagie.text.Image class has methods called getOriginalData and getOriginalType; those might be useful for that task.

If that's all you're trying to do, you might check out the PDFBox library, which has this functionality (amongst others).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NullPointerException
 
Similar Threads
Reading Image with JIMI
problem with ImageIO.read
convert java.awt.Image to com.lowagie.text.Image
getblob from db, then convert to byte and write to bitmap/jpeg
Save edited pdf Page in A4 size using itext