After upgrading Spire.Office from version 8.9.2 to 10.1.0 and above, we have encountered significant performance issues when converting Excel files to PDF documents.
Below is a simplified version of the code we are using:
- Code: Select all
using (var workbook = new Workbook())
{
workbook.LoadFromStream(request.FileStream);
for (var i = 0; i < workbook.Worksheets.Count; i++)
{
// workbook.Worksheets[i].PageSetup.IsFitToPage = true;
workbook.Worksheets[i].PageSetup.FitToPagesWide = 1;
workbook.Worksheets[i].PageSetup.FitToPagesTall = 0;
}
workbook.SaveToStream(response.Stream, Spire.Xls.FileFormat.PDF);
return response;
}
Performance Comparison
Test File Spire.Office 8.9.2 Spire.Office 10.1.0+
test1 < 1 second ~29 seconds average
test2 ~40 seconds average Never completes
We are attaching the two mentioned test files (test1 and test2) to help you reproduce the issue.
If you need any additional information, please don't hesitate to ask.