> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reducto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# @reductoai/docx/node

Node-only helpers: fonts, conversion and the layout host. `WordDocument` from this entry point also reads and writes files.

## `registerSystemFonts()`

```ts theme={null}
function registerSystemFonts(registry?: FontRegistry): void
```

Installs the built-in table that maps Office font families to the faces the package lays out with.

Import from `@reductoai/docx/node`.

## `registerPortableFonts()`

```ts theme={null}
function registerPortableFonts(dir?: string, registry?: FontRegistry): void
```

Install the portable FaceSets from `dir` (defaults to the font package),
plus the packaged pan-CJK fallback.

Import from `@reductoai/docx/node`.

## `setFontCacheDir()`

```ts theme={null}
function setFontCacheDir(dir: string): void
```

Redirect the unpacked-face cache. Clears the in-memory memo so already
extracted members are re-materialised under the new root on next lookup.

Import from `@reductoai/docx/node`.

## `nodeLayoutHost`

```ts theme={null}
const nodeLayoutHost: SessionLayoutHost<DocxSession> = ...
```

The node LayoutHost: one cached SessionLayout per session, keyed on
`editVersion()`. Only edits advance it, so a `toBytes()` between two
measures is a read and never forces a relayout; that is what makes
measure-many loops (footers, TOC entries) affordable.

Import from `@reductoai/docx/node`.

## `convertDocxToPdf()`

```ts theme={null}
function convertDocxToPdf(
  docxPath: string,
  opts?: PipelineOptions & { render?: RenderPdfOptions },
): Promise<RenderPdfResult & { fontFallbacks?: FontFallback[]; pageCount: number }>
```

Lay out and paint a .docx from disk in one go. The engine's layout carries the
PDF header (fonts, images, bookmarks), so the file is parsed once.

Import from `@reductoai/docx/node`.

## `renderPngPages()`

```ts theme={null}
function renderPngPages(
  ir: LayoutDocument,
  opts?: RenderPngOptions,
): Promise<RenderedPng[]>
```

Render IR pages to PNG buffers. Fonts and images come from the IR + registry.

Import from `@reductoai/docx/node`.
