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

registerSystemFonts()

Installs the built-in table that maps Office font families to the faces the package lays out with. Import from @reductoai/docx/node.

registerPortableFonts()

Install the portable FaceSets from dir (defaults to the font package), plus the packaged pan-CJK fallback. Import from @reductoai/docx/node.

setFontCacheDir()

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

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

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

Render IR pages to PNG buffers. Fonts and images come from the IR + registry. Import from @reductoai/docx/node.