HTML to PDF.
Pure .NET.

PeachPDF renders HTML, CSS, and SVG straight to vector PDF — entirely in-process. No headless browsers. No native dependencies. Anywhere .NET runs.

dotnet add package PeachPDF

Current version: v0.9.8 — release notes

Why PeachPDF

Pure .NET, in-process

No Puppeteer, wkhtmltopdf, or Ghostscript to install, babysit, or patch. HTML parsing, CSS cascade, layout, and PDF writing all run inside your process — containers, serverless, trimmed and AOT deployments included.

Native vector SVG

Inline <svg>, standalone files, data URIs, and CSS background-image sources render as real vector PDF content — crisp at any zoom, never rasterized.

Modern CSS layout

Flexbox, multi-column layout, 2D and 3D transforms, custom properties with var(), calc()/min()/max()/clamp(), and gradients with CSS Color Level 4 interpolation.

Print-grade paged media

@page rules, named pages, margin boxes, and running headers and footers — the CSS Paged Media toolkit for real documents, not screenshots of web pages.

Accessible, tagged output

Optional Tagged PDF (PDF/UA) output with a logical structure tree, automatic document language, and CSS-driven tag mapping. Metadata flows in automatically from <title> and <meta>.

Real font handling

Web fonts via @font-face, fonts loaded from a stream, system font discovery on every platform, and browser-grade weight/style/stretch matching with faux-bold and faux-italic synthesis.

See how PeachPDF compares to other .NET PDF libraries

A few lines to a finished PDF

One package, one generator, one call. Render any HTML string to a vector PDF document and save it wherever a stream goes.

PdfGenerateConfig pdfConfig = new(){
  PageSize = PageSize.Letter,
  PageOrientation = PageOrientation.Portrait
};

PdfGenerator generator = new();

var document = await generator.GeneratePdf(html, pdfConfig);
document.Save(stream);

Dig into the docs

Ready to render?

dotnet add package PeachPDF

Free and open source. Available on NuGet, developed on GitHub.

Need help? Free community and paid support options are available.