j-petty / HtmlRendererCore

HtmlRendererCore is a partial port of HtmlRenderer for .NET Core.
MIT License
24 stars 8 forks source link

System.TypeInitializationException: The type initializer for 'HtmlRendererCore.PdfSharp.Adapters.PdfSharpAdapter' threw an exception. #5

Open eliyasbaby opened 1 year ago

eliyasbaby commented 1 year ago

Getting below exception on using this package when deploy to Linux server

System.TypeInitializationException: The type initializer for 'HtmlRendererCore.PdfSharp.Adapters.PdfSharpAdapter' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Gdip' threw an exception. ---> System.PlatformNotSupportedException: System.Drawing.Common is not supported on non-Windows platforms. See https://aka.ms/systemdrawingnonwindows for more information. at System.Drawing.LibraryResolver.EnsureRegistered() at System.Drawing.SafeNativeMethods.Gdip.PlatformInitialize() at System.Drawing.SafeNativeMethods.Gdip..cctor() --- End of inner exception stack trace --- at System.Drawing.SafeNativeMethods.Gdip.GdipNewInstalledFontCollection(IntPtr& fontCollection) at HtmlRendererCore.PdfSharp.Adapters.PdfSharpAdapter..ctor() at HtmlRendererCore.PdfSharp.Adapters.PdfSharpAdapter..cctor() --- End of inner exception stack trace --- at HtmlRendererCore.PdfSharp.Adapters.PdfSharpAdapter.get_Instance() at HtmlRendererCore.PdfSharp.HtmlContainer..ctor() at HtmlRendererCore.PdfSharp.PdfGenerator.AddPdfPages(PdfDocument document, String html, PdfGenerateConfig config, CssData cssData, EventHandler1 stylesheetLoad, EventHandler1 imageLoad) at HtmlRendererCore.PdfSharp.PdfGenerator.GeneratePdf(String html, PdfGenerateConfig config, CssData cssData, EventHandler`1

jaspreetsinghmahal commented 5 months ago

same