Skip to content

StyledRenderOptions

Defined in: src/layout/styled-layout.ts:170

The full option set the layout engine and PDF emitter consume: the resolved font registry, the style/numbering tables, the section model and page geometry, the after-body apparatus (footnotes, endnotes, comments), and every PDF-output toggle (PDF/A, tagged, PDF/UA, encryption, attachments, signatures). Only registry and styles are required; everything else falls back to a sensible default.

readonly optional attachments?: readonly AttachedFile[]

Defined in: src/layout/styled-layout.ts:290

Files to embed as associated files (catalog /AF + /Names /EmbeddedFiles). Only emitted for plain PDF and PDF/A-3 (PDF/A-1/2 forbid arbitrary embedded files); ignored for PDF/A-1/2. The docx/xlsx converters can embed the source document automatically via embedSource.


readonly optional charts?: ReadonlyMap<string, Chart>

Defined in: src/layout/styled-layout.ts:231

Parsed charts keyed by relationship id (ChartBlock.chartRelId). Supplied by the converter, which resolves the chart parts from the package.


readonly optional commentAnnotations?: boolean

Defined in: src/layout/styled-layout.ts:224

CM2b — also emit each comment as a native PDF /Text (sticky-note) annotation at its marker. Opt-in and interactive-only: suppressed under PDF/A and tagged output (where it would need annotation/appearance conformance), since the clickable marker + Comments section already carry the content there.


readonly optional comments?: ReadonlyMap<string, Comment>

Defined in: src/layout/styled-layout.ts:216

§17.13.4 review comments by id; rendered as superscript markers in text and a list after the body (after endnotes), each with its author/date.


readonly optional embeddedFonts?: ReadonlyMap<string, FontRegistry>

Defined in: src/layout/styled-layout.ts:188

The document’s OWN embedded fonts (word/fonts/*.odttf, de-obfuscated), keyed by normalized font name. A run whose w:ascii matches one renders with the real font — glyph-exact, no substitution. Highest priority.


readonly optional encrypt?: PdfEncryptOptions

Defined in: src/layout/styled-layout.ts:283

§7.6 PDF encryption (AES-256, R6). Only honoured on the ASYNC conversion path (WebCrypto); mutually exclusive with pdfA (ISO 19005 forbids /Encrypt) and with signatures (v1).


readonly optional endnotes?: ReadonlyMap<string, readonly BodyElement[]>

Defined in: src/layout/styled-layout.ts:211


readonly optional footnotes?: ReadonlyMap<string, readonly BodyElement[]>

Defined in: src/layout/styled-layout.ts:210

§17.11 notes content by id. Footnotes render in a reserved band at the bottom of the referencing page; endnotes flow after the body.


readonly optional headersFooters?: ReadonlyMap<string, readonly BodyElement[]>

Defined in: src/layout/styled-layout.ts:205

Header/footer body content keyed by relationship id.


readonly optional hyphenator?: Hyphenator

Defined in: src/layout/styled-layout.ts:243

Optional Liang hyphenator. When set, each word token is split at allowed hyphenation positions and offered to Knuth-Plass as potential break points (with a small disincentive). Improves justified paragraph rags.


readonly optional info?: DocumentInfo

Defined in: src/layout/styled-layout.ts:248

Optional /Info dictionary metadata (ISO 32000-1 §14.3.3). Unset fields are omitted; if any field is set a PDF /Info entry is emitted.


readonly optional language?: string

Defined in: src/layout/styled-layout.ts:277

Document natural language (BCP 47, e.g. "en-US", "ru-RU") for the tagged-PDF catalog /Lang (§14.9.2). Defaults to "en-US". The docx converter fills this from the document’s default w:lang.


readonly optional layoutProfile?: LayoutProfile

Defined in: src/layout/styled-layout.ts:174

Renderer-compatibility profile for the line-height model (default 'ream').


readonly optional marginBottom?: number

Defined in: src/layout/styled-layout.ts:237


readonly optional marginLeft?: number

Defined in: src/layout/styled-layout.ts:234


readonly optional marginRight?: number

Defined in: src/layout/styled-layout.ts:235


readonly optional marginTop?: number

Defined in: src/layout/styled-layout.ts:236


readonly optional numbering?: Numbering

Defined in: src/layout/styled-layout.ts:192

§17.9 numbering definitions; applied to list paragraphs before layout.


readonly optional pageHeight?: number

Defined in: src/layout/styled-layout.ts:233


readonly optional pageWidth?: number

Defined in: src/layout/styled-layout.ts:232


readonly optional pdfA?: PdfALevel

Defined in: src/layout/styled-layout.ts:258

When set, emit a PDF/A-conformant file: an OutputIntent with an embedded sRGB ICC profile, document XMP /Metadata (the pdfaid identifier), /ID, and subset-tagged fonts with a /CIDSet. The profile picks the rest: part 1 → PDF 1.4 + flattened image alpha (no transparency); part 2/3 → PDF 1.7 + preserved transparency (image /SMask + page group); part 3 → may carry embedded associated files (see attachments); level a → tagged (logical structure); b → visual; u → b + Unicode mapping.


readonly optional pdfUA?: boolean

Defined in: src/layout/styled-layout.ts:271

PDF/UA-1 (ISO 14289-1): implies tagged; the XMP carries pdfuaid:part=1 and the document always gets a title (AT announces it). Combines freely with pdfA level-a profiles.


readonly optional registriesByFamily?: ReadonlyMap<FamilyKey, FontRegistry>

Defined in: src/layout/styled-layout.ts:182

Per-run font resolution: when supplied, each text run picks the registry of its declared family (sans→arimo / serif→tinos / mono→cousine via the run’s w:ascii) instead of always using registry. Absent ⇒ single-family (every run uses registry), byte-identical to before. registry remains the guaranteed fallback for math/chart/default glyphs and any missing family.


readonly registry: FontRegistry

Defined in: src/layout/styled-layout.ts:172

The resolved font set every run draws with (the guaranteed fallback registry).


readonly optional resources?: ResourceStore

Defined in: src/layout/styled-layout.ts:226

Content-addressed binary store; image nodes reference it by ResourceId.


readonly optional section?: SectionProperties

Defined in: src/layout/styled-layout.ts:197

Single-section legacy entry-point. If sections is set it takes precedence and section is ignored.


readonly optional sections?: readonly Section[]

Defined in: src/layout/styled-layout.ts:203

ECMA-376 §17.6 — ordered list of sections. Each section’s endIndex is the exclusive bound into the body array (section N covers body[sections[N-1].endIndex..sections[N].endIndex)).


readonly optional signaturePlaceholder?: SignaturePlaceholder

Defined in: src/layout/styled-layout.ts:297

Emit an (invisible) signature field + signature dictionary with placeholder /ByteRange and /Contents (ISO 32000 §12.8). The result is an UNSIGNED PDF; pass it to signPdf() to fill the placeholder with a real PKCS#7 signature.


readonly styles: StyleSheet

Defined in: src/layout/styled-layout.ts:190

§18.8 / ECMA-376 style table the cascade resolves against.


readonly optional tagged?: boolean

Defined in: src/layout/styled-layout.ts:265

Emit a tagged PDF (ISO 32000-1 §14.8): a /StructTreeRoot describing reading order, marked content (BDC/EMC + MCID) on body text, and /Artifact marking of page decoration. Implied by pdfA: 'PDF/A-1a'. Independent of PDF/A otherwise (a plain tagged PDF is useful on its own).