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

# Overview

Edit, render and redline Word documents in Node and the browser, without Word, LibreOffice or a server.

## What you can do

* **Edit a document with an Office.js API.** `WordDocument` follows the Word JavaScript API (`Word.Document`, `Paragraph`, `Range`, `Table` …). Edits apply at once: there is no `Word.run`, `load` or `sync`.
* **Convert .docx to PDF or PNG.** The layout engine is measured against Microsoft Word, page by page.
* **Redline.** Make tracked changes and comments, accept or reject them, and compare two documents like Word's *Compare*.
* **Show and edit documents in a page.** Use one call for a full editor UI, or build your own UI on the canvas renderer.

## The packages

| Package | Use it for |
| - | - |
| `@reductoai/docx` | The engine: parse, edit (`WordDocument`), layout, PDF, PNG, CLI |
| `@reductoai/docx-editor` | A Word-like editor for the browser: toolbar, pages, review margin. Vanilla, React and Svelte |
| `@reductoai/portable-fonts` | Metric-compatible open fonts (Carlito for Calibri, Liberation for Arial and Times …) |
| `@reductoai/viewer` | Canvas painting of laid-out pages for a read-only viewer. See [Canvas viewer](https://docs.reducto.ai/office/docx/ui/canvas-viewer.md) |

## Entry points

`@reductoai/docx` has one entry point for each runtime. Use the correct one: the Node entry point reads files and loads native modules, so a browser bundle must not import it.

| Import | Runtime | Gives |
| - | - | - |
| `@reductoai/docx/node` | Node | `WordDocument` with `open(path)`, `save(path)`, `toPdf()`, `toPng()`. Installs the layout host and system fonts |
| `@reductoai/docx/browser` | Browser | `WordDocument` with `toPdf()`, `browserLayoutHost`, `layoutDocxInBrowser`, font providers |
| `@reductoai/docx/officejs` | Both | OfficeJS only. Edit bytes in, bytes out. No layout, no fonts |
| `@reductoai/docx` | Both | Low-level: `parseDocx`, the layout IR types. Layout is `runPipeline` (Node) or `layoutDocxInBrowser` (browser) |
| `@reductoai/docx/pdf` | Both | `renderPdfBytes(ir, registry)` |
| `@reductoai/docx/editor` | Both | The headless editor kernel (`SessionEditorHost`) |

## Where to go next

* New to the library: [Installation](https://docs.reducto.ai/office/docx/getting-started/installation.md), then [Office.js in Node](https://docs.reducto.ai/office/docx/js-api/node.md).
* You only need a PDF: [PDF](https://docs.reducto.ai/office/docx/conversion/pdf.md).
* You review contracts: [Redlining](https://docs.reducto.ai/office/docx/recipes/redlining.md).
* You need a UI: [Choose a UI layer](https://docs.reducto.ai/office/docx/ui/choose-a-layer.md).
* You look up a member: the [API reference](https://docs.reducto.ai/office/docx/api/word-document.md).
* You come from 0.0.x: [Migrate to 0.1.0](https://docs.reducto.ai/office/docx/getting-started/upgrading.md).
