BetterOffice

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.

RuntimeInstallGuide
Browser, React, or Nodenpm install @betteroffice/docx-reactJavaScript
Native Rustcargo add betteroffice-docxRust
Pythonpip install betteroffice-docxPython

Packages by format

Formatnpmcrates.ioPyPI
DOCX@betteroffice/docx, @betteroffice/docx-reactbetteroffice-docxbetteroffice-docx
XLSX@betteroffice/xlsx, @betteroffice/xlsx-reactbetteroffice-xlsxbetteroffice-xlsx
PPTX@betteroffice/pptx, @betteroffice/pptx-reactbetteroffice-pptxbetteroffice-pptx

All three registries carry DOCX, XLSX, and PPTX. The core, React, and locale packages for each format are released together. Version numbers differ between formats and registries; use the registry links for current releases.

VSDX is available from source with a browser demo. Its npm packages and Rust crates are not yet published.

Fonts

The font packages provide open, metric-compatible alternatives to common Microsoft fonts, plus Hebrew, Arabic, and CJK coverage.

PackageContents
@betteroffice/fontsCarlito, 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-cjkNoto Sans SC/TC/JP/KR, Noto Serif SC

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. Both packages are optional and must be installed explicitly.

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 -react package for the toolbar, canvas, selection, keyboard controls, and review UI.
  • Custom JavaScript UI: use a framework-free core for editing, display lists, and hit-testing.
  • Native Rust: use a betteroffice-docx, betteroffice-xlsx, or betteroffice-pptx crate.
  • 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.

On this page