HTML to PDF Conversion - WebKit Rendering Engine | Syncfusion Blogs
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (181).NET Core  (28).NET MAUI  (227)Angular  (113)ASP.NET  (49)ASP.NET Core  (81)ASP.NET MVC  (87)Azure  (42)Black Friday Deal  (1)Blazor  (236)BoldSign  (14)DocIO  (24)Essential JS 2  (110)Essential Studio  (200)File Formats  (73)Flutter  (136)JavaScript  (226)Microsoft  (122)PDF  (83)Python  (1)React  (105)Streamlit  (1)Succinctly series  (131)Syncfusion  (964)TypeScript  (33)Uno Platform  (3)UWP  (3)Vue  (46)Webinar  (53)Windows Forms  (59)WinUI  (72)WPF  (163)Xamarin  (159)XlsIO  (38)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (11)Business intelligence  (55)Button  (4)C#  (164)Chart  (147)Chart of the week  (58)Cloud  (15)Company  (440)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (73)Development  (681)Doc  (7)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (7)Essential Tools  (13)Excel  (43)Extensions  (23)File Manager  (7)Gantt  (21)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (522)Mobile MVC  (9)OLAP server  (2)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (45)Performance  (13)PHP  (2)PivotGrid  (5)Predictive Analytics  (6)Report Server  (3)Reporting  (8)Reporting / Back Office  (9)Rich Text Editor  (12)Road Map  (12)Scheduler  (54)Security  (5)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (32)Solution Services  (4)Spreadsheet  (11)SQL  (15)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (112)UI  (406)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (19)Web  (628)What's new  (341)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)

HTML-to-PDF Conversion Using WebKit Rendering Engine

Syncfusion Essential PDF now supports HTML-to-PDF conversion using the WebKit rendering engine in addition to existing Internet Explorer and Blink renderers. This converter works well on both x86 and x64 environments.

Essential PDF can be easily integrated into any application on .NET platforms—such as Windows Forms, WPF, ASP.NET, and ASP.NET MVC—to convert URLs, HTML strings, images, and SVGs to PDFs. The WebKit rendering engine provides better support to render modern web standards, so the output of the WebKit engine is more accurate in some cases than that of other rendering engines.

Syncfusion HTML-to-PDF converter can convert any URL to a PDF.

Limitations in the Internet Explorer Rendering Engine

Till now, Syncfusion’s HTML-to-PDF converter relied on Microsoft’s MSHTML library to perform conversions. The conversion happens in two steps: First, HTML is converted into a metafile, and then the metafile is converted to PDF. The main advantage of this is that the text rendered remains searchable in PDF. This is an extremely important requirement for a lot of our customers.

However, with version 9 of Internet Explorer, Microsoft started using hardware acceleration to produce bitmap images instead of metafiles while retrieving snapshots, completely removing the ability to render selectable or searchable text within a PDF document. Users worked on this problem by making registry changes but were not satisfied with the result, so a better alternative was needed.

After considerable research, a new converter based on the WebKit renderer was created.

The documents rendered using WebKit contain vector graphics instead of scalar images. This reduces file size and allows users to perform various operations such as searching, selecting, and copying text to the clipboard. Apart from overcoming the limitations in the Internet Explorer rendering engine, the new WebKit render also provides better support to render HTML5, CSS3, and SVG content.

A to Z about Syncfusion’s versatile HTML-to-PDF converter and its rich feature set.

Rendering Engine Comparison

Refer to “Supported and Unsupported Features by Rendering Engines” in Syncfusion’s documentation to compare various rendering engines and to learn about the features they support.


You can get the required assemblies and QtBinaries by installing the Syncfusion.HtmlToPdfConverter.QtWebKit.WinForms NuGet package in your application. You can also get the required files by installing the HTML converter. Refer to “Steps to Download the HTML Converter Installer” in Syncfusion’s documentation to download the HTML converter installer.

The WebKit HTML converter requires VC++ 2010 redistributables (msvcp100.dll, msvcr100.dll) for converting webpages to PDF; hence, these assemblies should be available in the machine. For 64-bit machines, place the assembly in C:\Windows\SysWOW64\. For 32-bit machines, place the assembly in C:\Windows\System32\.

For converting HTTPS sites to PDF, the WebKit HTML converter requires OPENSSL assemblies (libeay32.dll, libssl32.dll, ssleay32.dll). These assemblies should be available in the machine. For 64-bit machines, place the assembly in C:\Windows\SysWOW64\. For 32-bit machines, place the assembly in C:\Windows\System32\.

The WebKit converter may create a blank-page PDF in the following cases:

  • When the webpage (HTML/URL) is not available or accessible.
  • When OPENSSL assemblies are missing in the machine where the conversion takes place.

Refer to “Prerequisites for Windows” in Syncfusion’s documentation to learn more about the prerequisites for converting HTML to PDF with the WebKit rendering engine.

The following procedure explains how to convert a webpage using the WebKit renderer:

  1. Create an instance of the HtmlToPdfConverter class with the WebKit rendering engine.
    //Initialize HTML-to-PDF converter with WebKit rendering engine.
    HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
  2. Create an instance of the WebKitConverterSettings class to set the conversion settings.
    //Initialize WebKit converter settings.
    WebKitConverterSettings settings = new WebKitConverterSettings();
  3. Set the absolute or relative path of the QtBinaries folder to the WebKitPathproperty of WebKitHtmlConverter. Refer to “Conversion Using WebKit Rendering” in Syncfusion’s documentation to learn more about WebKit settings.
    //Set WebKitPath.
    Setting.WebKitPath = @"/QtBinaries/"
  4. Assign WebKitConverterSettings to the HtmlToPdfConverter conversion settings.
    // Assign WebKit settings to HTML converter.
    htmlConverter.ConverterSettings = settings;
  5. Convert the URL to PDF using the Convert method in HtmlToPdfConverter.
    //Convert URL to PDF.
    PdfDocument document = htmlConverter.Convert("");
  6. Save the PDF document to disk and dispose of the object. The following code sample is used to save the PDF document.
    //Save and close the PDF document.

You can download a working sample from “Conversion Using WebKit Rendering” in Syncfusion’s documentation.

Take a moment to peruse our documentation where you can find other conversion options, with code examples, such as HTML string to PDFpartial webpage to PDFHTML to a single PDF page, and HTML to PDF using IE rendering.

Refer to the homepage for Essential PDF to explore the rich set of PDF library features.

Syncfusion’s high-performance PDF Library allows you to create PDF documents from scratch without Adobe dependencies.


Share this post:

Popular Now

Be the first to get updates

Subscribe RSS feed

Be the first to get updates

Subscribe RSS feed