selectpdf / selectpdf-free-html-to-pdf-converter

Free Html To Pdf Converter for .NET. Asp.Net, C# sample.
13 stars 2 forks source link

Could not get conversion result header. Data transfer error. Data transmission error 109 - Azure App Service #29

Closed DiSTuRBeD0808 closed 1 year ago

DiSTuRBeD0808 commented 1 year ago

I'm currently using the Select.HtmlToPdf.Netcore to create PDFs in my Application. This is working correctly.

Now I've moved some of the functionality over to be able to use it in my API, and it works locally, but when Publishing to the API, I keep getting the mentioned error. Could not get conversion result header. Data transfer error. Data transmission error 109

Below is a stack trace:

at SelectPdf.HtmlToImage.ᜀ(String A_0, String A_1, String A_2, ជ& A_3, String& A_4) at SelectPdf.HtmlToPdf.ᜁ(String A_0, String A_1, String A_2, String A_3, Boolean A_4) at SelectPdf.HtmlToPdf.ConvertHtmlString(String htmlString, String baseUrl) at [apiproject].Controllers.AutomationAPIController.filetostream(Int64 ClaimId, String ClaimNumber, String baseUrl) in C:\dev[path]\Controllers\AutomationAPIController.cs:line 919

I've increased the timeout, I've ensured all the dependencies are on the server, I've also added the BaseUrl. But I'm still getting the error. Any help would be greatly appreciated, many thanks in advance.

DiSTuRBeD0808 commented 1 year ago

Also updated to latest version, but no success.

selectpdf commented 1 year ago

Azure web apps environment has some restrictions. All details here: https://selectpdf.com/pdf-library/html/SelectPdf-Microsoft-Azure.htm

DiSTuRBeD0808 commented 1 year ago

Thank you for replying.

I am aware of the limitations, however as far as I'm aware those should not be an issue. I have a D1 plan and it's the same as the plan where the UI is running, and there it is functioning 100% without any issues.

Only on the App Service where it's running an API am I getting this failure consistently. Is there anything else I could be doing wrong? Using 20.2.0 .Netcore.

Do I need to have the normal nuget package as well as .Netcore on the project?

DiSTuRBeD0808 commented 1 year ago

Managed to resolve the issue thanks to your pointing us in the right direction. Tested on QA environment, which has a better plan than Dev, and all issues stopped.

Thanks again