Wednesday, June 27, 2012

[Resolved] WARNING: getRGBImage returned NULL PDFToImage: Rendered Blank Image

Problem:
System returns the following message when converting a PDF file to Image using PDFBox,


Jun 27, 2012 3:45:07 PM org.apache.pdfbox.pdmodel.graphics.xobject.PDPixelMap getRGBImage
SEVERE: Something went wrong ... the pixelmap doesn't contain any data.
Writing: output1.jpg
Jun 27, 2012 3:45:07 PM org.apache.pdfbox.util.operator.pagedrawer.Invoke process
WARNING: getRGBImage returned NULL
result: true



A blanked image will be generated in this case.

Resolution
1. You may try to add Java Advanced Image library I/O Tools to your project for the fix.
http://www.oracle.com/technetwork/java/current-142188.html


2. Include the JAR jai_imageio.jar to your project and execute the project again.


3. Though there is still an WARNING message of EOC marker not found. Codestream is corrupted. shown in the output console, the image is generated successfully.

The usage of PDFBox can be found in the following URL:
http://yp-javadev.blogspot.hk/2012/06/useful-api-converting-pdf-to-image.html

1 comment:

  1. I have pdf which contains images. now I want to conver this pdf to image. I am able to convert pdf to image but without images which are present in the pdf. Please can you advice on this. I followed above steps included jai_imageio.jar still I am facing issues.

    ReplyDelete