Free Support Forum -

Problem with Aspose.PDF.Document from HTML

I’m evaluating the product, and I’m having an issue. I’m trying to convert an HTML file into a PDF using the following C# code:

LoadOptions options = new HtmlLoadOptions(“C:\_Working\Aspose\Sample Files\out.htm”);
Aspose.Pdf.Document doc = new Aspose.Pdf.Document(“C:\_Working\Aspose\Sample Files\out.htm”, options);

And it’s throwing a null reference exception on the second line. The stack trace is below. I’ve attached a zip file containing the project along with the HTML document I’m trying to convert.

at Ÿ.„š.ž™(ž )
at Ÿ.„š.œ“•(ž )
at ›Œ•.•.ž™(ž )
at Ÿ.„š.œ“•(ž )
at ›Œ•.•.ž™(ž )
at ›Œ•.•.ž™(ž )
at ›Œ•.‘.ž™(ž )
at œ•.•.›(‘ )
at ™•.˜Ž•.Convert(‘ , ˜• )
at ™•.˜Ž•.Convert(String , ˜• )
at ‰.™a–.Convert(Stream , Document , e , LoadOptions , Boolean , Boolean )
at Aspose.Pdf.Document.eƒ—(Stream , LoadOptions )
at Aspose.Pdf.Document…ctor(String filename, LoadOptions options)
at ConsoleApplication1.Program.Main(String[] args) in C:_Working\Aspose\Problem\ConsoleApplication1\ConsoleApplication1\Program.cs:line 14
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.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

Hi Rory,

Thanks for your inquiry. I am afraid we are unable to unzip your shared document using Winzip and Winrar utility, can you please share it again? So we will look into it and provide you more information accordingly.

we are sorry for the inconvenience caused.

Best Regards,

I used Winzip to create that zip file. I don’t have WinRar, but I have 7-zip. Here’s a new one zipped with 7-zip.

Hi Rory,

Thanks for sharing source files again. While testing the scenario with the latest version of Aspose.Pdf for NET 9.1.0, We have noticed an ArgumentNullException and logged it in our bug tracking system as PDFNEWNET-36775 for further investigation and resolution. We will notify you via this thread as soon as it is resolved.

We are sorry for the inconvenience caused

Best Regards,

The issues you have found earlier (filed as PDFNEWNET-36775) have been fixed in Aspose.Pdf for .NET 16.11.0.

This message was posted using Notification2Forum from Downloads module by Aspose Notifier.