0

I'm using ABCpdf to generate a PDF from HTML.

int id = theDoc.AddImageHtml(html);

It's working fine in my local environment but throws an error when running on an Azure server.

Exception:

Failed to load URL data:text/html;charset=UTF-8;base64,........

What does the error mean and how do I fix this?

D M
  • 4,500
  • 3
  • 11
  • 26

1 Answers1

0

Failed to load URL when using ABCpdf on Azure

To use ABCpdf for ABCWebKit engine the minimum configurations options for your app service must be

  • The runtime stack must set to .NET (preferably .NET 5 or 6).

    Use .Net 6 as .Net 5 is about to end (deprecated)

  • The minimum app service plan supported is Basic B1.

  • The App Service platform must be 64-bit.

When running in an App Service ABCpdf will require the license key to be installed in your code using the XSettings.InstallLicense method.

  • Copy and paste the license key in Startup.cs
XSettings.InstallLicense("PASTE YOUR LICENSE HERE");

Failed to load URL data:text/html;charset=UTF-8;base64,........

Your html page may contain indeed, one of "%","" or "#" characters

Refer SO Thread - Other options to convert HTML to PDF

Please refer GitHub - ABCpdf-Azure-AppService and ABCpdf .NET Azure Deployment Guide for more information