Failed to convert the webpage exception with WebKit HTML converter
Below are some cases where WebKit HTML converter may throw “Failed to convert webpage” exception and the solution to overcome this.
If the Syncfusion.HtmlConverter.Base.dll assembly is blocked in the machine, then the converter may throw this exception.
Unblock the assembly if it is blocked by referring the below screenshot of Syncfusion.HtmlConverter.Base.dll,
This exception may occur if the assemblies and QtBinaries are used from different version of WebKit installers.
Make sure to use the Syncfusion assemblies and QtBinaries from the same WebKit Installer. We usually do changes in the assemblies and QtBinaries for every release. The assemblies and QtBinaries for a specific version can be get by installing the WebKit HTML converter.
WebKit HTML converter: https://www.syncfusion.com/downloads/version-history
While converting HTML to PDF, WebKit HTML converter internally creating temporary files in temp folder for conversion.
If the temporary folder does not have elevated permission for the respective user then the WebKit HTML converter may throw this exception.
By default, WebKit HTML converter gets system temporary folder for creating temporary files for conversion. Please refer the example of default temporary folder.
Make sure the above path has elevated permission for respective user.
WebKit HTML converter have support for setting temporary path. Using TempPath property, we can set any folder path which has read/write/execute permission. Then the converter makes use of this path for creating temporary files. Refer below code snippet to set temp folder.
WebKitConverterSettings settings = new WebKitConverterSettings();
settings.TempPath = "D://MyProject//bin";
If the user has elevated permission, but still getting the failed to convert webpage exception.
Please try hosting an application in different user account of the server and check the conversion.
WebKit HTML converter may throw this exception if the Web Application is published in a network shared location.
To avoid this exception, publish the application in the server’s local disk where it will be hosted. Please do not publish the website to shared network location.
If the failed to convert webpage exception occurs only for particular URL.
Please contact Syncfusion support with input HTML, code snippet and environment details (OS, culture settings, bit version etc.,).
Last Revised Date: