We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

HTML page to PDF Conversion failure on hosting server

On my development machine I have an MVC 4.6.1 site functioning well, successfully producing a PDF from a web page using the Syncfusion libs and the Webkit rendering libs, which I placed in ~/bin/QtBinaries. Works great! However, the same web application code on the production server fails when doing the conversion. I'm having trouble tracking down the cause of this Exception. I've tried some debugging, and can say that the target URL to get the HTML content is never hit with an HttpRequest. As a further check against my coding, I installed the same web app on Arvixe hosting, and the HTML > PDF feature worked right out of the box. So, this is most likely a problem related to the web hosting environment at SmarterASP.NET. Anyway, here's the Syncfusion.PdfException stack trace:

Syncfusion.Pdf.PdfException: Failed to convert the webpage at Syncfusion.Pdf.HtmlToPdf.HtmlToPdfResult.RenderWebKit(PdfPageBase page, PdfLayoutFormat format) at Syncfusion.Pdf.HtmlToPdf.HtmlToPdfResult.Render(PdfPageBase page, PdfLayoutFormat format) at Syncfusion.HtmlConverter.HtmlToPdfConverter.Convert(String url) at RuralData.Controllers.FormsController.d__11.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.b__36(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End() at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.b__3d() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass33.b__32(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End() at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<>c__DisplayClass2b.b__1c() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.b__1e(IAsyncResult asyncResult)
Libs:

Thoughts?

8 Replies

SK Surya Kumar Syncfusion Team October 2, 2017 06:28 AM UTC

Hi Robert,  
 
Thank you for using Syncfusion products. 
 
The “Failed to convert the webpage” exception may occur if the assemblies (Syncfusion.HtmlConverter.Base.dll, QtBinaries) are blocked while unzipping in the server. So, please check if your assemblies are blocked. To unblock the assemblies in bin and assembly folder in the server, please refer below screenshot to unblock the assemblies,   
   
 
  
  
Please try the above suggestion in the server and let us know the result.   
 
Regards, 
Surya Kumar 



RD Robert Dickow October 2, 2017 08:22 AM UTC

I checked for the block, but all the files are clear; the code works well on 2/3 servers. It is only SmarterASP.NET web hosting that is causing failures. I'm going to ask their support staff if they might be willing to run the Webkit TroubleShootingTool.exe .




RD Robert Dickow October 2, 2017 07:03 PM UTC

The SmarterASP.NET tech support understandably will not run the Webkit TroubleShooter.exe on a shared server. They simply recommended I try dropping mscrv100.dll into the /bin folder. That does not work. Would this Exception be expected if the correct C++ runtimes were not installed on the server?? I'm tempted to move this site to a different hosting service, where I have already tested the app and know that the Syncfusion functions work well.



PV Prakash Viswanathan Syncfusion Team October 3, 2017 10:57 AM UTC

Hi Robert, 

Our WebKit HTML converter  may also throw exception if VC++ redistributable assemblies not available in the server. We built the Qt source using VC++ 2010, so the below assemblies should be present in the below location. 

Assemblies: msvcp100.dll, msvcr100.dll  
Location:  
For x86 machine: C:\Windows\System32  
For x64 machine: C:\Windows\SysWOW64  
  
If the assemblies are not present in above location, install the below redistributable (or) copy the assemblies to the above location and then try converting HTML to PDF. 

Please use below download link to get the installer. 
 
Please use below download link to get the assemblies. 
 
If you still face the same exception, we can have a web meeting to directly look into the issue on your machine(server) and provide the solution at the earliest. Please let us know your availability for web meeting, we will make every effort to have this scheduled on a date and time of your convenience. 

Regards, 
Prakash V 



RD Robert Dickow October 12, 2017 08:22 PM UTC

Prakash, Thank you for your help with this and your offer to go 'one-on-one' to try to solve the problem on the server. I worked around the problem by moving the web application to another hosting service, where it worked perfectly without further adjustments. There was most likely a versioning problem with the VS C++ runtime, but the tech support did not seem to be very knowledgeable.



PV Prakash Viswanathan Syncfusion Team October 13, 2017 12:07 PM UTC

Hi Robert, 
 
Thanks for your update. 
Please let us know if you need any further assistance on this. 
 
Regards, 
Prakash V 



UA Umar Asif December 26, 2018 07:48 AM UTC

i have same issue

HTML page to PDF Conversion failure on hosting server in Asp.net Core 2.1 project




KC Karthikeyan Chandrasekar Syncfusion Team December 31, 2018 11:49 AM UTC

Hi Umar,  
Thanks for contacting Syncfusion support.   
The reported exception may occurs due to the missing of pre-requisites in the server where the conversion takes place. So, please make sure the pre-requisites are available in the server. Refer below link to find the pre-requisites of WebKit rendering engine.    

Kindly try the suggestions provided in the below KB and let us know the result.   
   
Also, please refer the below link to troubleshoot the conversion failure on the server. Kindly run the WebKit trouble shooting tool in the server where the conversion getting failed and share the screenshot of the result and log file. So that it will be helpful for us to analyze and assist you further on this.    
Regards, 
Karthikeyan 


Loader.
Live Chat Icon For mobile
Up arrow icon