1

I have a .NET Core 3.1 web app running on Azure App Service that is using SelectPdf to convert some HTML document to PDF. It is working perfectly on my localhost but once I publish on to Azure, I got the following error no matter how small/simple my HTML document is:

System.Exception: Could not get conversion result header. Data transfer error. Data transmission error 109
   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)

My current app service is on the basic Dev/Test plan (does this even matter)?

jps
  • 20,041
  • 15
  • 75
  • 79
user1296699
  • 23
  • 1
  • 6

1 Answers1

1

Disclosure: I work for SelectPdf.

I am afraid that it matters what plan you are using on Azure. Azure has a lot of limitations and SelectPdf uses an alternate rendering engine on Azure. To test it on your computer, you need to set:

GlobalProperties.EnableRestrictedRenderingEngine = true;

SelectPdf requires an Azure App Service Plan starting with Basic (does not work with Free/Shared plans).

More details about deployments to Azure can be found here: https://selectpdf.com/docs/SelectPdf-Microsoft-Azure.htm

selectpdf
  • 184
  • 3
  • Thx for the comment! The document mentioned that with the Basic plan it would work but it "support only for single page PdfHtmlElement objects". Does this mean I can't convert HTML document to pdf if it's longer than 1 page? – user1296699 Aug 16 '21 at 17:36
  • You can convert multi-page documents if you use the main HtmlToPdf object. The limitation applies only for PdfHtmlElement objects. – selectpdf Aug 18 '21 at 05:43