Type Default Value Read Only Description
[C#]
EngineType

[Visual Basic]
EngineType
Chrome No The engine to use for HTML import operations.

 

   

Notes
 

This property specifies the HTML engine to use when importing HTML pages.

The EngineType enumeration can take any of the following values:

  • Chrome
  • MSHtml
  • Gecko

Each HTML engine supports a different subset of HtmlOptions methods and properties. You can use one of the filter objects: ForChrome, ForMSHtml and ForGecko, to filter the supported options in your IDE.

Characteristics of the ABCChrome Engine:

  • It requires Windows 2008 R2 / Windows 7 or later. It runs only on x64 systems.
  • The engine is an independent component. It will not be affected even if you upgrade your Internet Explorer or local Chrome installation.
  • It is generally faster than the other engines, producing smaller PDFs.
  • It supports a wide range of the HTML5 and CSS3 standards.
  • It supports the majority of the SVG Full profile.
  • It supports web fonts, Font Awesome and similar dynamic font technologies.
  • Fonts are always embedded and are never substituted.
  • It supports dynamic and AJAX pages including content like animated graphs and maps.
  • It supports increased security via a variety of technologies including FireShield.
  • It is better at handling very large web pages or chunks of HTML.
  • You can specify print or screen style sheets through the use of the Media property.
  • In large tables that span across pages, table headers and footers are repeated across pages. The ABCGecko engine handles complex nested headers and footers better, but most pages are not that complex.
  • 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.
  • ActiveX components are not supported.
  • The Paged property is always assumed to be true.
  • It doesn't check for blank pages and doesn't throw blank page exceptions.
  • It doesn't support Flash movies.

The default ABCChrome representation involves an overhead of about 120 bytes per page. In most situations this is irrelevant but for documents with large numbers of pages, you may wish to eliminate it by calling Page.StampFormXObjects(true) for each page in the document.

Similarly, while font embedding is generally a good idea, it does slightly increase the size of the output. A typical overhead is in the region of 50KB per document, so in most cases this is a tiny part of a much bigger whole. However if you are dealing with very small documents of only a few KB in size, it can become significant. If this is the case you can use the ReduceSizeOperation or FontUnembedment project to remove fonts which have been embedded.

ABCpdf Version 11.0 shipped with ABCChrome 59. Version 11.2 ships with ABCChrome 65. The core improvement here relates to better handling of repeated headers and footers in tables using the thead and tfoot tags. The way that transparent images are displayed is much improved. There have been minor improvements in text kerning and layout - you should note that these can lead to subtly different line breaking. JavaScript redirects between local files (ie 'file://' protocol URLs) on your machine have been disabled for security reasons.

Characteristics of the MSHtml Engine

  • 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.
  • The Doc.Rect can be zero width or height to allow the page to auto-size.

Internet Explorer configuration

The Fusion Log Viewer is known to interfere with the initialization of the MSHtml engine. If any problem arises, try disabling it or specify a local custom log path.

Currently, there are some limitations when using the MSHtml engine hosted out-of-process (See MSHtmlBootstrap):

Characteristics of the Gecko Engine:
  • The Gecko engine is a component independent of other parts of the Operating System. It will not be affected even if you upgrade your Internet Explorer or another local Firefox installation.
  • It supports a wide range of the HTML5 and CSS3 standards.
  • It 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 provide a string of SVG contents to Doc.AddImageHtml to have it converted to PDF using the Gecko engine.
  • It supports XML pages with XSLT and MathML.
  • You can specify which set of style sheets 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.

Gecko configuration

The Gecko engine contains a number of preferences that can be configured. There are a set of .js files in the "XULRunner??_?\defaults\pref" folder that are loaded in alphabetical order when it starts. Each file contains a set of preferences. So by adding your own .js file to this folder, you can add in your own settings.

If you are not familiar with the format of these files, you may find it easier to copy a configuration file from Firefox:

  • View the URI "about:config" in Firefox.
  • Modify the configuration as usual.
  • Close Firefox. The configuration is saved to the file only when Firefox is completely closed.
  • See the Path value in %APPDATA\Mozilla\Firefox\profile.ini. For example, the value may be Profiles/sx4fgjw2.default.
  • Copy prefs.js in the folder pointed to by the Path value (relative to the path of profile.ini) to:
    • XULRunner??_?\defaults\pref. The preferences are considered to be set by the software developer. For example, copy C:\Users\<user>\AppData\Roaming\Mozilla\Firefox\Profiles\sx4fgjw2.default\prefs.js to XULRunner??_?\defaults\pref.
    • some place outside of XULRunner??_? and set the file path (including the file name) to the GeckoPrefFile registry value. The preferences are considered to be set by the end user. See below for the differences between preferences set by the end user and those set by the software developer.
  • Do not delete or change the first line in prefs.js. You need only the lines relevant for your configuration change. You can delete other irrelevant lines.

Preferences set by the end user are in the JavaScript file whose path is assigned to the GeckoPrefFile registry value. (Registry values can alternatively be specified in web.config or app.config.) The file is loaded after all JavaScript files in "XULRunner??_?\defaults\pref", so user-set preferences take precedence. Some preferences are in effect only when set by the end user. Here is an incomplete list of such preferences:

Preference in effect only if it is set by the end user Default Value Description
intl.accept_languages "en-US, en" The order of languages of the fonts to search when the specified font does not support a character. The Gecko engine appends to the list the ones that are missing in the following in order ja, ko, zh-CN, zh-HK, zh-TW. For example, without specifying this preference, a piece of simplified Chinese text (in a Latin font) may be imported in multiple fonts because some characters are supported by Japanese fonts and some are not.

Additional supported settings:

Preference Default Value
print.print_shrink_to_fit true
print.print_scaling "1"