We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Convert Excel File to PDF throw a nullReferenceException.

Thread ID:

Created:

Updated:

Platform:

Replies:

119555 Jul 8,2015 05:39 AM Jul 9,2015 04:56 AM ASP.NET MVC 2
loading
Tags: XlsIO
Bronts
Asked On July 8, 2015 05:39 AM

Hello.
I need convert one excel file to PDF and save it.
I use the code as your sample code.
But it was running and throwed a NullReferenceException.
I tested a simple excel file. it worked well. But another one not. It contains some formula.


I post the two excel file with attach file. please test.

thank you.

//Step 1: Instantiates the spreadsheet creation engine.
ExcelEngine excelEngine = new ExcelEngine();

//Step 2: Instantiates the excel application object.

IApplication application = excelEngine.Excel;

 

IWorkbook workbook = application.Workbooks.Open("Sample.xlsx"ExcelOpenType.Automatic);

 

//Opens the Excel Document to Convert.

ExcelToPdfConverter converter = new ExcelToPdfConverter(workbook);

 

//Intializes the PDFDocument.

PdfDocument pdfDoc = new PdfDocument();

 

//Intializes the ExcelToPdfconverterSettings.

ExcelToPdfConverterSettings settings = new ExcelToPdfConverterSettings();

 

//Converts Excel Document into PDF document.

// this line throw exception!

pdfDoc = converter.Convert(settings);

 

//Saves the pdf file.

pdfDoc.Save("ExceltoPDF.pdf");


Attachment: excellFile_6e28acfc.zip

Bronts
Replied On July 8, 2015 05:44 AM

And I tested with Microsoft API. 
Microsoft.Office.Interop.Excel
It saved to PDF and worked well.
So I guess there is some bug in XlsIO

Ishwarya Narayanan [Syncfusion]
Replied On July 9, 2015 04:56 AM

Hi Bronts,

 

Thank you for using Syncfusion products.

We were able to reproduce the issue and have logged defect report regarding this. We have provided the estimation time line for this fix in the incident you have created. Kindly follow up that incident to get further updates.


Please let me know if you have any questions.

Regards,
Ishwarya N


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;