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.
Unfortunately, activation email could not send to your email. Please try again.

HTML page to PDF Conversion failure on hosting server

Thread ID:

Created:

Updated:

Platform:

Replies:

132947 Sep 29,2017 12:34 PM Oct 13,2017 08:07 AM ASP.NET MVC 6
loading
Tags: PDF
Robert Dickow
Asked On September 30, 2017 11:28 PM

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?

Surya Kumar [Syncfusion]
Replied On October 2, 2017 02:28 AM

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 


Robert Dickow
Replied On October 2, 2017 04:22 AM

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 .



Robert Dickow
Replied On October 2, 2017 03:03 PM

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.


Prakash Viswanathan [Syncfusion]
Replied On October 3, 2017 06:57 AM

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 


Robert Dickow
Replied On October 12, 2017 04:22 PM

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.


Prakash Viswanathan [Syncfusion]
Replied On October 13, 2017 08:07 AM

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;