Welcome Guest Search | Active Topics | Sign In | Register

Custom Resource Handler Options
LINQ IT
Posted: Friday, July 12, 2019 10:45:37 AM
Rank: Advanced Member
Groups: Member

Joined: 11/8/2015
Posts: 42
I submitted a test project that includes an HTML Body and HTML Header. When generating a PDF, I'm getting the following Exception:

EO.Pdf.HtmlToPdfException: Conversion failed. This WebView either has already been destroyed or is being destroyed. ---> System.Exception: This WebView either has already been destroyed or is being destroyed.
�� at EO.Base.Runtime.a(Object A_0, Exception A_1, Boolean A_2)
�� at EO.WebBrowser.WebView.p()
�� at EO.WebBrowser.WebView.a(WaitableTask A_0, Boolean A_1)
�� at EO.WebBrowser.WebView.a(l0 A_0, Action`1 A_1, Boolean A_2, Boolean A_3, String A_4)
�� at EO.WebBrowser.WebView.EvalScript(String code, String frameName, Boolean throwOnError)
�� at EO.WebBrowser.WebView.EvalScript(String code, Boolean throwOnError)
�� at EO.Internal.pd.a(adq A_0, String A_1, String A_2, String A_3, Int32 A_4, Int32 A_5, String A_6, Boolean A_7)
�� at EO.Pdf.HtmlToPdfSession.a(adq A_0, String A_1, String A_2, Int32 A_3, Int32 A_4, String A_5, Boolean A_6)
�� at EO.Pdf.HtmlToPdfSession.a(adq A_0, String A_1, String A_2, Boolean A_3)
�� at EO.Pdf.HtmlToPdfSession.a(String A_0, HtmlToPdfOptions A_1, Single A_2)
�� at EO.Internal.a3m.a(agb A_0)
�� --- End of inner exception stack trace ---
�� at EO.Pdf.HtmlToPdfException.b(Exception A_0)
�� at EO.Internal.a3m.a(agb A_0)
�� at EO.Pdf.HtmlToPdfSession.RenderAsPDF(PdfDocument doc)
�� at EO.Pdf.HtmlToPdf.ConvertHtml(String html, PdfDocument doc, HtmlToPdfOptions options)
�

If I remove the HTML Header, everything generates good. Essential Objects came back and said this is because of the size of the HTML and I should be using a Custom Resource Handler, https://www.essentialobjects.com/doc/webbrowser/advanced/resource_handler.aspx

I can see how to create and register the resource handler with webview; however, how do I tell EO.PDF to use this custom webview?

EO.WebBrowser.WebView m_WebView = new EO.WebBrowser.WebView();
m_WebView.RegisterResourceHandler(new SampleHandler());
EO.WebBrowser.Runtime.RegisterCustomSchemes("sample");
eo_support
Posted: Friday, July 12, 2019 11:05:16 AM
Rank: Administration
Groups: Administration

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

We have replied your email. Please do not submit the same question through multiple channels in the future.

Thanks!


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.