Skip to content

Releases: raroche/NetPdf

Release list

NetPdf 1.0.0

Choose a tag to compare

@raroche raroche released this 09 Jul 19:36
0d44588

NetPdf 1.0.0 — the first stable release. A pure C# / .NET 10 HTML+CSS-to-PDF rendering engine (Apache-2.0). HtmlPdf.Convert(html) runs the full HTML → CSS → layout → paginate → paint → PDF pipeline end-to-end, producing deterministic PDF bytes with no browser, no subprocess, and no revenue-capped or copyleft dependencies.

Install

dotnet add package NetPdf --version 1.0.0

Supported platforms

.NET 10 on Linux, macOS, and Windows (x64 and arm64). Native-AOT compatible and trimmable. HarfBuzz + Skia native assets are restored automatically — no browser, no subprocess, no manual native install.

Linux slim containers must install fontconfig (Skia's raster fallback links it). See the README.

Highlights

  • Layout & pagination — block, inline, flex (L1), grid (L1), table, multi-column, absolute/fixed positioning; fragmentainer-aware pagination with a break cost model (break-*, widows, orphans); <thead>/<tfoot> repeat across pages.
  • Paged media@page size/margins + all 16 margin boxes; running headers/footers via position: fixed / running() + element() / string(); page numbers via counter(page).
  • Text — OpenType shaping (HarfBuzz), bidi (UAX #9), line breaking (UAX #14, incl. CJK), grapheme segmentation (UAX #29); @font-face (TTF/OTF/WOFF/WOFF2) + subsetting; bundled English hyphenation (other languages via NetPdf.Languages.*).
  • Visual parity — backgrounds, borders, border-radius, gradients (linear/radial/conic), box & text shadows, 2D transforms, opacity, clip-path, masks, blend modes; CSS filters via a raster fallback; static SVG; JPEG/PNG/WebP/AVIF/GIF images with content-hash dedup.
  • Documents & navigation — internal #id links → /GoTo, external links → /URI; heading outline (bookmarks); /Info + XMP /Metadata + catalog /Lang.
  • CSS — cascade, var(), calc()/min()/max()/clamp()/abs()/sign(); ::before/::after/::marker/::first-line/::first-letter.

Engine guarantees

  • Deterministic — identical input → identical bytes; no timestamp is read unless you set one.
  • Native-AOT compatible, with a JIT/AOT byte-parity gate.
  • No process spawning at render time.
  • Unsupported features emit a stable structured diagnostic code rather than throwing or silently dropping content.

Security

Hardened against the known HTML-to-PDF attack classes (SSRF, local-file read, resource bombs, decoder bugs, PDF active content). SecurityPolicy presets (UntrustedHtml / SafeDefault / TrustedTemplate) with per-render resource budgets. Report vulnerabilities privately via the repository's Security tab — see SECURITY.md.

Known caveats

  • Depends on AngleSharp.Css 1.0.0-beta.* (no stable 1.x exists yet); dotnet pack emits NU5104 as a visible warning (not hidden) so the pre-release dependency stays auditable. To be revisited when AngleSharp.Css ships a stable 1.x.
  • Tailwind via CDN does not render (it needs runtime JS to generate utility CSS) — pre-compile Tailwind to static CSS.