Reputation: 59
My stack: .net5, webapi application, Syncfusion.HtmlToPdfConverter
From scratch: I had installed and working syncfusion library (Syncfusion.HtmlToPdfConverter.QtWebKit.Net.Core) in version 18.3.0.47 which was suddenly stoped working with error:
Syncfusion.Pdf.PdfException: Html conversion failed
at Syncfusion.HtmlConverter.HtmlConverter.CheckConversionDone(String tempFilePath)
at Syncfusion.HtmlConverter.HtmlConverter.ConvertHtmlToPdf(String url, Int32 width, Int32 height, String tempFile)
at Syncfusion.HtmlConverter.HtmlToPdfConverter.Convert(String url)
at Syncfusion.HtmlConverter.HtmlToPdfConverter.Convert(String html, String baseurl)
This is not fault html themplate becouse it is simple HTML DOM, I tried up library to the newest version and install newest syncfusion webkit, force debugging application in x64 mode, install newest .net version, update QtBinariesDotNetCore, rebuild solution, clone repository to new clean folder, clear nugetcache.
Upvotes: 1
Views: 3014
Reputation: 307
The reported exception may occur if the pre-requisites are not available in the machine where the conversion takes place. Please cross-check the pre-requisites on your machine, refer below link for more information,
https://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/webkit#prerequisites-for-windows
https://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/webkit#vc-redistributable
https://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/webkit#openssl
Also, the reported exception may occur if the temp folder does not have read/write/execute permission, Or kindly set the folder path, which has read/write permission for IIS_IUSRS user group. Please refer to below link for setting temporary folder path,
https://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/webkit#temporary-path
Please refer to below link to troubleshoot the HTML conversion issues,
https://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/webkit#troubleshooting
Note: I work for Syncfusion.
Upvotes: 2