|
Rank: Newbie Groups: Member
Joined: 5/25/2017 Posts: 5
|
Hi, I am using Eo.PDF v17.1.55. I use HtmlToPdf.ConvertHtml to covert the html to pdf, when Eo.PDF run about 70 times, It occured ChildProcessOutOfMemoryException. My html is including D3.js, WebFont, svg. I found japanese font NotoSansCJKjp can resulting in ChildProcessOutOfMemoryException. Quote: @font-face { font-family: "NotoSansCJKjp Bold"; src: url(file://C:/Users/rson/Documents/haapi/pdfhtml/font/NotoSansCJKjp-Bold.otf) format('opentype'); } How I can do ?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi, Please try a few things: 1. Set EO.Base.Runtime.EnableEOWP to true: https://www.essentialobjects.com/doc/eo.base.runtime.enableeowp.aspxThis property will double the work process's available memory space from 2GB to 4GB and should resolve most out of memory issue; 2. If you haven't already done so, upgrade to .65 build. Build .55 can crash when your page is extremely wide. Build .65 fixed this issue. If you continue to have problems after the above change, please try to isolate the problem into a test project and send the test project to us. See here for more details: https://www.essentialobjects.com/forum/test_project.aspxOnce we have that we will be happy to investigate further. Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 5/25/2017 Posts: 5
|
Hi,
I send test file to you.
when I installed the NotoSansCJKjp font to the server running Eo.pdf, and use local fonts, It run well.
@font-face { font-family: "NotoSansCJKjp Bold"; src: local(Noto Sans CJK JP) }
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
We have looked into this issue and it does appear to be an issue in the browser engine. If you load the sample page in Google Chrome browser and keeps refereshing the page, the memory usage of one of the child process will keep climbing up. However because Google Chrome is 64 bit by default, so it will take a long time for it to run out of memory. EO.WebBrowser on the other hand, runs the child process in 32 bit in order to be compatible with 32 bit systems and it will reach the per process memory limit very quickly.
It is not practical for us to fix such memory issues inside the browser engine. So your best option is to change your code to tolerate it. In your case, you can do the following:
1. Handle EO.Base.Runtime.Exception event to silent this error; 2. Use a try catch block to catch exception for ConvertHtml/ConvertUrl and try again if it fails;
This way the ChildProcessOutOfMemoryException will still occur but because it crashes the child process, the next time you call ConvertHtml/ConvertUrl again, it should start a new child process and this child process will succeed. The new child process can perform a number of conversions again and it will eventually crashes and another one will start over again. However your application can safely rely on such recycling mechanism and still handle the request correctly due to such recovering behavior.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 5/25/2017 Posts: 5
|
Thanks a lot. Eo.pdf is best C# library for converting HTML to PDF really.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Glad to hear that! Please feel free to let us know if you have any other questions.
|
|