Packages
What to install from npm, crates.io, and PyPI, and what each package does
BetterOffice provides DOCX, XLSX, and PPTX packages for JavaScript, Rust, and Python. Choose a runtime below, then select the packages for your file format.
| Runtime | Install | Guide |
|---|---|---|
| Browser, React, or Node | npm install @betteroffice/docx-react | JavaScript |
| Native Rust | cargo add betteroffice-docx | Rust |
| Python | pip install betteroffice-docx | Python |
Packages by format
| Format | npm | crates.io | PyPI |
|---|---|---|---|
| DOCX | @betteroffice/docx, @betteroffice/docx-react | betteroffice-docx | betteroffice-docx |
| XLSX | @betteroffice/xlsx, @betteroffice/xlsx-react | betteroffice-xlsx | betteroffice-xlsx |
| PPTX | @betteroffice/pptx, @betteroffice/pptx-react | betteroffice-pptx | betteroffice-pptx |
All three registries carry DOCX, XLSX, and PPTX. On npm, the core, React, and locale packages of all three formats are released together under one version. The font packages, the agent tools, the Rust crates, and the Python packages have their own versions; use the registry links for current releases.
VSDX is available from source with a browser demo. Its npm packages and Rust crates are not published.
Fonts
The font packages provide open, metric-compatible alternatives to common Microsoft fonts, plus Hebrew, Arabic, CJK, and international script coverage.
| Package | Contents |
|---|---|
@betteroffice/fonts | Carlito, Caladea, Liberation Sans/Serif/Mono, Gelasio, Comic Relief, Inter, Roboto, Source Sans 3, DM Sans, DM Serif Display, Open Sans, Montserrat, Poppins, Oswald, Heebo, Noto Hebrew/Arabic |
@betteroffice/fonts-cjk | Noto Sans SC/TC/JP/KR, Noto Serif SC |
@betteroffice/fonts-intl | Noto coverage for South and Southeast Asian, Armenian, Georgian, Ethiopic, Tibetan, Mongolian, Syriac, Thaana, Cherokee, and Tifinagh scripts |
@betteroffice/fonts-latin | Latin and Noto RTL font pack, installed with the manager |
For the DOCX editor, install @betteroffice/fonts and configure it before
mounting the editor:
import { configureDefaultFonts } from "@betteroffice/docx/layout";
import * as fonts from "@betteroffice/fonts";
configureDefaultFonts({ fonts });To host the font files on your own CDN, pass baseUrl alongside fonts. The
module provides the font manifest and is required with either asset location.
Install @betteroffice/fonts-cjk when you need Chinese, Japanese, or Korean text.
Install @betteroffice/fonts-intl for additional international script coverage.
@betteroffice/fonts-latin is installed automatically with @betteroffice/fonts.
All font packages are optional and must be installed explicitly.
For headless PPTX (openPresentation), pass the faces in fonts and
fallbackFonts; loadBundledFontBytes from @betteroffice/fonts returns a
bundled face's bytes.
Missing font bytes can cause fallback measurements and different pagination. See the language guides for font setup in other formats and runtimes.
Choose an API
- React editor: use a
-reactpackage for the toolbar, canvas, selection, and keyboard controls. The DOCX worker editor displays comment threads; host proposal review in its sidebar is opt-in. - Custom JavaScript UI: use a framework-free core for editing, display lists, and hit-testing.
- Native Rust: use a
betteroffice-docx,betteroffice-xlsx, orbetteroffice-pptxcrate. - Python scripts and services: use the corresponding package on PyPI.
- Individual engine components: use the parsing, editing, or rendering crates listed in the Rust guide.
Release notes and each package's changelog record shipped changes.
Visual fidelity results compare published packages and source builds with Microsoft Office on selected corpus files. The comparison harness describes the measurement method.