Dear EO,
I recently tried to update EO.PDF from version 4 to 16.1.39.0 in a web server project.
Before I did this, all PDF creation in the project worked, after updating I found that the line:
Code: C#
var htmlToPdfResult = session.RenderAsPDF(sessionMs);
triggers:
"Exception thrown: 'System.NullReferenceException' in EO.Pdf.dll
Additional information: Object reference not set to an instance of an object."
Of course there is quite a bit of surrounding code and so I tried to isolate the issue.
In the project it looks like the following snippit should reproduce the problem (which it does in the project):
Code: C#
using(HtmlToPdfSession session = HtmlToPdfSession.Create())
{
using(var sessionMs = new MemoryStream()) {
var htmlToPdfResult = session.RenderAsPDF(sessionMs);
}
}
I then made a Windows Forms Application with the same code to make sure I would send code to EO support that would trigger the same issue.
But what I found was that in this project, the same line:
Code: C#
var htmlToPdfResult = session.RenderAsPDF(sessionMs);
triggers this instead:
"An unhandled exception of type 'EO.Pdf.HtmlToPdfException' occurred in EO.Pdf.dll
Additional information: Conversion failed. Conversion failed. error code = 1."
I am guessing the latter exception has to do with the fact that it is not running on a webserver.
But why do I get a NullReferenceException on the server?
Thanks in advance,
Roy.