Updated Sep 21, 2026

Utilities

Turn styled HTML into paginated PDF output

HTML and CSS in, a paginated PDF out.

Agent

overview

What weasyprint does

WeasyPrint loads one connected HTML document, applies its embedded styles and an optional --stylesheet file, then writes a PDF artifact. CSS print rules control page size, margins, breaks, headers, and other paged-media behavior.

Enable --presentational-hints when legacy HTML attributes such as width, align, or bgcolor should influence rendering. Modern documents should express those choices in CSS instead.

This is an HTML/CSS renderer, not a browser automation node. It does not execute application interactions or wait for client-side JavaScript to populate a page.

source github.com/Kozea/WeasyPrint

use cases

Where weasyprint fits

Render workflow reports

Turn generated HTML findings into a fixed PDF deliverable.

Create evidence bundles

Apply a shared print stylesheet to consistent review and audit documents.

Generate invoices or summaries

Render structured HTML records with CSS page headers, footers, and page breaks.

reference

weasyprint inputs and flags

3 inputs
NameTypeFlagDescription
inputFILE--inputInput HTML document.
stylesheetFILE--stylesheetAdditional CSS stylesheet.
presentational-hintsBOOLEAN--presentational-hintsHonor HTML presentational attributes.

Showing key inputs. weasyprint exposes 3 inputs in total.

example

Run weasyprint

weasyprint · command
weasyprint report.html report.pdf
sample output
%PDF-1.71 0 obj<</Type /Pages/Count 1>>

guidance

Choosing weasyprint

Use WeasyPrint when HTML and CSS are the source of truth for a PDF. Use LibreOffice for office-document conversion.

libreoffice

Converts office documents through LibreOffice import and export filters.

pandoc

Converts document structure between markup and text-oriented formats.

browser-fetch

Renders JavaScript-driven web pages and captures browser output.

faq

weasyprint questions

No. Prepare complete HTML before connecting it to this node.

Run weasyprint yourself

A styled HTML fixture is rendered to one PDF page and checked for a valid PDF signature.

Facts on this page come from the live Trickest tool library.