Click or drag to resize

HTML Rendering Engines: Chromium, Blink, WebKit

The converter renders the HTML with a browser engine, then builds the PDF from the rendered page. You choose the engine with the RenderingEngine property of the converter (and of the image converter and the HTML elements):

  • Chromium - the engine of the Chrome browser (Chromium 154), with the most complete support of modern HTML, CSS and JavaScript. Recommended for new applications.

  • Blink - also based on Chrome (Chromium 148), for .NET Framework 4.6.1+ and .NET Core / .NET 5+.

  • WebKit - the built-in engine and the default, available everywhere with no additional files. It runs ES5 JavaScript.

  • WebKit2 - a reduced WebKit engine for environments where the other engines cannot run, like the sandbox of Azure App Service (Web Apps).

Selecting the engine
PdfConverter converter = new PdfConverter();

// the Chromium engine: install the ExpertPdf.HtmlToPdf.NetCore.Chromium.Windows package
// (or copy the Chromium-CEF-154.0.8037 folder of the Chromium download next to the application)
converter.RenderingEngine = RenderingEngine.Chromium;

converter.SavePdfFromUrlToFile("https://www.example.com", "output.pdf");
Engines compared

Chromium

Blink

WebKit

WebKit2

Frameworks

all

.NET Framework 4.6.1+, .NET Core 2.0+, .NET 5+

all

all

Files to deploy

Chromium-CEF-154.0.8037 folder (Chromium.Windows packages)

Chromium-148 folder (Blink packages)

none (built in)

none (built in)

Modern HTML, CSS, JavaScript (ES6+)

yes

yes

ES5 JavaScript

ES5 JavaScript

Tagged PDF, PDF/UA, PDF/A-3a

yes

yes

no

no

PDF/A-1b, PDF/A-2b

yes

yes

yes

yes

PDF/A-3b, PDF/A-3u

yes

yes

yes

no

Automatic bookmarks, HTML elements location

yes

yes

yes

see the property notes

RenderElementSelector, PageRanges, WindowStatus, EnableOfflineMode

yes

yes

no

no

ManagedContentTrimming (the last page ends where the content ends)

yes

no

no

no

RenderOnTimeout

yes

no

yes

yes

SecureProtocol (TLS version)

the engine's own

the engine's own

yes

yes

Runs

in its own process

in its own process

in the application process

in the application process

The notes of each converter property in the API reference say which engines honour it.

The Chromium rendering engine

The Chromium engine runs in its own process (ExpertPdf.Cef.exe). Its files are in a Chromium-CEF-154.0.8037 folder:

  • With the NuGet packages, install ExpertPdf.HtmlToPdf.NetCore.Chromium.Windows (or .x64) next to ExpertPdf.HtmlToPdf.NetCore, or ExpertPdf.HtmlToPdf.Chromium.Windows next to the ExpertPdfHtmlToPdf .NET Framework package. The folder is copied next to your application when it builds.

  • With the downloaded assemblies, extract the Chromium download (ExpertPdf-Chromium-Windows or ExpertPdf-Chromium-Windows-x64, matching the process architecture) and copy its Chromium-CEF-154.0.8037 folder next to your application, or set CefEnginePath to the folder.

CefEngineTemporaryFilesPath sets the folder the engine writes temporary files to (the system temporary folder by default); the application must be allowed to write there. The engine is supported on Windows 10, Windows 11 and Windows Server 2016 or later.

The Blink engine is available in the .NET Core / .NET Standard 2.0 and .NET Framework 4.6.1+ builds of the library (the ExpertPdf.HtmlToPdf.NetCore packages). Install ExpertPdf.HtmlToPdf.NetCore.Blink (or .x64): it copies the engine next to your application. To load it from another folder, set BlinkEnginePath.

Under heavy load, BlinkEngineLaunchTimeout, BlinkEngineLaunchMaxTries and BlinkMaxThreadPoolWorkers tune how the engine processes are started.

The WebKit rendering engines

WebKit is the default engine and is part of the library: nothing else needs to be deployed. It runs ES5 JavaScript; for pages built with modern JavaScript frameworks use Chromium or Blink. WebKit2 is a restricted form of WebKit for environments where the other engines cannot run; it has fewer features (the notes of each property tell which).

The IE value, still present in the .NET Framework 2.0 and 4.0 builds, selects the Internet Explorer engine of early versions. It is obsolete; do not use it.

See Also