0

I'm trying to configure the ABCpdf PDF Generator to run in an Azure App Service and I can get it to generate a simple Hello World pdf but as soon as I try to convert html to pdf with their Gecko engine I never get a response.

The response from Azure is 500 request timed out.

Here's the Hello World Code:

public FileResult HelloWorld()

{
activateLicense();
Doc doc = new Doc();
doc.AddText("Hello World");
byte[] data = doc.GetData();
return File(data, "application/pdf", "hw.pdf");
}

Here's the html to PDF Code:

public FileResult GooglePDF()
{
activateLicense();
byte[] pdfbytes;

using (Doc theDoc = new Doc())
{
theDoc.HtmlOptions.Engine = EngineType.Gecko;

theDoc.AddImageUrl("http://google.com");

pdfbytes = theDoc.GetData();

}    
return File(pdfbytes, "application/pdf", "GoogleHomepage.pdf");
}

Example: http://abcpdfazure.azurewebsites.net/
Source Code: https://github.com/andyrblank/ABCpdfAzure

In regards to this question being a duplicate of this one: ABCpdf .NET with Azure App Service

The fundamental difference, in my question, is that I'm using the Gecko engine instead of the MSHtml engine. The Gecko engine does not require Windows Registry modification or for Internet Explorer to be installed on the host.

Engine doc: http://www.websupergoo.com/helppdfnet/source/5-abcpdf/xhtmloptions/2-properties/1-engine.htm

I do have this additional information on how ABCpdf works from the makers:

ABCGecko runs in a process pool so we need to be able to spawn worker processes

I believe that's referring to the ABCGeckoWP.exe file that uses the Gecko/Firefox rendering engine inside the XULRunner folder. I'm not sure if this is possible in Azure or if someone has a workaround.

Community
  • 1
  • 1
AndyRBlank
  • 106
  • 8

1 Answers1

0

I would suggest you have a look at this article: http://www.websupergoo.com/support-azure-abcpdf.htm#waws. Here is a snippet:

The Windows Azure platform offers a variety of ways to host a website. For ABCpdf we recommend using an Azure Virtual Machine though you can also use ABCpdf with an Azure Web Role or Worker Role. If you need to use a Windows Azure Web Site (WAWS) we suggest using it in conjunction with ABCpdf installed to an Azure Worker Role.

As I know, it is not support in Azure web App now. It is recommended to choose Azure worker role instead.

Jambor - MSFT
  • 3,175
  • 1
  • 13
  • 16