Document

PDF

Takes a block

Root of a PDF document: the paper, the margins and what the file says about itself.

Document(page_size: …, size: …, landscape: …) { … }

Example

Document(page_size: "A4") { Section { Heading("Report").h1 Paragraph("Revenue grew.") } }

Renders with the class wf-document, stable across releases, so a stylesheet may target it.

Props of Document
Prop Type Meaning
page_size: .A4 .A3 .A5 .Letter .Legal

Paper size (also size:)

size: String

Paper size: A4, Letter, Tabloid, or two lengths, 210mm 297mm

landscape: Bool

Turn the paper on its side

margin: Any

The page margins: one length, or top right bottom left (72, 20mm 25mm)

title: String

The file's title, shown by a reader in place of its name

author: String

The file's author; several separated by commas

subject: String

What the document is about

keywords: String

Comma-separated keywords

lang: String

The document's language, for screen readers and hyphenation

Attribute families: global, aria, data. Plus the universal props on every element: animate:, exit:, speed:, class:, ref:.