Appearance
a11ydocs / TemplateDocumentOptions
Interface: TemplateDocumentOptions
Defined in: src/types.ts:1903
Top-level options for rendering template blocks into a complete document.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
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. | src/types.ts:1954 |
blocks | readonly TemplateBlock[] | Child template blocks to render. | src/types.ts:1913 |
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 } } }); | src/types.ts:1934 |
footer? | (context) => readonly TemplateBlock[] | Callback that returns footer blocks for each page. | src/types.ts:1945 |
header? | (context) => readonly TemplateBlock[] | Callback that returns header blocks for each page. | src/types.ts:1941 |
info? | DocumentInfo | Document information dictionary values. | src/types.ts:1907 |
page? | TemplatePageOptions | Page. | src/types.ts:1911 |
pageNumber? | TemplatePageNumberOptions | One-based page number currently being rendered. | src/types.ts:1949 |
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. | src/types.ts:1960 |
styles? | TemplateStylesheet | Reusable named styles merged beneath each block's inline options. See TemplateStylesheet for the selector and cascade rules. | src/types.ts:1939 |
title? | string | Document title applied to the information dictionary, structured XMP metadata, and display-title viewer preference. | src/types.ts:1905 |
xmpMetadata? | XmpMetadataInput | XMP metadata packet or structured XMP metadata input. | src/types.ts:1909 |