Welcome Guest Search | Active Topics | Sign In | Register

HtmlToPdf conversions failing Options
Peavy
Posted: Thursday, March 15, 2018 2:41:21 PM
Rank: Advanced Member
Groups: Member

Joined: 6/26/2015
Posts: 98
Hello,

We are having issues with HtmlToPdf conversion crashing/failing in different scenarios. We load the HTML directly, rather than using LoadUrl, and set the base URL. We've noticed this usually happens with large HTML, but also happens on shorter HTML. Below are a few examples:

URL: https://www.wealthsimple.com/en-us/magazine
HTML: https://pastebin.com/gWxPJh5Z
Error: Conversion failed. Browser engine failed to render page. WebView is closed. Reason: RenderCrash
Stack:
EO.Pdf.HtmlToPdfException.b(Exception A_0):32
EO.Internal.a3a.a(agc A_0):3236
EO.Pdf.HtmlToPdfSession.RenderAsPDF(PdfDocument doc):202
EO.Pdf.HtmlToPdf.ConvertHtml(String html, PdfDocument doc, HtmlToPdfOptions options):54
EO.Pdf.HtmlToPdf.ConvertHtml(String html, Stream stream, HtmlToPdfOptions options):1

URL: https://www.facebook.com/scott.byrd.395/timeline/2014
HTML: Too large to post, roughly 20MB
Error: Conversion failed. Browser engine failed to render page. Failed on command 4
Stack:
EO.Pdf.HtmlToPdfException.b(Exception A_0):32
EO.Internal.a3a.a(agc A_0):3236
EO.Pdf.HtmlToPdfSession.RenderAsPDF(PdfDocument doc):202
EO.Pdf.HtmlToPdf.ConvertHtml(String html, PdfDocument doc, HtmlToPdfOptions options):54
EO.Pdf.HtmlToPdf.ConvertHtml(String html, Stream stream, HtmlToPdfOptions options):1

URL: https://twitter.com/RogueFitness
HTML: Too large to post
Stack:
EO.Pdf.HtmlToPdfException.b(Exception A_0):32
EO.Internal.a3a.a(agc A_0):3236
EO.Pdf.HtmlToPdfSession.RenderAsPDF(PdfDocument doc):202
EO.Pdf.HtmlToPdf.ConvertHtml(String html, PdfDocument doc, HtmlToPdfOptions options):54
EO.Pdf.HtmlToPdf.ConvertHtml(String html, Stream stream, HtmlToPdfOptions options):1
eo_support
Posted: Friday, March 16, 2018 3:07:02 PM
Rank: Administration
Groups: Administration

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

This is usually due to out of memory situation in the browser engine. The most common trigger of this problem is:

1. Large HTML file;
2. Large images in the HTML file;
3. Advanced CSS features such as CSS shadows in the HTML file. Such CSS settings would turn the whole area to a bitmap and significantly increase the memory consumption and final PDF file size (if the conversion goes through);

Generally for such cases you must modify the original HTML to reduce the memory consumption, or split the original files into multiple section to convert separately and then merge the result PDF files into a single one. Even though EO.Pdf and Google Chrome browser are both based on Chromium browser engine, EO.Pdf does not have the same capacity on large HTML files as the Google Chrome browser because EO.Pdf always runs the browser engine in 32 bit (to avoid shipping with both 32 bit and 64 bit binaries), while this is sufficient for most cases, for large files it does fail.

Thanks!
Peavy
Posted: Friday, March 16, 2018 3:22:00 PM
Rank: Advanced Member
Groups: Member

Joined: 6/26/2015
Posts: 98
Hello,

Alright that makes sense. I guess that brings us to a different question. We also use the WebBrowser and often see crashes (usually on large pages, so probably due to memory utilization). On there we use eowp, but we have noticed that is also a 32-bit process. Is EO planning on shipping 64-bit binaries at any point? Nearly all platforms now support 64-bit and as web apps are only getting large and more complex, we're running into these issues more often.
eo_support
Posted: Friday, March 16, 2018 3:48:44 PM
Rank: Administration
Groups: Administration

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

eowp.exe is also 32 bit but it can improve the situation a bit because it is compiled with "large address aware" flag, which allows it uses 4GB as oppose to the default 2GB space.

As for 64 bit binaries, we are in a wait and see position ---- right now we ship 32 bit and we can run on both 32 bit and 64 bit system; However if we ship 64 bit binaries we will no longer be able to run on 32 bit systems. Another option is to ship two set of binaries: one for 32 bit systems and one for 64 bit systems, obviously that is not a good option either since one of the biggest advantage of .NET application is that the developers don't have to worry about 32 bit or 64 bit.

Thanks!
Peavy
Posted: Friday, March 16, 2018 4:57:13 PM
Rank: Advanced Member
Groups: Member

Joined: 6/26/2015
Posts: 98
Hello,

eowp.exe definitely has some improvement, as the HTML that failed on HTML conversion comes from our WebBrowser application, but we also have many instances where it crashes.

If you're taking client opinions, we would definitely vote for shipping a 64-bit option as we're running into this issue more often. Also, if it's possible to request a 64-bit build as needed, it would be much appreciated as it would help with the issues that we are seeing. Just this year, our systems have logged over 2000 exceptions that seem to be related to running out of memory/crashing.

Thank you.
eo_support
Posted: Tuesday, March 20, 2018 9:45:07 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,221
Thanks for the valuable feedback. While it is not possible for us to accommodate every customer exactly in the way they wanted, we are always listening and feedbacks are always extremely appreciated.


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.