SheetRendrer doesn't honor pageIndex when rendering ODS to PNG


I use java lib aspose-cells v 18.10 . The task is to create png image for the first page of the first worksheet. I use the code provided in aspose docs
It works for all table formats (xls, xlsx, etc) but for ODS the resulting image conatins whole worksheet.


You may please give a try to the following sample code and provide your feedback. If issue is still there, please share your sample code and template ODS file for our testing.

Workbook book = new Workbook("Sample.ods");
Worksheet sheet = book.getWorksheets().get(0);
ImageOrPrintOptions options = new ImageOrPrintOptions();
SheetRender sr = new SheetRender(sheet, options);
sr.toImage(0, "outputJava.png");

outputJava.png (54.7 KB) (12.1 KB)


Your code works fine with your data. But it doesn’t on mine. See ods and png in attachment.
I think the difference is the intentional page break in my ods file. While yours just has many rows. (3.2 KB)
transformed_ods.png (1.8 KB)



Thanks for the sample ODS file and image file.

It might be an issue with your version (older). Please try using our latest version/fix: Aspose.Cells for Java v19.6.3: (6.5 MB)

I have tested using your sample ODS file and it works fine…

Let us know your feedback.


@Amjad_Sahi Yes, you’re right. v19.6.3 works correctly



Good to know that the latest version/fix fixes your issue now. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.