https://www.nuget.org/packages/Syncfusion.HtmlToPdfConverter.Net.Windows/ (currently version 28.1.39) supports both Blink and Webkit. This article is contradictory https://help.syncfusion.com/document-processing/pdf/conversions/html-to-pdf/overview (version updated 6 Dec 24) as near the top it states that the library internally uses the Blink rendering engine. This is only partly true; whilst it supports Blink, it also supports WebKit (aka IE) engine, which is not the implication of the statement. Lower down the article it goes on to describe settings for WebKit.
However, whilst the package includes the Blink libraries in the runtimes folder, it does not include the WebKit libraries. To obtain these we have needed to download the legacy unlisted package https://www.nuget.org/packages/Syncfusion.HtmlToPdfConverter.QtWebKit.Net.Core/ and manually include the files in our project. Bizarrely there is still a live article referencing the unlisted package dated 16 Dec 24 here https://help.syncfusion.com/document-processing/pdf/conversions/html-to-pdf/net/webkit. The documentation and packages do not seem to be in sync (no pun intended) and is very confused.
NB: We have raised support tickets and cannot use Blink in 1 of our projects as it is hosted on Windows Server 2012. Syncfusion support have confirmed that Blink has conflict issues on this platform so will not work correctly,
So I guess this post is advice to anyone also needing to use WebKit, but it would be interesting to know if there is a better way to deal with this issue? Do Syncfusion have any plans to sort out the WebKit rendering engine properly or will it be completely retired in a future release (which will be an issue for us)? Please at least sort out your documentation.
Hi Neil,
Thank you for reaching out to Syncfusion support.
We have reviewed the issue you reported on our end. After further investigation, we would like to explain the difference between the two rendering engines used for HTML to PDF conversion in our products:
If you still wish to use the WebKit rendering engine, please be aware that the WebKit public NuGet packages are no longer available on nuget.org. However, you can install the Syncfusion.HtmlToPdfConverter.QtWebKit.Net.Core package via the Package Manager console using the following command:
PM> NuGet\Install-Package Syncfusion.HtmlToPdfConverter.QtWebKit.Net.Core -Version xx.x.x |
Additionally, please note that since QtWebKit has been marked as deprecated with no further updates planned, we have unlisted the WebKit packages from NuGet.org. To ensure a smoother transition, we recommend migrating to our latest CEF rendering engine in your case. In the near future, we will officially mark the WebKit rendering engine as deprecated. We appreciate your understanding on this matter.
Please try the suggested solution and let us know the result. If you continue to encounter issues, we kindly request that you share the input HTML document, modified sample, Syncfusion package name and version, .NET version with us. This will help us analyze the situation and provide a prompt solution.
Regards,
Arumugam M
Thanks for that but Syncfusion.HtmlToPdfConverter.Net.Windows does actually support webkit without installing Syncfusion.HtmlToPdfConverter.QtWebKit.Net.Core. This is sort of documented in the link in the original ticket.
What it does not do is include the webkit binaries so it's necessary to get those from elsewhere (e.g. the legacy package).
There doesn't appear to be any mention of CEF conversion in https://help.syncfusion.com/document-processing/pdf/conversions/html-to-pdf/.
I can only find reference to it for Azure app services and functions https://help.syncfusion.com/document-processing/pdf/conversions/html-to-pdf/net/convert-html-to-pdf-in-azure-app-service-windows although it looks very similar to the others so the code example should be relevant. The is all very muddled, why does it not mention this other conversion option in the headline article?
I assume that you're suggesting that we can use this as it embeds Chromium in the app so therefore we'll avoid the conflicts that we had using Blink on Windows server 2012?
We'll have a play with this anyway (although it will be a few days). Thank you.
Hi Neil,
Thank you for your feedback.
We have addressed the reported issue in our Troubleshooting section under HTML to PDF conversion. You can find the relevant documentation at the following link:
Converting HTML to PDF | Syncfusion
The CEF rendering engine is a robust and viable alternative to the Blink rendering engine. It offers similar logic and code structure for performing HTML-to-PDF conversion. To use the CEF rendering engine, you simply need to initialize the HtmlToPdfConverter with the HtmlRenderingEngine.Cef option. Below is a sample code snippet for reference:
// Initialize HTML to PDF converter. HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.Cef); |
Detailed documentation regarding the use of the CEF rendering engine can be found in our guide for Azure environments, specifically under Azure App Service for Windows. You can access it here:
Convert HTML to PDF in Azure App Service on Windows | Syncfusion
We recommend reviewing this information and testing the CEF rendering engine in your environment. Please let us know your findings or if you encounter any issues. We are happy to assist further with any questions or troubleshooting.
Regards,
Arumugam M
For info CEF engine requires .net 6.0+ (so does not work for us as we are wanting to apply this to a legacy .net framework app so we need .net standard 2.0 support)
Hi Neil,
For the CEF-based rendering engine, we rely on the CEFSharp.OffScreen.NETCore package, which is specifically designed for .NET Core 3.1 and later. This package leverages the Chromium Embedded Framework (CEF) to enable headless content rendering, ensuring modern and efficient web-based rendering capabilities. However, it is built exclusively for the .NET Core runtime, which offers enhanced performance, security, and cross-platform compatibility.
Currently, we do not have plans to extend support to retired platforms. Therefore, we recommend upgrading to a compatible version of .NET Core (6.0 or higher) to take full advantage of the features provided by the CEF-based rendering engine.
Note: CEFSharp itself supports .netcoreapp3.1 and above.
Regards,
Arumugam M
hi, Arumugam Muppidathi, why I cannot reach resource specifically under Azure App Service for Windows does it was deleted? In this case how I can currently convert html into pdf if I use .net 9.0 and Azure App Service for Windows for hosting?
UPD. I fond a solution, it's installing next packeges:
<PackageReference Include="Syncfusion.HtmlToPdfConverter.Cef.Net.Windows" Version="31.2.4" />
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="31.2.18" />
And Code:
var settings = new CefConverterSettings
{
PdfPageSize = PdfPageSize.A4,
MediaType = MediaType.Screen,
Scale = 0.75f
};
var converter = new HtmlToPdfConverter(HtmlRenderingEngine.Cef);
converter.ConverterSettings = settings;
var document = converter.Convert(html, "");
using var stream = new MemoryStream();
document.Save(stream);
document.Close(true);
return stream.ToArray();
And it's work on Azure App Service for Windows for hosting, but.... But it's work very slow, Generating Pdf takes 2-5 mins, how it can be fixed? Or maybe I do something wrong?
Can you please help here? Thanks in advance.
Hi Neil,
Thank you for getting back to us.
We have reviewed the reported issue and would like to provide some clarification. Our HtmlConverter library uses the Blink rendering engine, which relies on Chromium headless browsers to perform HTML-to-PDF conversion. However, the Blink engine does not support conversion in Azure App Service (Windows) due to existing GDI limitations.
Previously, we used the CEF rendering engine as an alternative for Azure App Service (Windows). This engine internally uses CefSharp, specifically version 119.4.3, which is the only version that supports conversion in Azure App Service (Windows). Unfortunately, this version contains known vulnerabilities.
Due to these vulnerabilities, we attempted to upgrade to a newer version of CefSharp. However, versions beyond 119 do not support HTML-to-PDF conversion in Azure App Service (Windows) because of GDI limitations inherent to the Azure Windows environment. These limitations prevent us from resolving the vulnerabilities on our end.
For reference, please see the related discussions:
Recommended Alternative: Blink-Based Rendering Engine in Linux environment
We strongly recommend using our Blink-based rendering engine, which includes the latest stable Chromium binaries for HTML to PDF conversion. However, due to GDI restrictions, Blink cannot perform PDF conversion in Azure App Service (Windows).
Instead, you can use the Blink rendering engine with the .NET Core library in the following environments:
Please refer to the following documentation for more details:
We appreciate your understanding and cooperation. Please feel free to reach out if you need further assistance or guidance.
Regards,
Arumugam M