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.
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();
' instantiate a html to pdf converter object Dim converter As New HtmlToPdf() ' set converter rendering engine converter.Options.RenderingEngine = RenderingEngine.WebKit ' create a new pdf document converting an url Dim doc As PdfDocument = converter.ConvertUrl(url) ' save pdf document doc.Save(Response, False, "Sample.pdf") ' close pdf document doc.Close()
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.
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.
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.