How can I investigate "Html conversion failed" better?

I have a .NET Core webapp with Blazor Server. I'm using Syncfusion.HtmlToPdfConverter.QtWebKit.Net.Corenuget package (version 18.3.0.47). I made sure to copy the Qt libraries in my solution and set them to copy always. I'm converting in memory generated HTML to a PDF.

When I run in locally from Visual Studio, the conversion works just fine. When I deploy to an Azure Web App the result is always:Syncfusion.Pdf.PdfException: Html conversion failed.

To make sure it's not about the html, I'm testing with this string: "Hello World!".

As my solution is pretty complex (with a WebUI project, but also a Services project where the conversion is executed, and the services are used through dependency injection), I decided to check if it also happened in a brand new Blazor Server project. And to my surprise: it just works! In the Azure Web App.

So I copied over that code to my complete solution in the WebUI project in a separate page. But there it fails again.
The problem is that I went through all (to my knowledge) articles and comments about this error, but I have no clue where to look anymore.
My question is: how can I further investigate this general error to determine what's happening?

6 Replies

GK Gowthamraj Kumar Syncfusion Team December 8, 2020 01:29 PM UTC

Hi Martin, 

Thanks for contacting Syncfusion support.  

The reported exception may occurs due to the missing of pre-requisites in the machine. So, please ensure the dependencies are properly configured in the machine where the conversion take place. And make sure to use the Syncfusion assemblies and QtBinaries from the same version, 

Refer below links to troubleshooting the HTML converter.  

Refer below KB link for resolving the failed to convert web page exception, kindly try the provided solutions and let us know the result.  
  
If still the same exception occurs, kindly let us know the details about your environment details such as OS, Bit version, culture settings, RAM etc., so that we can try the conversion in same environment to reproduce the exception in our end. If possible, please share the simple sample to reproduce the exception in our end. So, that it will be helpful for us to analyze and assist you further on this.  
  
Regards, 
Gowthamraj K 



MT Martin Tirion February 1, 2021 06:12 PM UTC

Finally found what the problem is. Might be useful information for others and something for the dev-team to tackle. 

I had two different types of deployments to the Azure Web App: one from VS2019 using Web Deploy and the other was in a YAML script in an Azure DevOps pipeline. Turned out that the web deploy is doing a FILESYSTEM deployment, but the pipeline is doing a PACKAGE deployment. In the last case a zip-file is copied over (has a lot of benefits) and the Azure Web App is set to run from the package. 

I think in the situation of using a PACKAGE, that the logic in the Syncfusion libraries to load an external DLL is using a call that doesn't take this package-use into account. Therefor the load of the extra DLL's fail. Switching to FILESYSTEM deployment and everything works.

Would have saved me a lot of time if the error raised by the Syncfusion DLL's would have more details about the load error though!


GK Gowthamraj Kumar Syncfusion Team February 2, 2021 04:53 PM UTC

Hi Martin, 
 
Thank you for the update.  
 
We glad to know that, the reported issue has been resolved. We already mentioned that package issue in below KB link, please refer step 8. However, we will update these problem and solution in our troubleshooting section.  
 
Please let us know if you need any further assistance on this.  

Regards, 
Gowthamraj K 



PF Polat FIRAT replied to Martin Tirion July 22, 2022 08:59 AM UTC

Hello Martin,


I got the same one. Did you solve that issue ?



MT Martin Tirion replied to Polat FIRAT July 22, 2022 09:01 AM UTC

Yes I did. See the post from February 1st 2021 above.



PF Polat FIRAT replied to Martin Tirion July 22, 2022 09:38 AM UTC

Thank you so much for reply Martin, I think you used YAML file for pipeline but I'm using 4 steps.

Nuget Restore

dotnet publish

docker build and docker push


How can I switch the steps from PACKAGE to FILESYSTEM ? 

 


Loader.
Up arrow icon