3

I am trying to use ABCpdf .NET with Azure App Service and getting the following error when generating a PDF.

Unable to render HTML. Failed to configure IE 9 or above for the MSHtml engine: 
Access denied while writing to the registry. 
For IIS applications, please enable "Load User Profile" or 
consult MSHtmlBootstrap in the documentation.

Usually in a VM I would set Load User Profile to True and it works but in Azure App Service, I do not have access to IIS Application Pool configuration.

According to the developer of ABCpdf, it should work with Azure websites.

http://www.websupergoo.com/support-azure-abcpdf.htm

Windows Azure Web Sites

WAWS sites operate as 32-bit processes in a multi-tenanted environment. In order to isolate one site from another WAWS is locked down to prevent inter-process communication. While you may find ABCpdf (32-bit) will install to WAWS, we expect the functionality will be diminished.

Sohail Ahmed
  • 1,047
  • 1
  • 11
  • 27

2 Answers2

5

You cannot modify the registry with Azure Web Apps (formerly Web Sites). So, you're getting an error because the app cannot register itself. Being a multi-tenant service, you are not allowed to make registry modifications.

You need to go back and look at that page again, where they suggest using a VM or a web/worker role (both of which do allow for registry modification).

David Makogon
  • 69,407
  • 21
  • 141
  • 189
1

Even though this is a few years old it's the top StackOverflow question for "ABCpdf App Service" so it seems pertinent add an updated answer.

As of version 12.1 ABCpdf.NET includes the ABCWebKit HTML rendering engine based on WkHTMLToPdf 0.12.6 (Qt patched version).

Although limited compared to the default ABCChrome engine, it will enable rendering in a 64-bit Azure App Service on Windows using Basic App Service plans B1 and above.

NB: it will not work on any of the free App Service plans, or on 32-bit instances.

More information:

Updated ABCpdf .NET Azure Deployment Guide for App Services

Example project on GitHub

Peter G
  • 147
  • 1
  • 10