We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

ODS to PDF conversion - process runs for ever in .NET

With 21.9.0

var workbook = new Workbook(@“C:\Concierge\file.ods”);

problematicfile.zip (85.9 KB)

If you open this ODS file in MS Excel and take the print preview, you can see that it contains 3,810,832 pages. Similarly if you try to convert this ODS file to PDF using MS Excel, it also fails. You need to update the print area of your ODS file and then convert it to PDF which takes around 4 to 5 seconds for the conversion. Please give a try to the following updated ODS file and share your feedback.
AAROGYA RSS LIST_Updated_PrintArea.ods.zip (87.2 KB)

Is there any way to set the print area using Aspose? The whole point with using Aspose is because the user don’t have access to Excel. I need automate the whole process.

You can set the print area with below code:

Workbook wb = new Workbook("test.ods");
wb.Worksheets["sheet1"].PageSetup.PrintArea = "A1:C22";

Let us know your feedback.


Moreover, if you do not have access to template Excel file and do not know actual data range of the sheet, you may use Worksheet.Cells.DeleteBlankRows and Worksheet.Cells.DeleteBlankColumns (on safer side) to remove all unnecessary blank rows and columns before rendering to PDF. See the sample code for your reference. I have tested it using your input ODS file and it works fine and efficiently:
Sample code:

Workbook wb = new Workbook("e:\\test2\\AAROGYA RSS LIST.ods");

Hope, this helps a bit.