Missing Rows in PDF


I am using Aspose.Cells .NET to convert an excel-file to PDF. But the last two rows are missing in the PDF. When I use Excel to save the file as PDF, the PDF looks fine.

My code:
Aspose.Cells.Workbook doc = new Aspose.Cells.Workbook(quelle);
doc.Save(ziel, Aspose.Cells.SaveFormat.Pdf);

I’ve tested with the lastest version 19.7. Is this a bug in Aspose.Cells?

In the attachment, you can find the original excel-file and both PDFs (created with Aspose and with Excel).
Example.zip (164.8 KB)



Thanks for the template file.

I have evaluated your scenario/ case a bit using your template file. I found the Printable area is set as “A1:H15” (see the screenshot for your reference), so it won’t render the rows beyond that area which is outside of this area. You got to clear this area (printable area for worksheet PageSetup) either dynamically by Aspose.Cells APIs or manually in MS Excel.

For example, you should set the print area to null or “” for the sheet if you need to print all the contents of the worksheet in the book. See the sample line of code for your reference:
Sample code:

 doc.Worksheets["System 1"].PageSetup.PrintArea = null;

Let us know if you still have any issue.


Thank you for the fast reply.
When I go to the page setup (Excel 2019), the print area is grayed out and the field is empty. Also removing the print area manually in Excel and saving the file didn’t change anything.
But nevertheless, setting the print area with Aspose did work. Now the whole page is converted to PDF. So I will implement this solution.

Thanks again for your help.



Good to know that your issue is sorted out by setting the print area as null/empty as suggested. 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.