News for hackers. Stuff that matters.

Best tool/library to generate PDF documents in .NET?

At my job I need to make many documents like tickets, bills, contracts in PDF format, some of them have a quite complex design. I would like to create bunch of templates and then fill them with data from json, xml files or exported from some remote database.

I mainly work on .Net apps and do programming in C#. I found some solutions online, but I don't know which one to choose, most of them seem to focus on just converting from other formats like html to pdf, but I need to basically create PDF files from scratch with code.

I wonder if anyone encountered such need and would be grateful for any suggestions for a cheap and easy-to-do solution from your own experience.

( 5 comments | 2 points | on HN )
Re:Best tool/library to generate PDF documents in .NET? by bekzat_karayev on Thursday April 01, 2021 @05:46PM (#26666535)
Searching in the recently updated nuget packages I came across this Pdfflowlib library: https://www.nuget.org/packages/Gehtsoft.PDFFlowLib/

Examples that this library provide look pretty neat: https://github.com/gehtsoft-usa/PDF.Flow.Examples/tree/maste...

I'll try to use them as a starting point for building my docs.

Re:Best tool/library to generate PDF documents in .NET? by frytaz on Wednesday March 31, 2021 @06:59AM (#26645703)
It converts from html to pdf but it works really well, You can generate html from templates with your data. Used it in many projects

https://www.nuget.org/packages/Wkhtmltopdf.NetCore/

Re:Best tool/library to generate PDF documents in .NET? by bekzat_karayev on Thursday April 01, 2021 @05:14PM (#26666126)
Thanks, this one seem to also have a view engine, I will check it out what templates does it provide.
Re:Best tool/library to generate PDF documents in .NET? by daleholborow on Wednesday March 31, 2021 @06:32AM (#26645547)
Aspose and syncfusion are two that come to mind
Re:Best tool/library to generate PDF documents in .NET? by bekzat_karayev on Thursday April 01, 2021 @05:31PM (#26666342)
Thank you, those seem to be quite versatile tools, I will look into them.