Welcome Guest Search | Active Topics | Sign In | Register

NullReferenceException from EO.pdf.dll Options
Roy
Posted: Thursday, July 14, 2016 5:11:55 AM
Rank: Newbie
Groups: Member

Joined: 7/14/2016
Posts: 2
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.
eo_support
Posted: Thursday, July 14, 2016 11:52:53 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
Hi,

Can you send the test project to us? See here for more details:

http://www.essentialobjects.com/forum/test_project.aspx

We will look into it as soon as we have it.

Thanks!
Roy
Posted: Tuesday, July 26, 2016 4:02:40 AM
Rank: Newbie
Groups: Member

Joined: 7/14/2016
Posts: 2
I just wanted to let everyone know that this issue is fixed in version 16.1.54.0.
Thanks Essential Objects!
eo_support
Posted: Tuesday, July 26, 2016 6:08:00 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
Great. Thanks for confirming the fix!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.