Our great sponsors
-
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)
-
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.
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
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.