|
Rank: Newbie Groups: Member
Joined: 3/8/2018 Posts: 5
|
Hello,
I have recently upgraded my version of EO from 5 to 2018 and as part of the upgrade I have had to change the implementation (to remedy another rendering problem) to do use a HtmlToPdfSession to render a PDF instead of using ConvertUrl() as we were before.
The problem is that some of our pages that load data via AJAX with a Dual trigger are not waiting for the JS code to initiate the render (via eoapi.convert()), as a result, I get a pdf showing the loading spinner. When I put a console.log() statement in the JS block with the eoapi.convert() call it does not output anything to the debug console, so that tells me the render happens before that piece of JS code even gets hit to signal that all the data as been returned and loaded. If I play around with the MaxLoadWaitTime and MinLoadWaitTime I am able to get it to render properly, but that is not a clean and robust solution to this problem as we did not need to set these times in the past.
So I guess I have a couple questions regarding this problem.
1.) Do you have any suggestions / ideas to what is going on and how to fix this behavior? 2.) (if not) Does using HtmlToPdfSession and HtmlToPdfSession.LoadUrl() not take into account HtmlToPdfTriggerMode.Dual like HtmlToPdf.ConvertUrl() Does? or do i need to write some additional code to implement RunWebViewCallback if I am using HtmlToPdfSession? 3.) Did the default behavior of MinLoadWaitTime / Max change over the years? Did HtmlToPdfTriggerMode change?
Thank you!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Hi, We are not aware of this problem. The Dual mode should work exactly as before, meaning that if the trigger mode is set to Dual, then both the resources have to finish load and eoapi.convert() has to be called. If you still have problem, please try to isolate the problem into a test app and send the test app to us. See here for more details: https://www.essentialobjects.com/forum/test_project.aspxOnce we have that we will be happy to take a look. Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 3/8/2018 Posts: 5
|
Before I take this step, Id just like to clarify that this is the case even if I am printing via an HtmlToPdfSession object and calling LoadUrl() and then RenderAsPDF()?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Yes. That's correct. In fact HtmlToPdf.ConvertUrl internally uses a HtmlToPdfSession and then call LoadUrl and RenderAsPDF on that HtmlToPdfSession object.
|
|