简体   繁体   中英

How to convert a xls/xlsx file using Syncfusion in C#

I am getting the System out of memory exception. The size of my xls file is 357 mb. I am not sure what has to be configured to allow opening of heavy files.

I'm refering to the documentation available on this website https://help.syncfusion.com/file-formats/xlsio/excel-to-pdf-conversion

The stacktrace is as below:

at Syncfusion.XlsIO.Parser.Biff_Records.BiffContinueRecordRaw.ExtractContinueRecords() at Syncfusion.XlsIO.Parser.Biff_Records.MSODrawingGroupRecord.ParseStructure() at Syncfusion.XlsIO.Parser.Biff_Records.BiffRecordRawWithArray.ParseStructure(DataProvider provider, Int32 iOffset, Int32 iLength, ExcelVersion version) at Syncfusion.XlsIO.Parser.Biff_Records.BiffRecordRaw.FillRecord(BinaryReader reader, DataProvider provider, IDecryptor decryptor, Byte[] arrBuffer)

Please let me know if any information required.

Edit 2: Code

ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
**IWorkbook workbook = application.Workbooks.Open(src_file, ExcelOpenType.Automatic);**
ExcelToPdfConverter converter = new ExcelToPdfConverter(workbook);

The line at which the exception occurs has been marked with asteriks

We can reduce the usage of the memory consumption by using “ParseWorksheetsOnDemand” . Please refer the UG for more details, we have also discussed similar issue in the forum .

For further validation please provide us your input document through the Direct-Trac, we will analyze it further and provide more details.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM