Free Support Forum - groupdocs.com

V17.2.0 Unable to render excel, pptx file in image format

Hi,
I am using GroupDocs.Viewer 17.2.0 for Java . I have a trial license and When i try to render to xlsx and pptx files in image(png or jpg) format it is throwing following exception.
Exception: image == null!
java.lang.IllegalArgumentException: image == null!
at javax.imageio.ImageTypeSpecifier.createFromRenderedImage(ImageTypeSpecifier.java:925)
at javax.imageio.ImageIO.getWriter(ImageIO.java:1592)
at javax.imageio.ImageIO.write(ImageIO.java:1520)
at com.groupdocs.viewer.examples.Utilities.saveAsImage(Utilities.java:110)
at com.groupdocs.viewer.examples.MainClass.main(MainClass.java:225)

Here is the code snippet that i am using :
ViewerConfig config = Utilities.getConfiguration();
ViewerImageHandler imageHandler = new ViewerImageHandler(config);
String guid = fileName;
ImageOptions imageOptions = new ImageOptions();
imageOptions.setConvertImageFileType(ConvertImageFileType.PNG);
List pages = imageHandler.getPages(guid, imageOptions);
for (PageImage page : pages) {
Utilities.saveAsImage(page.getPageNumber() + “_” + fileName, “png”, page.getStream());
}

It is failing in saveAsImage() since ImageIO.read(inputStream) is returning null inside the method.

Thanks
Shruthi

@shruthis,

Thank you for the inquiry and sharing the details.
We are successfully able to reproduce this issue at our end. Hence, we’ve logged it in our internal issue tracking system with ID:VIEWERJAVA-1490. As we get any update from the concerned team, you will be notified.