Free Support Forum -

Convert a multi paged document to images using Java

I downloaded the GroupDocs.Conversion-for-Java and tried to use the convertToImageAsFilePath and got the error:
Exception in thread “main” Saving complete multipage document to image is not supported. Please save by page.
at Source)
at com.groupdocs.conversion.domain.documents.h.a(Unknown Source)
at Source)
at com.groupdocs.conversion.examples.Conversion.convertToImageAsFilePath(
at com.groupdocs.conversion.examples.MainClass.main(

I’m using version 18.7 and according to this post, it was solved in version 17.12.

Can you help me?



Thanks for taking interest in GroupDocs.Conversion for Java and posting your concerns.
Can you please use following code in order to avoid exception/error:

SaveOptions saveOption = new ImageSaveOptions();
ConvertedDocument result = conversionHandler.<List<String>>convert("document.pdf", saveOption);
for (int i = 1; i <= result.getPageCount(); i++) {"output" + i + "." + result.getFileType(), i);

Thanks but this creates multiple output files. That’s not exactly what I was looking for.
I’m trying to convert a multipage pdf file into a multipage image file such as a tiff file.

It seems that it works when I change it to:
but the example that I downloaded from git was with jpg file type and is not supported which was very confusing.

1 Like


Good to know that.
Actually, there are multiple image file types (e.g. jpg, tiff, png) and conversion process is same so we set it to JPG but you can change it to other supported formats as well.