An unhandled exception of type ' ' occurred in Aspose.Pdf.dll

I’m trying to convert a html file into a pdf file but get the following exception:

aspose pdf version: 11.6.0.0


An unhandled exception of type ’ ’ occurred in Aspose.Pdf.dll
Additional information: No conversion defined 1,2

at . ( , String , )
at ​ . ( , String , )
at ​ . ( )
at . ( , Boolean )
at . (Int32 , , Boolean , Boolean )
at . (Int32 , , Boolean , Boolean )
at . (Int32 , Boolean , Boolean )
at . (Int32 , Boolean , Boolean )
at . ( )
at . ( )
at . ( )
at . ( )
at . ( )
at . ( )
at . ( )
at . ( )
at . ( , )
at . (Stream , )
at . (Stream , Document , , HtmlLoadOptions )
at Aspose.Pdf.Document. (Stream , LoadOptions )
at Aspose.Pdf.Document…ctor(String filename, LoadOptions options)
at ConsoleApplication2.PdfController.Convert() in c:\users\atempela\documents\visual studio 2015\Projects\ConsoleApplication2\ConsoleApplication2\PdfController.cs:line 15
at ConsoleApplication2.Program.Main(String[] args) in c:\users\atempela\documents\visual studio 2015\Projects\ConsoleApplication2\ConsoleApplication2\Program.cs:line 13
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

code:

HtmlLoadOptions htmlLoadOptions = new HtmlLoadOptions();
htmlLoadOptions.PageInfo.Margin.Bottom = 10;
htmlLoadOptions.PageInfo.Margin.Top = 20;
//see html file in solution
Document doc = new Document(“C:/Projects/FileUpload/Temp/0a682f2a-3449-4c51-a493-3ef38d251d6c.html”, new HtmlLoadOptions());

doc.Save(@“c:\temp\test4.pdf”);


The problem seems to be related with the regional setting of the system

When decimal symbol becomes ‘,’ instead of ‘.’ or digit grouping symbol ‘.’ of ‘,’ the aspose pdf lib throw an useless empty error!

See No conversion defined 1,2.

This can’t be right?

Hi Andy,


Thanks for using our API’s.

I have tested the scenario using Aspose.Pdf for .NET 11.7.0 in Visual Studio 2010 project with .NET Framework 4.0 running over Windows 7 (x64) with Regional Settings as English (United States) and I am unable to notice any issue. Can you please share some details regarding your working environment i.e. Operating Systems detail, Regional Language settings etc, so that we can again try replicating the issue in our environment.

We are sorry for this inconvenience.

[C#]

HtmlLoadOptions htmlLoadOptions = new HtmlLoadOptions();<o:p></o:p>

htmlLoadOptions.PageInfo.Margin.Bottom = 10;

htmlLoadOptions.PageInfo.Margin.Top = 20;

//see html file in solution

Document doc = new Document(@"C:\0a682f2a-3449-4c51-a493-3ef38d251d6c.html", new HtmlLoadOptions());

doc.Save(@“C:\0a682f2a-3449-4c51-a493-3ef38d251d6c.pdf”);


Hi,
I've tested with version 11.7.0 and had the same problem.
Just goto regional settings, set format to english (united states), goto additional.

Switch Decimal symbol from . -> ,
Switch Digit grouping symbol from , -> .

Save settings and try running code above.
Save.

My operating system:
Windows 10, .Net framework 4.5

Hi Andy,


Thanks for sharing the details.

I have tested the scenario using Aspose.Pdf for .NET 11.7. 0 in VisualStudio 2015 project with .NET Framework 4.5 running over Windows 10 (x64) and I am unable to notice any issue. Before performing the conversion, I have set regional language settings and custom formatting as per your earlier shared image but still I am unable to reproduce it. If possible, please share some sample project, so that we can again try replicating the issue in our environment. We are sorry for this inconvenience.

That’s strange, we’ve tested the same scenario on some different pc’s (same setup windows 10 and 7, 64 bit) and after the regional setting additional change, they all encounterd the same problem. Just switch decimal symbol from ‘dot’ to ‘comma’ and digit grouping symbol from comma to ‘dot’.


Thx



Hi,

Thanks for using our API's.

I have tested the scenario and have managed to reproduce same problem. For the sake of correction, I have logged it as PDFNET-41047 in our issue tracking system. We will further look into the details of this problem and will keep you posted on the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.

The issues you have found earlier (filed as PDFNET-41047) have been fixed in Aspose.PDF for .NET 23.2.