Download Latest Version 9.9.0 source code.zip (92.8 MB) Google Add to Preferred Sources
Home / 9.9.0
Name Modified Size InfoDownloads / Week
Parent folder
9.9.0 source code.tar.gz 2026-10-07 92.1 MB
9.9.0 source code.zip 2026-10-07 92.8 MB
README.md 2026-10-07 10.8 kB
Totals: 3 Items   185.0 MB 0

What's Changed

New: docx/layout — lay out documents as Word does

A new docx/layout entry point that works out where everything lands on the page, the way Word does. It writes the page numbers of tables of contents, page references (including \p and their own formats), PAGE/SECTION fields and caption numbers (SEQ) "clean", so Word opens the document without asking to update fields. It can read an existing .docx (to fill in a template's page numbers or check Word's own pages), and it returns the pages of a document and what is on each. Where it meets something it doesn't follow yet, it stops and says so, or it makes a best guess if you ask it to.

What it covers:

  • Text measurement: measures text with Pretext in the page's fonts, using Word's width tables, the font files you give it, fonts the document embeds and Office's own fonts. Handles italics, the bold Word makes itself, kerning, ligatures, and letters a font lacks. Supports Greek, Cyrillic, Vietnamese, Latin Extended, Chinese, Japanese, Korean, Thai, Arabic and right-to-left text, plus East Asian font hints and high ANSI fonts.
  • Lines and paragraphs: makes each line as tall as its fonts' ascents and descents, with pictures on the baseline. Squeezes the spaces of justified and distributed lines, and covers paragraph borders, auto and contextual spacing, and indents in characters and lines. Also covers tabs (decimal tabs and tabs past the margin), soft hyphens, hyphenation, hidden text and marks, tracked changes, superscript, small caps, emphasis marks, run borders, fitted text, phonetic guides and drop caps.
  • Lists: numbers lists and places their numbers as Word does, including bordered and Word 6 list numbers and list styles.
  • Tables: sizes tables given no widths (autofit), widens columns for long words, and handles merged cells and tables inside cells. Breaks rows across pages, repeats header rows, and covers set row heights, borders that meet and space between cells. Also covers table style parts, text running up or down cells, deleted rows, floating tables, and tables a share of the page wide.
  • Sections, columns and page numbers: lays out columns of different widths and evens them out before continuous section breaks. Covers next-column sections, kept paragraphs taller than a column, gutters and booklets, and page numbers in every format, with chapter numbers and restarts.
  • Footnotes and endnotes: numbers and places them, continues them across pages, and lays them out in columns, table rows and kept paragraphs. Also covers separators and continuation separators, and endnote pages.
  • Drawings and frames: wraps text around pictures, shapes and floating tables, including drawings that overlap. Covers text frames, VML text boxes, shapes, objects and pictures, and header pictures.
  • Equations: lays out linear and built-up equations and follows the document's math settings. Covers accents, limits, brackets, scripts and pre-scripts, phantoms, boxes and equation arrays.
  • East Asian layout and compatibility: covers document grids, text running down the page, Japanese line rules, compressed punctuation and grid indents. Supports compatibility modes 11, 12 and 14, suppressTopSpacing, useFELayout, HTML divisions, and imported documents (w:altChunk).
  • Verified against Word: layout probes and Word's PDFs of them are kept in scripts/layout-probes, and every line of each demo is checked against Word's own output.
All layout PRs [#3591], [#3592], [#3593], [#3595], [#3596], [#3600], [#3602], [#3603], [#3604], [#3605], [#3606], [#3607], [#3608], [#3609], [#3610], [#3611], [#3612], [#3613], [#3614], [#3615], [#3616], [#3617], [#3618], [#3619], [#3620], [#3621], [#3622], [#3625], [#3626], [#3627], [#3628], [#3629], [#3630], [#3631], [#3632], [#3633], [#3634], [#3635], [#3636], [#3637], [#3638], [#3639], [#3640], [#3641], [#3648], [#3649], [#3650], [#3651], [#3652], [#3653], [#3654], [#3655], [#3656], [#3658], [#3659], [#3660], [#3661], [#3662], [#3663], [#3664], [#3665], [#3666], [#3667], [#3668], [#3669], [#3670], [#3671], [#3672], [#3673], [#3674], [#3675], [#3676], [#3677], [#3678], [#3679], [#3680], [#3681], [#3682], [#3683], [#3684], [#3685], [#3686], [#3687], [#3688], [#3689], [#3690], [#3700], [#3701], [#3702], [#3703], [#3704], [#3705], [#3706], [#3707], [#3708], [#3709], [#3710], [#3711], [#3712], [#3723], [#3724], [#3725], [#3726], [#3727], [#3728], [#3729], [#3730]

Other changes

New Contributors

Full Changelog: https://github.com/dolanmiu/docx/compare/9.8.1...9.9.0

Source: README.md, updated 2026-10-07