ArthurHub / HTML-Renderer

Cross framework (WinForms/WPF/PDF/Metro/Mono/etc.), Multipurpose (UI Controls / Image generation / PDF generation / etc.), 100% managed (C#), High performance HTML Rendering library.
https://htmlrenderer.codeplex.com/
BSD 3-Clause "New" or "Revised" License
1.24k stars 522 forks source link

Could not load type 'System.drawing.text.InstalledFontCollection' from assembly 'System.Drawing', Version=4.0.0.0,culture=neutral, publickeytoken= b03f5f7f11d50a3a #181

Open mycodings22 opened 3 years ago

mycodings22 commented 3 years ago

https://github.com/ArthurHub/HTML-Renderer/blob/a004aefeb87b5226aece75c49e84040dbaf9f3e0/Source/HtmlRenderer.PdfSharp/Adapters/PdfSharpAdapter.cs#L47 I'm using .net core 2.0. I have installed pdfsharp and htmlrendererSharp latest versions. Exactly at the pdfGenerator.GeneratePdf() method it is throwing an exception. When I debugged the code, In pdfsharp adapter InstalledFontCollection is not being recognized. I tried install system.drawing.common through nuget but didn't work. But after installing System.Drawing.Common, I could initialize InstalledFontCollection(create an object) class in my class file. Could you able to tweak the code so that I can send my InstalledFontCollection Class as a parameter or Could you please fix the issue for the developers who are using .net Version Core 2.0.