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 pdf_ua: bool,
pub embedded_data: Option<String>,
pub flatten_forms: bool,
pub signature: Option<SignatureConfig>,
}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”.
pdf_ua: boolWhen true, the PDF claims PDF/UA-1 conformance. Forces tagged = true.
embedded_data: Option<String>Optional JSON string to embed as an attached file in the PDF. Enables round-tripping structured data through PDF files.
flatten_forms: boolWhen true, form field values are rendered as static content and no interactive AcroForm widgets are emitted. The resulting PDF has no fillable fields.
signature: Option<SignatureConfig>Digital signature configuration. When set, the rendered PDF is signed with the specified X.509 certificate and RSA private key.