Free Support Forum -

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

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(
at javax.imageio.ImageIO.getWriter(
at javax.imageio.ImageIO.write(
at com.groupdocs.viewer.examples.Utilities.saveAsImage(
at com.groupdocs.viewer.examples.MainClass.main(

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();
List pages = imageHandler.getPages(guid, imageOptions);
for (PageImage page : pages) {
Utilities.saveAsImage(page.getPageNumber() + “_” + fileName, “png”, page.getStream());

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



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.