Type Description
[C#]
GeckoSubsetType

[Visual Basic]
GeckoSubsetType
A filter that contains only the HTML options supported by the Gecko HTML engine.

 

   

Notes
 

Characteristics

  • The Gecko engine is a component independent 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 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 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.

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. Here is a typical example usage:

[C#]
Doc doc = new Doc();

doc.HtmlOptions.Engine = EngineType.Gecko;
doc.HtmlOptions.UseScript = true;

// Render after 3 seconds
doc.HtmlOptions.OnLoadScript = "(function(){window.ABCpdf_go = false; setTimeout(function(){window.ABCpdf_go = true;}, 3000);})();";

doc.AddImageUrl("http://websupergoo.com");
doc.Save(Server.MapPath("wsg.pdf"));

[Visual Basic]
Dim theDoc As Doc = New Doc();

doc.HtmlOptions.Engine = EngineType.Gecko;
doc.HtmlOptions.UseScript = true;

' Render after 3 seconds
doc.HtmlOptions.OnLoadScript = "(function(){window.ABCpdf_go = false; setTimeout(function(){window.ABCpdf_go = true;}, 3000);})();"

doc.AddImageUrl("http://websupergoo.com");
doc.Save(Server.MapPath("wsg.pdf"));



   

Example
 

[C#]
Doc doc = new Doc();

doc.HtmlOptions.Engine = EngineType.Gecko;

doc.HtmlOptions.GeckoSubset.AddLinks = true;

// You can save a reference to the subset filter to save typing
XHtmlOptions.GeckoSubsetType opts = doc.HtmlOptions.GeckoSubset;

opts.AddLinks = true;

doc.AddImageUrl("http://websupergoo.com");
doc.Save(Server.MapPath("wsg.pdf"));

[Visual Basic]
Dim theDoc As Doc = New Doc();

doc.HtmlOptions.Engine = EngineType.Gecko;

doc.HtmlOptions.GeckoSubset.AddLinks = true;

' You can save a reference to the subset filter to save typing
Dim opts As XHtmlOptions.GeckoSubsetType = doc.HtmlOptions.GeckoSubset;

opts.AddLinks = True;

doc.AddImageUrl("http://websupergoo.com");
doc.Save(Server.MapPath("wsg.pdf"));