This API is used to convert HTML to PDF. It is a simple API that takes HTML content and converts it to PDF. THe API is built using Minimal APIs and is intended to run on windows and docker container (linux).
The API uses the following libraries:
DinkToPdf- This is a .NET Core library that uses the WebKit engine to convert HTML to PDF. It is a wrapper around thewkhtmltopdflibrary. - MITNReco.PdfGenerator.LT- HTML to PDF converter for .NET Framework / .NET Core (WkHtmlToPdf wrapper). - Commercial LicensePuppeteerSharp- Puppeteer Sharp is a .NET port of the official Node.JS Puppeteer API. It uses a headless browser (chrome) to convert HTML to PDF. - MITGotenberg- A Docker-powered stateless API for PDF files. - MITiTextSharp 4.1.6- iTextSharp is a port of the iText open source Java library for PDF generation written entirely in C# for the .NET platform. - Mozilla Public License and the LGPL.
The following libraries was used but I was not able to get them to work in both environments (docker/windows)
IronPdf- IronPDF is a commercial library that can be used to convert HTML to PDF. - Commercial LicensePugPDF.Core- WkHtmlToPdf .net core wrapperSyncFusion- The Syncfusion HTML to PDF converter is a .NET Standard library that converts URLs, HTML string, SVG, and MHTML to PDF in .NET Core applications. This converter uses the advanced Blink rendering engine, thus generating pixel-perfect PDF from HTML or URL.
- .NET 8.0 SDK
- Docker
- NReco/IronPDF/Syncfusion (trial) license key
- Set
docker-composeproject as startup project and run. - The API will be available at
http://localhost:5001 - Gotenberg API will be available at
http://gotenberg:3000in the container but also in the host machine athttp://localhost:3000
- Stop the API image on container but let Gotenberg running.
- Set PocAPI as startup project, select
https profileand run.
- Fork the repository and clone it to your local machine.
- Submit a pull request explaining the changes you have made.