Aspose.Cells: Large XLSX to PDF conversion


Are there any limitations concerning the file and it's size, number of rows, or number of columns, that aren't documented?
We have been trying to convert a large XLSX (~170mb, ~325k rows, ~40 columns) to PDF.
It takes roughly 2 minutes to construct the Workbook object and when I try to save it as a PDF, the application keeps running and uses around 2.7gb of RAM. I let it run for over an hour and a half before I killed the process.

The application's platform target is set to x64.
Using the latest build of Aspose.Cells.

LoadDataOption dataOption = new LoadDataOption();

dataOption.SheetIndexes = new int[] { 0 };

dataOption.ImportFormula = true;

LoadOptions loadOptions = new LoadOptions(LoadFormat.Xlsx);

loadOptions.LoadDataOnly = true;

loadOptions.LoadDataOptions = dataOption;

Console.WriteLine("Loading... " + DateTime.UtcNow.ToString());

Aspose.Cells.Workbook doc = new Aspose.Cells.Workbook(asset.FilePath, loadOptions);

Console.WriteLine("Loaded. " + DateTime.UtcNow.ToString());

string tmpPDF = string.Format("C:\\Temp\\{0}.pdf", Guid.NewGuid().ToString());

Console.WriteLine("Saving... " + DateTime.UtcNow.ToString());

doc.SaveOptions.CachedFileFolder = "C:\\Temp";

doc.Save(tmpPDF, new PdfSaveOptions() { CachedFileFolder = "C:\\Temp" });

Console.WriteLine("Saved. " + DateTime.UtcNow.ToString());


Is there anything that can be done to resolve this?

Thanks in advance.

jc@stylelabs

Hi,

Thanks for your posting and using Aspose.Cells.

Your source file is quite large, so it will consume more memory and processing time. Normally, the memory requirements are 10 times the size of the source workbooks. Please save the pdf using the following option.

C#


PdfSaveOptions pso = new PdfSaveOptions();

pso.PdfCompression = PdfCompressionCore.None;

book.Save(path + fi.Name + “.pdf”,pso);



We converted the 60MB file successfully to PDF and it took 2 hours and resultant PDF size was 1.8 GB and it took 400 MB memory using the above code. Since your file is 170MB, it might take 4-6 hours based on this observation.

Please make the above changes in your code and try again. Please also download and use the latest version: Aspose.Cells for .NET v7.6.1.4 for your needs.