1 page lost when converting to image

Thank you for your support.

I have converted 2000page.xlsx to image however page 1991 has not been generated and the total image counts are 1999.
2000page.zip (11.8 KB)

This is my code.

public class ConvertWorksheetToImageByPage
{
public static void Run()
{
// ExStart:1
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

        //Workbook book = new Workbook(dataDir+ "TestData.xlsx");
        Workbook book = new Workbook(dataDir + "2000page.xlsx");
        Worksheet sheet = book.Worksheets[0];
        Aspose.Cells.Rendering.ImageOrPrintOptions options = new Aspose.Cells.Rendering.ImageOrPrintOptions();
        options.HorizontalResolution = 200;
        options.VerticalResolution = 200;
        options.ImageFormat = System.Drawing.Imaging.ImageFormat.Tiff;

        // Sheet2Image By Page conversion
        SheetRender sr = new SheetRender(sheet, options);
        for (int j = 0; j < sr.PageCount; j++)
        {
            sr.ToImage(j, dataDir+ "test" + sheet.Name + " Page" + (j + 1) + ".out.tif");
        }

        // ExEnd:1
                   
    }
}

@PFU.DSOL2,

Thanks for the template file and sample code.

After an initial test, I observed the issue as you mentioned by using your sample code with your template file. I found that one page is lost when converting worksheet to image files. The page 1991 has not been generated and thus total image count is 1999 instead of 2000. I have logged a ticket with an id “CELLSNET-45772” for your issue. We will look into it soon.

Once we have an update on it, we will let you know here.

@PFU.DSOL2,

Please try our latest version/fix: Aspose.Cells for .NET v17.11.2.

We have fixed your issue now.

Let us know your feedback.

The issues you have found earlier (filed as CELLSNET-45772) have been fixed in this Aspose.Cells for .NET 17.12 update.

Please also check the following article: