Free Support Forum -

Custom amount of Pdf pages

Hi there,

I’m using Aspose Cells for .NET and try to convert a large xlsx file to pdf.
The pdf results in more than 4000 pages and the conversion takes a lot of time.

Is it possible to save only the first 100 pages to pdf?

Best Regards


Alternatively, I think you may try to set Printable Area with respect to your desired pages using PageSetup options for the worksheet(s) before converting the file to PDF, see the document for reference:

Sample code:
//Obtaining the reference of the PageSetup of the worksheet
PageSetup pageSetup = workbook.Worksheets[0].PageSetup;

//Specifying the cells range (from A1 cell to T135 cell) of the print area
pageSetup.PrintArea = “A1:T135”;

For your information, Aspose.Cells renders PDF document as per the print previews for the sheets shown in MS Excel.

Thank you.