Launching today

HtmlToPdf
Convert HTML & URLs to PDF in C# via Chrome Headless Shell
1 follower
Convert HTML & URLs to PDF in C# via Chrome Headless Shell
1 follower
A lightweight C# library forNET Framework 4.8 andNET 10 that converts HTML and URLs to PDF via Chrome DevTools Protocol (headless Chrome/Chromium). Supports files, MemoryStream, batch jobs, and IIS with guaranteed process cleanup. MIT licensed.

Launch Team

AWS Activate CreditsCredits that fuel your startup’s next milestone
Promoted
Hey Product Hunt! I'm Rocco, the maker of HtmlToPdf.
Why I built this Generating pixel-accurate PDFs from HTML in C# often means pulling in heavy wrappers, paying per-seat commercial licenses, or fighting orphaned Chrome processes under IIS. I wanted a clean, MIT-licensed library with the exact same API across both legacy .NET Framework 4.8 and modern .NET 10 apps.
Key features
Dual target, identical API: Works in Windows Forms, WPF, Console, ASP.NET 4.8 (WebForms/MVC), and ASP.NET Core (.NET 10) on Windows and IIS.
Direct Chrome DevTools Protocol (CDP): Talks directly to headless Chrome, Chromium, or standalone chrome-headless-shell.exe using only Newtonsoft.Json as an external dependency.
Flexible output: Save atomically to a file (CreatePdf / CreatePdfAsync), write to a MemoryStream (CreatePdfStream / CreatePdfStreamAsync), or process multiple documents in one browser session (CreatePdfBatch / CreatePdfBatchAsync).
Built for IIS & production: Uses Windows Job Objects (ProcessJob) and temp-only storage (Path.GetTempPath()) so headless Chrome processes are guaranteed to terminate even when an IIS Application Pool recycles.
Full layout control: Custom margins (mm, cm, in, px), portrait/landscape, paper formats, header/footer templates, and wait conditions (Load, Domcontentloaded, Networkidle0, Networkidle2).
Quick example
I'd love your feedback! If you maintain .NET Framework 4.8 or .NET 10 apps that generate invoices, reports, or printable views, give it a try on GitHub and let me know what you think!