0

I'm looking for a way to generate a PDF document from either HTML (including resources such as CSS & images), or from a URL with .NET Core.

I've found plenty of .NET Framework libraries that will do it, but not .NET Core.

I'm currently using https://www.nuget.org/packages/iTextSharp.LGPLv2.Core/ but this doesn't seem to have all of the functionality of its .NET Framework counterpart.

Has anyone successfully used this library, or anything else that will do this?

P.S. Not http://wkhtmltopdf.org/ because I've already tried this.

  • Why is .Net core important for you? – Ryan Jan 10 '17 at 18:18
  • @Ryan there is a plethora of reasons why, but in this instance because the company I work for use .NET Core and want HTML => PDF, so my hands are pretty much tied – series0ne Jan 10 '17 at 19:03
  • I found that iTextsharp requires System.Drawing.dll and there is no alternative in .netcore for same. As it depends on GDI+ functionality which may not work in cross platforms implementations. Is there a way to resolve this dependencies? I did not find any. – Sanjay Zalke Nov 28 '17 at 15:50
  • @SanjayZalke I think they’ve fixed that in .NET Core 2.0 but I’m not sure if iTextSharp supports that yet. They will have to retarget to .NET Standard 2.0 rather than the full .NET Framework – series0ne Nov 28 '17 at 16:32
  • "doesn't seem to have all of the functionality": please say exactly what functionalities. – Nicolas Raoul Feb 15 at 9:26
0

Syncfusion supports HTML to PDF in .NET Core for Windows, Linux, and MacOS as well. The result preserves all graphics, images, texts, fonts, and the layout of the original HTML document or webpage.

Refer the KB to convert HTML to PDF using ASP.NET Core application

https://www.syncfusion.com/kb/8483/how-to-convert-html-to-pdf-in-asp-net-core-windows

Note: I work for Syncfusion.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.