WeasyPrint

weasyprint.org ↗

Render HTML and CSS into PDF from a command line or Python

SI Score
80/100
Pricing
Open Source AI reading, not confirmed
Free plan
Yes AI reading, not confirmed
Sign-up required
Not confirmed

Ask SI about WeasyPrint

Answers use saved listing facts and recorded sources.

What it does

WeasyPrint creates PDFs from HTML and CSS. Its command-line interface accepts a document or URL, while the Python interface exposes page-level rendering and custom resource fetching.

Start with an HTML source and a print stylesheet, then review font availability and warnings about unsupported CSS. The CLI writes a named PDF; Python can return PDF bytes or select rendered pages. Choose the output filename carefully because an existing file is overwritten without a prompt. Default fetching does not handle cookies or authentication. Services accepting untrusted HTML or CSS need explicit limits on rendering time, memory, network access and local files. The engine is BSD-licensed; professional support is offered separately.

Strengths

  • Supports both simple command-line conversion and programmable rendering.

Watch out for

  • Untrusted input requires explicit resource, network, and filesystem restrictions.

Best for

  • Generating styled PDF reports from controlled HTML sources

Sources