Free Support Forum - aspose.com

Convertion from XLSX to PDF taking too much time and resources

Hello Aspose Team,


I’m having huge troubles converting from xlsx to PDF. For example, trying to do it with a 8MB file takes hours and generate a very large file (it was 68MB when I stopped my service and still hasn’t finished).

I needed to stop my service because there was some of these processes executing simultaneously with different files. After some time of that, the memory crashed and the application became way too slow.

This conversion is essential for us because is the way we show it to the user (in our online viewer). But unfortunately I’ll need to stop doing it for a time because is messing with CPU and memory.

The code I use is as follow

Workbook workbook = new Workbook(filePath);
workbook.getSettings().setRegion(CountryCode.DEFAULT);
workbook.save(pdfFilePath, com.aspose.cells.SaveFormat.PDF);

Is there something I can do to fix this? I can’t send you the an example because its our client data, but it happens with any file large enough (above 7MB or so, I guess).


Hi,

Thanks for your posting and using Aspose.Cells.

Excel to PDF conversion depends on the number of pages. If there are lot of pages like say 500-5000 or more, it will take time accordingly. Aspose.Cells converts the Excel file into PDF as per Microsoft Excel Print Preview.

So open your excel file in Microsoft Excel 2010 or later and check the Print Preview and see how many pages are there.

For your help, I have attached the sample excel file which has total of 5 pages. You need to select Print Entire Workbook and No scaling to get correct number of pages. Please check the screenshot attached by me for your reference.

Please also download and try the latest version: and see if makes any difference and resolves your issue.

I have also made this thread Private, so now only you or Aspose Staff members can access your files in this thread. So it is now safe for you to attach the files and provide to us for our investigation.