Click or drag to resize
Pdf Library for .NET

Html to Pdf Converter for .NET - HTML Rendering Engines

Starting with v19.1 SelectPdf offers 3 HTML rendering engines:

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

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

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

Sample Code

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

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

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

// create a new pdf document converting an url
PdfDocument doc = converter.ConvertUrl(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 SelectPdf 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.

WebKit Restricted Rendering Engine

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

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

This rendering engine was introduced in v19.1 of SelectPdf. It is only available for SelectPdf 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.

See Also