PDF conversion of large files causes IIS to lock up

With extemely large files, or files with large amounts of data, cause a timeout issue with the conversion to PDF. A spreadsheet (19000 rows of data) would cause application timed out. When this has occurred, it locks up the world wide web publishing services and causes applications to basically not execute any longer. You will see the progress bar start to move and then it just seems to hang. The only way we have found to correct the issue is to stop/start the service.

What do you think is happening and is there something we can do to prevent it?

Hi,

Thank you for Considering Aspose.

Currently Aspose.Pdf team is working on improving the performance of Aspose.Pdf API for converting large tables to Pdf. For now you should limit the size of the exported data with Print Area, or you can start a new thread to convert the file to pdf in the background.

Thank you & Best Regards,

Can you please elaborate what you mean by “Print Area”?

Hi,

Thank you for considering Aspose.

Well, you can user Worksheet.PageSetup.PrintArea to set the print area before converting the file to XML(for conversion to Pdf).

By specifying the Print Area, we can limit the Area to be printed. So, in the converted XML, only the Specified Print Area data will be loaded and will get printed which will improve the time of printing.

Please see the following link to get an idea of how to set the Print Area,

Thank you & Best Regards,

Thank you for responding so promptly. The Print Area idea seems interesting. Our application allows people to upload documents. The application then converts the uploaded document to PDF. So obviously we don’t know how many rows and columns of data we have for each unique spreadsheet. Is there a way to programmatically detect how many rows and colunms of data a worksheet has in order to tell ASPOSE.Cells to process only the Print Area? Thanks again your help.

Hi,

Thank you for considering Aspose.

You can use Cells.MaxRow or Cells.MaxDataRow properties to get the Maximum index of the row which contains Data in a sheet. To get maximum index of column you can use Cells.MaxColumn or Cells.MaxDataColumn properties. Please see the following code which will help you understand it better,

Sample Code:-

Workbook workbook = new Workbook();

workbook.Open("f:\\Excels\\input.xls");

Worksheet sheet = workbook.Worksheets[0];

//Maximum row index of cell which contains data.

int maximumRow = sheet.Cells.MaxDataRow;

//Or you can use sheet.Cells.MaxRow to get Maximum row index of cell which contains data or style.

//Maximum column index of cell which contains data.

int maximumColumn = sheet.Cells.MaxDataColumn;

//Or you can use sheet.Cells.MaxColumn to get Maximum Column index of cell which contains data or style.

Thank you & Best Regards,