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.26k stars 527 forks source link

Doesn't work on headless linux servers. Not 100% managed as advertised? #93

Open marknuzz opened 7 years ago

marknuzz commented 7 years ago

This project is not 100% managed. Has dependencies on Gdi32, does not work on headless mono servers without virtual x-11 hacks, which can pose challenges.

marknuzz commented 7 years ago

I attached to HtmlContainer.RenderError and got the following error text:

Render Error: System.EntryPointNotFoundException: GetDC
  at (wrapper managed-to-native) PdfSharp.Internal.NativeMethods:G
etDC (intptr)
  at PdfSharp.Fonts.OpenType.FontData.CreateGdiFontImage (PdfSharp
.Drawing.XFont font, PdfSharp.Drawing.XPdfFontOptions options) [0x
00020] in <2a80a7aa909f4f4394d33f68c6061743>:0
  at PdfSharp.Fonts.OpenType.FontData..ctor (PdfSharp.Drawing.XFon
t font, PdfSharp.Drawing.XPdfFontOptions options) [0x00011] in <2a
80a7aa909f4f4394d33f68c6061743>:0
  at PdfSharp.Fonts.OpenType.OpenTypeDescriptor..ctor (PdfSharp.Dr
awing.XFont font, PdfSharp.Drawing.XPdfFontOptions options) [0x000
06] in <2a80a7aa909f4f4394d33f68c6061743>:0

This is a dependency on user32.dll, which is Windows only. HtmlRenderer seems to be using version 1.32 of PdfSharp, which is from 5 years ago. The newest PdfSharp doesn't seem to be hitting user32.dll for this function. Could this library be updated to use the newest PdfSharp?