Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

WeasyPrint

$ weasyprint Community Low Risk
CourtBouillon · Design & Docs · BSD-3-Clause · macos / linux / windows

WeasyPrint (weasyprint) converts HTML and CSS directly into publication-grade PDF documents using CSS Paged Media (@page, running headers, page counters) without needing headless Chrome or LaTeX. Pure Python + Pango/Cairo rendering makes automated PDF generation fast and reproducible.

FCRS-1.0 Score
83 /100
Good
Medium Confidence
Zero-Friction Install
brew install weasyprint
CLI vs MCP Decision CLI Only

weasyprint renders local HTML+CSS directly to PDF files synchronously via stdin/file paths.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 21 / 25

Clean weasyprint input.html output.pdf CLI supporting stdin/stdout (-), --info, --quiet, and deterministic exit codes.

  • Non-interactive file or stdin-to-PDF rendering
  • weasyprint --info verifies system libraries clearly
Trust & Safety 22 / 25

Does not execute JavaScript in HTML inputs, eliminating browser JS XSS/execution vectors during PDF generation.

  • Zero JavaScript engine execution
  • No credentials needed
Setup & Portability 12 / 15

Easy via brew install weasyprint on macOS; pip install weasyprint requires native Pango/HarfBuzz/Cairo libraries on Linux/Windows.

  • Depends on system Pango/Cairo shared libraries
Utility & Efficiency 13 / 15

Best-in-class for HTML+CSS print layouts (@page headers/footers, PDF/A, attachments) without Chromium bloat.

  • Full CSS Paged Media support
Maintenance & Lineage 8 / 10

Actively maintained by CourtBouillon (Kozea/WeasyPrint) under BSD-3-Clause.

  • Consistent releases and enterprise sponsorship
Docs & Verifiability 7 / 10

Well-documented CLI options and CSS Paged Media support matrix at doc.courtbouillon.org.

  • Official docs at doc.courtbouillon.org/weasyprint/stable/

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

No credentials required; offline HTML/CSS-to-PDF engine.

Side Effects
Read-Only Local Write
Cost & Quotas

Free open-source software (BSD-3-Clause).

Copyable Guardrail for CLAUDE.md / AGENTS.md
# WeasyPrint Agent Rules
- Run `weasyprint --info` first if Pango/Cairo shared-library errors occur.
- Keep input HTML local and pass `--base-url` explicitly when resolving relative assets.
- Remember WeasyPrint does not execute JavaScript—render static HTML/CSS only.

Agent-Ready Command Recipes

Safe Read-Only Queries

Inspect WeasyPrint and Pango system dependencies
weasyprint --info

Prints installed WeasyPrint, Pango, Cairo, and GDK-PixBuf library versions.

Controlled Writes & Previews

Render an HTML report to PDF
weasyprint report.html dist/report.pdf

Compiles report.html and its linked CSS into a paged PDF at dist/report.pdf.

Strengths for Agents

  • + Browser-free HTML/CSS-to-PDF engine with full CSS Paged Media (@page) support.
  • + Never executes JavaScript inside HTML documents, improving safety over headless Chromium.
  • + weasyprint --info simplifies debugging native Pango/Cairo dependencies.

Caveats & Pitfalls

  • ! Requires native Pango/Cairo system libraries when installed via pip on minimal Linux containers.
  • ! Does not evaluate client-side JavaScript (SPAs or client-rendered charts must be pre-rendered to static HTML/SVG).

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI