This property specifies the HTML engine to use when importing
The EngineType enumeration can take any of the following
- MSHtml. Characteristics:
- The Screen style sheets are used during the rendering
- 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
Internet Explorer 9 support
ABCpdf automatically detects and accommodates the architectural
changes introduced in Microsoft Internet Explorer 9. For many
server applications, this is transparent and and requires no code
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):
- Gecko. Characteristics:
- 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
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
page height will be fixed at that point. Subsequent pages rendered
will be automatically scaled (instead of having the
contents reflowed) to fit in the current rectangle as much as
- ActiveX components are not supported.
- The Paged property is always assumed to
- 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
cannot directly modify the document object. For example,
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
- The use of OnLoadScript does not
require UseScript. You are free to use
execution in the HTML.
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,
- 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
value. (Registry values can alternatively be specified in web.config or
"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
||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:
Each HTML engine supports a different subset of HtmlOptions
methods and properties. You can use one of the filter objects:
ForMSHtml and ForGecko, to filter the supported options in