Type Default Value Read Only Description
Long 0 (MSHtml) No The engine to use for HTML import operations.

 

   

Notes
 

The Engine property can take any of the following values:

  • 0 - MSHtml (default)
  • 1 - Gecko

This property specifies which HTML engine to use for when importing HTML pages. ABCpdf can use different HTML engines to import HTML for PDF rendering.

Each HTML engine supports a different set of HtmlOptions and has different characteristics.

 

   

MSHtml
 

Characteristics

Due to differences in paradigms and engines' working internals, there are things to note when using the MSHTML engine to render HTML documents:

  • The Screen style sheets are used during the rendering process.
  • Page heights can vary across different pages. Segments of the HTML document are composed dynamically to fit the target rectangle as accurately as possible during each call to Doc.AddImageToChain. This means the target rectangle will be filled with more contents for larger target rectangles instead of scaled to fit.
  • For definite control of HTTP requests, you should set TransferModule to a non-default value.

Supported methods

Supported options


Gecko
 

Characteristics

  • The Gecko engine is a component indepdendent on other parts of the Operating System. The engine will not be affected even if you upgrade your Internet Explorer or another local Firefox installation.
  • Supports a wide range of the upcoming HTML5 and CSS3 standards.
  • Supports the majority of the SVG Full profile. SVG graphics embedded inside Web pages convert natively to PDF primitives. Alternatively, you can specify the a SVG file's location in Doc.AddImageUrl or feed a string of SVG contents to Doc.AddImageHtml to have it converted to PDF using the Gecko engine.
  • Supports XML pages with XSLT and MathML.
  • You can specify which set of stylesheets to use (Print/Screen) through the use of the Media property.
  • In large tables that span across pages, thead and tfoot elements are repeated across different pages properly.
  • The rendered HTML will always fill the entire current rectangle. After the initial call to Doc.AddImageUrl or Doc.AddImageHtml, the page height will be fixed at that point. Subsequent pages rendered using Doc.AddImageToChain will be automatically scaled (instead of having the contents reflowed) to fit in the current rectangle as much as possible.
  • ActiveX components are not supported.
  • The Paged property is always assumed to be true.
  • The Gecko engine does not use Page caching. This means that your rendered PDF is never stored in a memory cache.
  • On the other hand, Web caching is used to store contents downloaded over the Internet and is configurable using with the UseNoCache property.
  • JavaScript in OnLoadScript cannot directly modify the document object. For example, document.write("hello world"); would not work. Most of the time you can work around to get your desired effect by indirectly modifying elements on the page, such as document.body.innerHTML = "hello world";
  • The use of OnLoadScript does not require UseScript. You are free to use JavaScript to customize the page without allowing JavaScript execution in the HTML.

Supported methods

Supported options

Script accessible properties

  • window.ABCpdf_go ABCpdf will wait for this property to be either undefined or true before capturing the HTML page. You can use this property to delay rendering of the HTML page. This can be used to control the moment of "capture" for animated HTML pages. This property is initially undefined. You need to bootstrap this property to false in OnLoadScript for it to be considered. UseScript is also required for this property to be considered. The whole HTML rendering operation is still subject to the Timeout property's value.