Interface: TemplateDocumentOptions
Top-level options for rendering template blocks into a complete document.
Properties
| Property | Type | Description |
|---|---|---|
autoOutline? | boolean | TemplateAutoOutlineOptions | When set, auto-generates a bookmarks/outline tree from heading blocks. true uses defaults (maxLevel=3, collapsed); pass an object to customise. |
blocks | readonly TemplateBlock[] | Child template blocks to render. |
fonts? | Record<string, FontFamilyInput> | Named font families to register before rendering. Keys are family names; values are the faces that make up each family. Each face may be a built-in FontName, a handle from PdfDocument.embedTrueTypeFont, or raw TrueType/OpenType bytes (embedded automatically under the family name). Registered families are available by name in template blocks, styles, and the defaultFont option. doc.renderTemplate({ blocks: [...], fonts: { Inter: { regular: interRegularBytes, bold: interBoldBytes } } }); |
footer? | (context) => readonly TemplateBlock[] | Callback that returns footer blocks for each page. |
header? | (context) => readonly TemplateBlock[] | Callback that returns header blocks for each page. |
info? | DocumentInfo | Document information dictionary values. |
page? | TemplatePageOptions | Page. |
pageNumber? | TemplatePageNumberOptions | One-based page number currently being rendered. |
strictLayout? | boolean | TemplateStrictLayoutOptions | Enables strict layout checks for fixed templates. When true, oversized content that would overflow a fresh page/column throws instead of being force-placed. |
styles? | TemplateStylesheet | Reusable named styles merged beneath each block's inline options. See TemplateStylesheet for the selector and cascade rules. |
title? | string | Document title applied to the information dictionary, structured XMP metadata, and display-title viewer preference. |
xmpMetadata? | XmpMetadataInput | XMP metadata packet or structured XMP metadata input. |