pub struct Document {
pub children: Vec<Node>,
pub metadata: Metadata,
pub default_page: PageConfig,
pub fonts: Vec<FontEntry>,
pub default_style: Option<Style>,
pub tagged: bool,
pub pdfa: Option<PdfAConformance>,
pub embedded_data: Option<String>,
}Expand description
A complete document ready for rendering.
Fields§
§children: Vec<Node>The root nodes of the document. Typically one or more Page nodes, but can also be content nodes that get auto-wrapped in pages.
metadata: MetadataDocument metadata (title, author, etc.)
default_page: PageConfigDefault page configuration used when content overflows or when nodes aren’t explicitly wrapped in Page nodes.
fonts: Vec<FontEntry>Custom fonts to register before layout. Each entry contains the font family name, base64-encoded font data, weight, and style.
default_style: Option<Style>Default style applied to the root of the document tree.
Useful for setting a global font_family, font_size, color, etc.
tagged: boolWhether to produce a tagged (accessible) PDF with structure tree.
pdfa: Option<PdfAConformance>PDF/A conformance level. When set, forces tagged = true for “2a”.
embedded_data: Option<String>Optional JSON string to embed as an attached file in the PDF. Enables round-tripping structured data through PDF files.