Posts

Showing posts with the label DinkToPDF

Donate

How To Create Or Generate PDF Reports Or Files Using DinkToPDF in .NET 5 or .NET Core Console Application

Image
Good day! In this tutorial, I will demonstrate on how to create or generate PDF reports or files using DinkToPDF in .NET 5 or .NET Core Console Application. This library is a C# .NET Core wrapper for wkhtmltopdf library that uses the Webkit engine to convert HTML files or page to PDF and was developed by 'rdvojmoc Rok Dvojmoč' from Slovenia. To begin with lets start by establishing the project structure. Project Structure 1. Create a .NET 5 or .NET Core Console Application Project. 2. Add DinkToPDF and Unity packages using NuGet. 3. Copy the libwkhtmltox (dll, dylib and so) files from DinkToPDF and attach those files to your project. Make sure to set the Copy to Output Directory attribute of those files to Copy Always . Note that there are two versions for these files,32 and 64 bit. 4. Create three folders to the project and in each folder add the empty classes or interface shown in step #6. 5. Add an empty html file called ReportTemplate inside the project and set

Donate