Skip to content

pdfun

Pure-Rust HTML/CSS to PDF renderer with Python bindings. A WeasyPrint-compatible subset, with zero system dependencies — no Pango, Cairo, GObject, or GTK to install.

Why

WeasyPrint is excellent and we target a compatible subset of its feature set, but it drags in a large C/GObject stack that makes install painful in containers, serverless, and locked-down environments. pdfun is a pure-Rust alternative — pip install pdfun and nothing else.

Where to start

  • Getting Started — install, your first PDF, and how to style it.
  • CSS Support — which CSS properties work, which don't, and the pitfalls that bite.
  • Architecture — how the HTML → layout → PDF pipeline is wired.
  • Parity Matrix — auto-generated per-behavior status against the CSS spec and WeasyPrint.

Status

Roughly 114 of 133 tracked behaviors are implemented. The parity matrix is the authoritative list. Non-goals for now: flexbox, grid, @font-face, position: absolute/fixed, SVG, and PDF encryption.

Source

Code and issues live on GitHub. Contributions welcome — see CONTRIBUTING.md.