1

Based on the many SO questions related to this, it seems System.Drawing.Common is not supported in Azure App Service or Funtion Apps.

However, the IronPDF documentation suggests that it should work anywhere on Azure unless SVG graphics is being rendered in which case they suggest using containers.

So my question is, if the HTML that I'm converting to PDF doesn't have any SVG graphics will it work in an S1 Tier App Service or a function app?

IronPDF Nuget Package Structure

References:

Azure Function gives error: System.Drawing is not supported on this platform

https://github.com/projectkudu/kudu/wiki/Azure-Web-App-sandbox#win32ksys-user32gdi32-restrictions

Raihan Iqbal
  • 407
  • 3
  • 16

1 Answers1

1

Sharing an answer to the same issue as reported by the poster:

Older Azure Functions using IronPDF may report this issue due to a lack of GDI+ / System.Drawing.Common support:

System.Drawing.Common: System.Drawing is not supported on this platform.

As of 2021 you can switch your Azure Function to v3.

  • In the “Azure Function App” settings panel select Runtime Version = 3
  • With this setup, your code runs in a sandbox that supports .Net Core 2, 3 and dotNet 5.
  • The error goes away

For more information on how to Run HTML to PDF on Azure please see the linked tutorial.

darren
  • 475
  • 4
  • 15
  • 1
    it would be beneficial for your users if you could add these points to the article that you linked above - it will save someone hours of searching on google! – Raihan Iqbal Oct 01 '21 at 11:20
  • 1
    This is being done. Will go live in the next website update. – darren Oct 01 '21 at 13:47
  • I changed the runtime but I still can't generate a simple Hello world PDF. https://stackoverflow.com/questions/69415585/ironpdf-system-exception-error-while-generating-pdf-from-url-in-azure-function – Raihan Iqbal Oct 03 '21 at 07:55