Welcome Guest Search | Active Topics | Sign In | Register

HtmlToPdf.ConvertHtml destination - value cannot be null error / out of memory Options
TrialUser
Posted: Wednesday, January 24, 2018 1:57:23 PM
Rank: Newbie
Groups: Member

Joined: 1/24/2018
Posts: 3
I'm running the trial version of EO Pdf for examination for purchase by my company as a possible replacement for another product.

As a part of exploring the product I'm seeing if it will convert a complex bit of html with styles as a string to a memory stream.

When I run my test on a locally hosted IIS website, it performs very well.

However:

When I run it out of VS 2015 with IIS Express, I'm getting an out-of-memory error. When this occurs only 28% of the computer's memory is being used. (details: Intel Core i7, 32 GB of memory, Win 10 pro, VS 2015 run as debug / release / or any other mode with '32 bit preferred' not checked.)

When installed on a different computer with VS 2017, the error that is seen is 'Value cannot be null. Parameter name: destination'.

The code I'm running is this:

var output = new MemoryStream();
var htmlToPdfOptions = new HtmlToPdfOptions()
{
PageSize = new SizeF(PdfPageSizes.Letter.Height, PdfPageSizes.Letter.Width),
OutputArea = new RectangleF(0, 0, 0, 0),
GeneratePageImages=false
};
HtmlToPdf.ConvertHtml(html,output,htmlToPdfOptions);

Do you know why I'm seeing these errors in VS and how to resolve them?
eo_support
Posted: Wednesday, January 24, 2018 2:25:41 PM
Rank: Administration
Groups: Administration

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

This looks like a bug on our side. If you can isolate the problem into a test project and send the test project to us, we will be happy to investigate further. See here for more details on sending test app to us:

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

Thanks!
TrialUser
Posted: Thursday, January 25, 2018 8:43:11 AM
Rank: Newbie
Groups: Member

Joined: 1/24/2018
Posts: 3
Thanks for your quick reply and your willingness to look into the issue.

When I isolated the code to another project the errors stopped, so I suspect the source of the problem maybe elsewhere with our legacy code base, however this may be hard to diagnose and/or fix.

If you have general ideas about the 'Value cannot be null. Parameter name: destination' error, let me know. Otherwise I think I need to look at other options right now.
eo_support
Posted: Thursday, January 25, 2018 8:58:10 AM
Rank: Administration
Groups: Administration

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

I can't really give you "general ideas" since every scenario can be different and we do not know for sure until we investigate it. However we did fix an issue with the exact error message before that was caused by an input PDF file that contains a minor error --- customer pass a PDF file to our library, our library expects something at a certain place (per the PDF specification) in that file and it is not there. For that particular case we changed our code to be more tolerate ---- so that if it is not there, instead of throwing an exception we ignored it.

Of course your situation can be totally different (most likely it is since that one has already been fixed), so the most effective way for us to resolve this is to isolate it, reproduce it and fix it. Any other approach would be like shooting in the dark --- not only it's very unlikely we will hit anything, but also even if we did hit something, we wouldn't know if it is the same thing that causes the problem for you. This is why we must have a repro first. And we believe this is the best approach for you as well because you could spend all the time to switch to a different solution and then run into other issues with that solution as well.

Thanks!
TrialUser
Posted: Thursday, January 25, 2018 10:38:29 AM
Rank: Newbie
Groups: Member

Joined: 1/24/2018
Posts: 3
Thanks! That makes sense.

Here's something I discovered that might help you for future diagnostics. For us the issue only occurs:

a) when running another memory-intensive third-party dll in our workflow before calling that ConvertHtml method; a dll which has had other issues in the past

b) when VS is run/debugged attached to IIS Express (default) not when running/debugging VS with the site hosted locally in IIS

It's good that we've discovered a work-around for developers, and since we think the primary source of the problem is with another, unrelated, product, I'm going to continue evaluating EO for our use.
eo_support
Posted: Thursday, January 25, 2018 11:03:26 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Thanks for the additional information. We will keep an eye on this. Please feel free to let us know if you run into anything else in the future.


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.