If I want to convert excel file (attached) to pdf, I get this exception.
Exception Details:
Bitworks.eQMS.UnitTest.AsposeTest.GeneratePDFFromExcel:
Aspose.Cells.CellsException : Object reference not set to an instance of an object.
Stack:
at ..(Stream )
at Aspose.Cells.Workbook.Save(Stream stream, SaveOptions saveOptions)
Thanks
Hi,
Thanks for using Aspose.Cells for .NET.
I have tested your issue with the latest version:
Aspose.Cells
for .NET v7.3.0.3 and found it is working fine.
I have attached the output pdf generated with the following code. Please download and check it.
C#
string filePath = @“F:\MS_Excel_Datei_(Fehlermeldung).xlsx”;
Workbook workbook = new Workbook(filePath);
workbook.Save(filePath + “.out.pdf”);
Hi,
I think problem is font type: ConduitITCStd Light
If I change font type to e.g. Arial, I don’t get the error.
In your working enviroment I think there is no font type like ConduitITCStd Light, so it’s automatically changed to Arial or sth. like this.
Is this a general problem?
Hi,
Thanks for your feedback.
Could you please provide ConduitITCStd Light font so that I could test it on my end?
Also, you could try setting the font directory like this.
C#
CellsHelper.FontDir = @“D:\WINDOWS\Fonts”;
//Rest of the code goes here
I attached fonts …
Hi,
Thanks for your fonts.
I have installed the fonts on my Windows XP and re-run the code and I was not able to replicate this issue using the latest version:
Aspose.Cells
for .NET v7.3.0.3
Below is a screenshot for your reference.
I have also attached the output pdf, please check it.
Screenshot:
Hi,
the problem is still alive.
If i change italic font style to normal the problem doesn’t occur.
But if there is an italic font style element with font type “Conduit” pdf creation crashes with reported exception.
I attached file one more time.
Hi,
Thanks for using Aspose.Cells.
Please download and try the latest major release:
Aspose.Cells for .NET 7.3.1
and let us know your feedback.
I have attached the generated pdf using the following code with the above version.
C#
string filePath = @“F:\Shak-Data-RW\Downloads\MSExcelDateiFehlermeldung.xlsx”;
Workbook workbook = new Workbook(filePath);
PdfSaveOptions opts = new PdfSaveOptions();
opts.OnePagePerSheet = true;
workbook.Save(filePath + “.out.pdf”, opts);
Hi,
I still get this error.
Your example isn’t buidlable with the latest code of 7.3.1.
There is no Option “OnePagerPerSheet” in PDFSaveOptions and there is no method taking PDFSaveOptions as argument in workbook.Save method.
Do you use another newer … version of Cells?
Hi,
Sorry,
but I’m using the right dll (it’s not the first time I’m working with your components)
I attached overview of save methods using .Net Reflector and overview of dll details from explorer info.
Chris2Stein:
I still get this error.
Your example isn't buidlable with the latest code of 7.3.1.
There is no Option "OnePagerPerSheet" in PDFSaveOptions and there is no method taking PDFSaveOptions as argument in workbook.Save method.
I attached console app project (VS 2010) - without licence.
Please ensure to have installed correct font types!
Hi,
Hi,
we still have this problem using Cells 7.4.2.5 (.NET 2.0)
I think, problem is font ConduitITCStd Light italic like described in earlier posts.
I attached fonts, please be sure to have this font installed on your System.
(open Excl file and check, if font is ConduitITCStd Light italic)
Thanks
Hi,
Thanks for your posting and using Aspose.Cells.
Please remove otf font and convert otf to ttf using http://www.font2web.com and reinstall it.
It will solve your issue.
Hi,
now I had time to check and after changing server font types it worked fine.
Thank you.
Hi,
Thanks for your feedback.
It is good to know your issue is resolved now. If you face any other issue, please feel free to post on our forum, we will be glad to help you further.