Skip to content

ConvertOptions

Defined in: src/core/converter/facade.ts:42

Options for a Converter.convert call (extends the docx PDF options).

  • ConvertDocxOptions

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.

StyledRenderOptions.attachments


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.

StyledRenderOptions.charts


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.

StyledRenderOptions.commentAnnotations


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.

StyledRenderOptions.comments


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.

StyledRenderOptions.embeddedFonts


readonly optional embedSource?: boolean

Defined in: src/word/docx-to-pdf.ts:38

For PDF/A-3 only: embed the input .docx as an associated source file (/AFRelationship /Source) so the archive carries its own source. Ignored for other profiles (PDF/A-1/2 forbid arbitrary embedded files).

ConvertDocxOptions.embedSource


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).

StyledRenderOptions.encrypt


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

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

StyledRenderOptions.endnotes


readonly optional fontBytes?: Uint8Array<ArrayBufferLike>

Defined in: src/word/docx-to-pdf.ts:23

A single regular-variant font as raw bytes.

ConvertDocxOptions.fontBytes


readonly optional fontFamily?: string

Defined in: src/word/docx-to-pdf.ts:30

Force a substitute font family for the auto-download path (e.g. 'serif'). Ignored when fonts/fontBytes are supplied.

ConvertDocxOptions.fontFamily


readonly optional fontFetch?: FetchLike

Defined in: src/word/docx-to-pdf.ts:32

Injectable fetch for the auto-download path (defaults to the global fetch).

ConvertDocxOptions.fontFetch


readonly optional fontProviders?: readonly FontProvider[]

Defined in: src/core/converter/facade.ts:67

Font resolution chain (ir-design §8). When set (and no caller fonts), the facade resolves the default font set through these providers — e.g. [localFontProvider(), remoteFontProvider()] — and reports a ‘substituted’ loss when anything below a caller/embedded answer wins. Local Font Access stays strictly opt-in via this option (it can trigger a permission prompt), which is why nothing wires it in by default.


readonly optional fonts?: FontBytesByVariant

Defined in: src/word/docx-to-pdf.ts:25

Explicit font bytes per variant (regular/bold/italic/bold-italic).

ConvertDocxOptions.fonts


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.

StyledRenderOptions.footnotes


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

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

Header/footer body content keyed by relationship id.

StyledRenderOptions.headersFooters


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.

StyledRenderOptions.hyphenator


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.

StyledRenderOptions.info


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.

StyledRenderOptions.language


readonly optional layoutProfile?: LayoutProfile

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

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

StyledRenderOptions.layoutProfile


readonly optional marginBottom?: number

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

StyledRenderOptions.marginBottom


readonly optional marginLeft?: number

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

StyledRenderOptions.marginLeft


readonly optional marginRight?: number

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

StyledRenderOptions.marginRight


readonly optional marginTop?: number

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

StyledRenderOptions.marginTop


readonly optional now?: Date

Defined in: src/core/converter/facade.ts:58

E-SHEET W9 — reference date for conditional-format timePeriod rules and TODAY()/NOW() in expression rules (spreadsheet input). An explicit input, never the wall clock; omitted ⇒ those clock-relative rules no-op.


readonly optional numbering?: Numbering

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

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

StyledRenderOptions.numbering


readonly optional pageHeight?: number

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

StyledRenderOptions.pageHeight


readonly optional pageWidth?: number

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

StyledRenderOptions.pageWidth


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.

StyledRenderOptions.pdfA


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.

StyledRenderOptions.pdfUA


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.

StyledRenderOptions.registriesByFamily


readonly optional resources?: ResourceStore

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

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

StyledRenderOptions.resources


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.

StyledRenderOptions.section


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)).

StyledRenderOptions.sections


readonly optional signature?: SignatureOptions

Defined in: src/word/docx-to-pdf.ts:43

Digitally sign the output (ISO 32000 §12.8). Requires the async convertDocxToPdf (signing uses WebCrypto); ignored by the sync converter.

ConvertDocxOptions.signature


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.

StyledRenderOptions.signaturePlaceholder


readonly optional strict?: boolean

Defined in: src/core/converter/facade.ts:52

Strict mode (handoff v1 §5): throw ConversionLossError on the first recorded loss instead of returning it in the report.


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).

StyledRenderOptions.tagged


readonly optional to?: "pdf" | "svg" | "html" | "docx" | "xlsx"

Defined in: src/core/converter/facade.ts:47

Target: ‘pdf’ (default), ‘svg’ (page-stack preview), ‘html’/‘docx’ (flowed), or ‘xlsx’ (the native grid writer — spreadsheet input only).