Message: PdfException: Failed to convert webpage
[Returned while handling GET Request]
Stack trace:
Message: PdfException: Failed to convert the
webpage [Returned while handling GET Request]
Stack trace:
Syncfusion.Pdf.HtmlToPdf.HtmlToPdfResult.RenderWebKit(PdfPageBase page, PdfLayoutFormat format):6640
Syncfusion.Pdf.HtmlToPdf.HtmlToPdfResult.Render(PdfPageBase page, PdfLayoutFormat format):45
Syncfusion.HtmlConverter.HtmlToPdfConverter.Convert(String htmlString, String baseUrl):1158
OBXCart.Controllers.MachineController.GetCostOfOwnershipPdf(String dateRange, String machineIds) in
E:\AzureDevOps\toptenusa-1\_work\2\s\OBXCart\Controllers\MachineController.cs:119
(unknown).lambda_method(Closure , ControllerBase , Object[] ):-1
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters):0
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters):83
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters):0
System.Web.Mvc.Async.AsyncControllerActionInvoker+<>c.b__9_0(IAsyncResult asyncResult, ActionInvocation innerInvokeState):0
System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult):0
System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncResultBase`1.End():41
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult):0
System.Web.Mvc.Async.AsyncControllerActionInvoker+AsyncInvocationWithFilters+<>c__DisplayClass11_0.b__0():29
System.Web.Mvc.Async.AsyncControllerActionInvoker+AsyncInvocationWithFilters+<>c__DisplayClass11_2.b__2():134
System.Web.Mvc.Async.AsyncControllerActionInvoker+AsyncInvocationWithFilters+<>c__DisplayClass11_2.b__2():134
System.Web.Mvc.Async.AsyncControllerActionInvoker+<>c__DisplayClass7_0.b__1(IAsyncResult asyncResult):0
System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult):0
System.Web.Mvc.Async.AsyncResultWrapper+WrappedAsyncResultBase`1.End():41
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult):0
System.Web.Mvc.Async.AsyncControllerActionInvoker+<>c__DisplayClass3_6.b__4():0
System.Web.Mvc.Async.AsyncControllerActionInvoker+<>c__DisplayClass3_1.b__1(IAsyncResult asyncResult):0
Azure App Service Settings:
Hi everyone,
We have got the same issue with dot net core, blink and azure app service, so as proposed, we tried to use WebKit engine.
As explained in documentation we need to use the WebKit NuGet below :
Syncfusion.HtmlToPdfConverter.QtWebkit.Net.Core
Except that it is unlist from the NuGet gallery...
Why it's unlist from NuGet gallery ? I assume that WebKit is obsolete or something...
Hopefully, searching on this site, I've found a direct link to the package to NuGet website (luckily we can found a unlisted package with direct link)
https://www.nuget.org/packages/Syncfusion.HtmlToPdfConverter.QtWebKit.Net.Core
I tried with this package on azure and it worked !
But this is not a long term solution because the NuGet package is unavailable and may be the next version will not using webkit anymore so we will be blocked.
To sum up :
Blink engine does not work with azure app service
WebKit is unavailable (QtWebKit is unlisted from NuGet gallery)
Is there another way to convert html to PDF with syncfusion with dotnet core 6 on azure app service ?
Thx
Hi everyone,
We already upgrade Syncfusion.HtmlToPdfConverter.QtWebKit.Net.Core to 20.3.0.58 version. However, we are having red warning on file after convert.
So we used Syncfusion.HtmlToPdfConvert.Blink instead for Syncfusion.HtmlToPdfConverter.QtWebKit.Net.Core, but we are having issue:
Message: Failed to convert webpage
Exception: Syncfusion.Pdf.PdfException: at Syncfusion.HtmlConverter.BlinkConverter.Convert (Syncfusion.HtmlConverter.Portable, Version=20.3600.0.58, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89) at Syncfusion.HtmlConverter.BlinkConverter.Convert (Syncfusion.HtmlConverter.Portable, Version=20.3600.0.58, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89) at Syncfusion.HtmlConverter.HtmlToPdfConverter.Convert (Syncfusion.HtmlConverter.Portable, Version=20.3600.0.58, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89)
Currently, we reverted and disabled webkit warning (.DisableWebKitWarning = true) for resolve. Howerver, this is not a long term solution because we recieved the notify: The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
Please help support for this issue.
References:
https://www.nuget.org/packages/Syncfusion.HtmlToPdfConverter.QtWebKit.Net.Core/
Thank you !
We can use the Html to PDF converter with .NET Core library in Azure App Service Linux or Azure Functions Linux. The GDI limitation mentioned in this article is applicable for Azure App Service windows only. So, if you are using a Linux app service, you can use the converter with .NET Core API in Azure App Service Linux.
Please refer to the below links for more information,
Azure App Service Linux: https://www.syncfusion.com/kb/12909/how-to-convert-html-to-pdf-in-azure-app-service-linux-with-blink-rendering-engine
Azure Functions Linux: https://www.syncfusion.com/kb/12908/how-to-convert-html-to-pdf-using-blink-in-azure-functions-linux
Please refer below documentation page
https://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/troubleshooting
We use .net core 3.1 (with Blazor) and Azure App Service (Windows), and so are unable to use the Syncfusion Html convertor (using Blink)... is it possible for us to use your webkit version somehow (for .net core)? Or know of any other preferred non-Blink ways of converting HTML to a PDF? Thanks!
You can install the Syncfusion.HtmlToPdfConverter.QtWebKit.Net.Core package in Package manager console by using below command,
|
NuGet\Install-Package Syncfusion.HtmlToPdfConverter.QtWebKit.Net.Core -Version 20.4.0.38 |
Please advise on the " The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore. The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore."
This is not a security issue. We have changed the default rendering engine to Blink from WebKit. So, we have unlisted the WebKit rendering engine specific packages. We are suggest you to try the Blink rendering engine. But if you are using Azure App Service windows, you can use WebKit packages. To provide backward compatibility we are publishing our old packages in NuGet.org for every release.