Skip to content

a11ydocs v1.7.0


a11ydocs / TemplateDocumentOptions

Interface: TemplateDocumentOptions

Defined in: src/types.ts:1903

Top-level options for rendering template blocks into a complete document.

Properties

PropertyTypeDescriptionDefined in
autoOutline?boolean | TemplateAutoOutlineOptionsWhen 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
blocksreadonly 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?DocumentInfoDocument information dictionary values.src/types.ts:1907
page?TemplatePageOptionsPage.src/types.ts:1911
pageNumber?TemplatePageNumberOptionsOne-based page number currently being rendered.src/types.ts:1949
strictLayout?| boolean | TemplateStrictLayoutOptionsEnables 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?TemplateStylesheetReusable named styles merged beneath each block's inline options. See TemplateStylesheet for the selector and cascade rules.src/types.ts:1939
title?stringDocument title applied to the information dictionary, structured XMP metadata, and display-title viewer preference.src/types.ts:1905
xmpMetadata?XmpMetadataInputXMP metadata packet or structured XMP metadata input.src/types.ts:1909

Released under the ISC license.