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.aspxI 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");