Click or drag to resize

Html to Pdf Converter for .NET - HTML Rendering Engines

Starting with v14.0 ExpertPdf offers 4 HTML rendering engines:

  • WebKit - Default rendering engine (based on WebKit) - this is the engine that was present in the previous versions also.

  • WebKit2 - Restricted rendering engine (also based on WebKit) - this has less features, but it can run on restricted environments, like Azure Web Apps.

  • Blink - Blink rendering engine (the engine from Chrome browser) - this is only available for ExpertPdf .NET Core version and also for the .NET Framework versions starting with 4.6.1.

  • IE - Internet Explorer rendering engine - this is only available for ExpertPdf .NET Framework versions 2.0 and 4.0 and it is now obsolete. Usage of this engine is no longer recommended.

Sample Code

This sample code shows how to use ExpertPdf html to pdf converter to convert an url to pdf, also setting the rendering engine.

// instantiate a html to pdf converter object
PdfConverter converter = new PdfConverter();

// set converter rendering engine
converter.RenderingEngine = RenderingEngine.WebKit;

// create a new pdf document converting an url
Document doc = converter.GetPdfDocumentObjectFromUrl(url);

// save pdf document
doc.Save(Response, false, "Sample.pdf");

// close pdf document
doc.Close();

WebKit Rendering Engine (Default)

This is the default rendering engine, that was also present in the previous versions of ExpertPdf Library. Unless otherwise specified, all features described in this documentation, related to html to pdf conversions, refer to this HTML rendering engine. WebKit rendering engine is available for all .NET Framework and .NET Core versions.

Note: WebKit rendering engine can only render ES5 javascript.

WebKit2 Restricted Rendering Engine

This rendering engine was introduced in v12.2 of ExpertPdf. It is also based on WebKit, but it has less features, to be able to run on restricted environments like Microsoft Azure Web Apps. WebKit2 Restricted rendering engine is available for all .NET Framework and .NET Core versions.

Note: WebKit2 Restricted rendering engine can only render ES5 javascript.

This rendering engine was introduced in v14.0 of ExpertPdf. It is only available for ExpertPdf versions targeting .NET Core 2.0 or above and .NET Framework 4.6.1 or above. Blink is the rendering engine used by the Chrome browser and the Chromium project.

While it has some feature that are not available in WebKit engines (Blink can render the latest HTML/CSS and ES6 javascript), Blink has some limitations and cannot handle some features like automatic generation of bookmarks during html to pdf conversion, post data during html to pdf conversion, partial web page rendering, retrieve web elements location, table of contents.

This was the initial rendering engine of ExpertPdf Library and it worked fine until IE9, when Microsoft changed the rendering mode in Internet Explorer. Starting with that version, the conversion to pdf is rendered as an embedded image and not as selectable text.

IE rendering engine is now considered obsolete and it is not maintained in any way. Its usage is not recommended anymore.

See Also