HTML to PDF.
Pure .NET.

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

dotnet add package PeachPDF

Current version: v0.9.19 — 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 and MathML

Inline <svg>, standalone files, data URIs, and CSS image sources render as real vector PDF content — and so do <math> formulas, typeset from the font's own OpenType MATH table. Crisp at any zoom, never rasterized.

Modern CSS layout

Flexbox, Grid with subgrid, multi-column layout, container queries, cascade layers, nesting, @supports, custom properties with var(), calc(), transforms, and gradients with CSS Color Level 4 interpolation.

Print-grade paged media

@page rules, named pages, margin boxes, running headers, footnotes, automatic bookmarks, and CSS-only tables of contents with real page numbers. Mix page sizes and orientations in one PDF.

Standards-grade PDF output

Optional tagged PDF (PDF/UA) with CSS-driven tag mapping, PDF/A parts 1–3, PDF/X-1a/3/4 with CMYK and ICC color management, and PDF 2.0. Metadata flows in automatically from <title> and <meta>.

Text in every script

Web fonts via @font-face, fonts from a stream, and system font discovery, with browser-grade matching. Arabic and Indic shaping, full Unicode bidi, vertical writing modes, OpenType features, and searchable color emoji.

Images done right

JPEG, PNG, GIF, BMP, WebP, AVIF, and TIFF decode in-process. Lossless images embed without recompression, CMYK stays CMYK, and an image used twice is stored once.

Effects that stay vector

filter, all sixteen mix-blend-mode values, SVG filters, clip-path, border-image, and background-clip: text are written as native PDF content, not baked into bitmaps.

Fillable forms

Turn <input> and <select> into real AcroForm fields — text, checkbox, radio, and choice — styled with ordinary CSS. One opt-in setting, EnableInteractivePdfForms.

See how PeachPDF compares to other .NET PDF libraries

Three ways to build a PDF

One layout engine, three front doors — pick the one that fits how your team works.

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);

Runs where you do

Trimmed and Native AOT

The library is trim-safe and AOT-compatible, so it fits self-contained, single-file, and natively compiled deployments.

Standalone binaries

Prebuilt peachpdf executables for Windows and Linux (x64 and ARM64) and Apple Silicon macOS.

In the browser

The whole pipeline runs under WebAssembly. Try the live demo — your document never leaves your machine.

Desktop, server, and mobile

Windows, Linux, macOS, Android, and iOS, on .NET 8 and newer.

Dig into the docs

Built to be trusted

A PDF can contain exactly the right operators and still look wrong, so PeachPDF is tested on the pixels as well as the bytes.

12,597 automated tests

The parser, cascade, every layout engine, painting, SVG, fonts, and PDF output — run against .NET 8, 10, and 11.

Three operating systems

Every change builds and tests on Windows, Linux, and macOS, where font discovery and text metrics differ most.

A 90% coverage gate

New and changed lines must be covered by tests before a pull request can merge.

Verified by rasterizing

Graphics work is checked by rendering the output with two independent engines — PDFium, Chrome's, and MuPDF — not only by inspecting PDF operators.

Read how PeachPDF is tested

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.