We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

HTML to PDF with WebKit Converter: Is it possible to wait for the document to be ready?

Thread ID:

Created:

Updated:

Platform:

Replies:

125971 Sep 15,2016 03:38 AM Oct 26,2016 08:49 AM ASP.NET Web Forms 3
loading
Tags: PDF
Michael Koelbl
Asked On September 15, 2016 03:38 AM

Hello,

We want to convert on-the-fly a page from a site in our project to a PDF document when prompted by a user online (to make a more brochure like walking guide in this instance, see attachment). Unfortunately the pages can take some time to finish (part of the page comes from Google Maps).

In the Webkit Converter Settings I have the following:

converterSettings.AdditionalDelay = 15000;
However, this can be somewhat hit & miss. Is it at all possible to wait for a change in the state of the Html document, something like the jQuery $(document).ready?

Thank you

Paul Herzberg


Attachment: Walking_example_b77c117a.zip

Prakash Viswanathan [Syncfusion]
Replied On September 20, 2016 11:16 AM

Hi Michael Koelbl, 

Thank you for contacting syncfusion support.  

Our HTML to PDF converter could not automatically detect with the document ready state. However, we can achieve this manually by using window.status. We have already implemented a support for HTML converter to hook on the window.status, once it is set to completed the loading stops and start converting to PDF. 
How to use it: 
1)      In the HTML document change the window.status to completed once HTML is loaded. 
2)      For Google maps, please check can you trigger an event once the maps are loaded and set the window.status as completed
3)      When the window.status is changed to completed, HTML converter will stop loading the HTML and process for PDF conversion. 

I have attached simple Window status sample and input HTML for your reference.  

Please let us know if you need any further assistance on this. 

Regards, 
Prakash V. 


Michael Koelbl
Replied On October 25, 2016 03:12 AM

Hello,

Thank you for the solution it does work as described.

One small thing, though, if the HTML document never sets the window.status then the converter never stops. Is there a way to prevent this in the converter?

Or do I need to put the conversion in, say, a thread that will timeout?

Thank you

Prakash Viswanathan [Syncfusion]
Replied On October 26, 2016 08:49 AM

Hi Michael Koelbl, 
 
Thank you for your update. 
 
At present we do not support for conversion timeout in our HTML to PDF WebKit converter. 
 
If the windows status value is assigned, our converter will wait until the windows status get satisfied. This is our default behavior. 
 
Please let me know if you need any further assistance 
 
Regards, 
Prakash V. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;