The HTML conversion to PDF or to images happens in two main stages. In the first stage the HTML document is loaded in the internal HTML viewer. When the load is complete the second stage starts and the HTML content is rendered to PDF document or into an image. The moment when the HTML load is complete is not well defined for all HTML documents. There might be for example scripts running in page which continuously update the HTML document. The triggering modes help the converter to decide when the HTML page load should be considered completed and when the actual rendering to PDF or to image can start. The triggering mode is given by the PdfConverter..::..TriggeringMode property. There are three possible triggering modes:

  • Auto Tiriggering Mode - this is the default rendering mode and the rendering to PDF or to image starts immediately after the HTML page is loaded in converter which means the images, script files, CSS files are loaded and the scripts found in page are executed. The scripts can actually schedule asynchronous operations to be executed later, but the converter will not wait for those operations to finish. You can use the following two triggering modes to handle those asynchronous operations. The code sample for settings this triggering mode is below.

    C# Copy imageCopy
    // create the PDF converter
    PdfConverter pdfConverter = new PdfConverter();
    // set the triggering mode
    pdfConverter.TriggeringMode = TriggeringMode.Auto;
  • Delayed Tiriggering Mode - When this triggering mode is set the converter will wait an additional given time period for the asynchronous scripts to be executed before starting the rendering to PDF or to image. The code sample below will configure the converter to start rendering at 3 seconds after the HTML page was loaded which means the asynchronous scripts may run for 3 more seconds before the actual rendering to PDF or image starts. This type of triggering mode is good when you know that all the asynchronous scripts will finish execution in a given period of time.

    C# Copy imageCopy
    // create the PDF converter
    PdfConverter pdfConverter = new PdfConverter();
    // set the triggering mode
    pdfConverter.ConversionDelay = 3;
  • Manual Tiriggering Mode - When this triggering mode is set the converter will wait until the evoPdfConverter.startConversion() method is called from HTML page JavaScript. The code sample below will configure the converter for manual rendering mode.

    C# Copy imageCopy
    // create the PDF converter
    PdfConverter pdfConverter = new PdfConverter();
    // set the triggering mode
    pdfConverter.TriggeringMode = TriggeringMode.Manual;

See Also

Reference

Other Resources