Hi,
Thanks for the template file, sample code and details.
After an initial test, I observed the issue as you mentioned by converting your template file (having empty sheets) to PDF file format. I found when
rendering an empty Excel file to PDF, it still produces the file with
one blank page.
e.g
Sample code:
int length = 1;
int pageIndex = 0;
var workbook = new Workbook("e:\\test2\\Neu+Microsoft+Office+Excel-Arbeitsblatt.xlsx");
var pdfPageCount = new WorkbookRender(workbook, new
ImageOrPrintOptions { SaveFormat = SaveFormat.Pdf }).PageCount; // == 0
workbook.Save("e:\\test2\\outNeu+Microsoft+Office+Excel-Arbeitsblatt1.pdf",
new PdfSaveOptions { PageIndex = pageIndex, PageCount = length }); == 1
Moreover, using WorkboorRender for the empty spreadsheet, I get a page count of 0 which is Ok.
I have logged an investigation ticket with an id "CELLSNET-43345" for your issue. We will look into it if this is expected behavior or a bug which needs to be fixed.
Once we have any update on it, we will let you know here.
Thank you.