How to rendering a blank sheet or empty sheet in java cells


If we want to rendering the blank sheet or empty sheet on excel cell for java is it possible?

If there is a blank sheet in a rendering loop , it will give out error message .



Thanks for using Aspose APIs.

Please use the following property and set it true and it should fulfill your needs.


This property is introduced recently, so you must use the most recent version.

Here is the sample code and its output png image for your reference.


Workbook wb = new Workbook();

Worksheet ws = wb.getWorksheets().get(0);

ImageOrPrintOptions opts = new ImageOrPrintOptions();
opts.setOutputBlankPageWhenNothingToPrint(true);//<<<<<<<<<<<<<<<<<<<Use this property

SheetRender sr = new SheetRender(ws, opts);
sr.toImage(0, dirPath + "out.png");

Download Links:
Aspose.Cells for Java v17.7.7
out.jpg (3.4 KB)