![]() Or through the terminal dotnet add package DinkToPdf To use the library you first install it in your project either through the package manager in Visual Studio. The library will then "print" the HTML page to a PDF document with the settings that you choose. DinkToPdf is a cross-platform wrapper around the Webkit HTML to PDF library libwkhtmltox.ĭinkToPdf requires that you first generate HTML and then run it through DinkToPdf. There isn't a lot of choice for PDF generation libraries on. Also I don't want to have a big difference between our development machines and production. ![]() I don't want our developers to struggle on their machine. So while we don't actually need a cross platform PDF generation solution for our production environment we do want a cross platform solution because of developer ergonomics. Development however happens on our Windows machines outside of Docker. One of the first things that we needed to solve is the fact that we run our ASP.NET Core applications on top of Docker. ![]() In this post I will show you how we made the microservice to generate PDF attachments with DinkToPdf. We ended up using DinkToPdf with the ASP.NET Core Razor Template Engine to build a PDF generation microservice. Turns out it is more work than expected, but also more fun than expected. NET Core and I figured: "That can't be hard, or at least it shouldn't be hard". A customer I work for wants to generate a set of attachments for an e-mail we need to send to the clients of that customer.
0 Comments
Leave a Reply. |