Best way to deal with PDF file generation

This page summarizes the projects mentioned and recommended in the original post on /r/csharp
PDF

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • library

    Discontinued QuestPDF is an open-source, modern and battle-tested library that can help you with generating PDF documents by offering friendly, discoverable and predictable C# fluent API. (by questpdf)

  • ExoMerge

    Discontinued A library that supports merging a document with data, for .NET.

  • Aspose is a good tool for the job if you can pay for the license. If not, then you’d have to get more creative. I wrote libraries for generic document merging years ago, and word docs via Aspose was one of the supported formats. It also supported OpenXml I believe, but of course the challenge there would be converting to PDF. I think I toyed with some text-based format, markdown I think. Markdown may not be the most friendly format for a non-technical person, unless you could find a good WYSIWYG editor for it. Then you could convert the markdown to HTML. And I imagine it should be possible to convert from HTML to PDF. Sounds convoluted, right? Something like Aspose is the easier route. Anyway, here’s the link to that lib I mentioned, you may find something useful in it. https://github.com/vc3/ExoMerge

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • WKHTMLToPDF

    Discontinued Convert HTML to PDF using Webkit (QtWebKit)

  • Time-proven way: HTML page as a template -> generate PDF with wkhtmltopdf (it still the best for things like invoices/documents in terms of deployment/maintenance/stability). You can use existing .NET wrappers for wkhtmltopdf -- like NReco.PdfGenerator (> 2mln downloads on nuget.org) -- and perform HTML-to-PDF conversion in a few lines of C# code.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts