Skip to content

DOCX: table-cell rows render about 4.3pt shorter than Word #404

Description

@developer0hye

Summary

DOCX table-cell rows render materially shorter than Microsoft Word because office2pdf only partially reproduces Word's cell-margin, minimum-row-height, and vertical-distribution model. This is not a font-substitution defect: Malgun Gothic is available and embedded, and horizontal glyph advances match the Word PDF.

The repository-owned business corpus now provides two reproducible cases. The long research table accumulates the per-row error enough to move six additional rows onto page 1.

Reproduction

target/release/office2pdf \
  tests/golden_mocks/business/sources/docx/10_research_report_ko.docx \
  -o /tmp/10_research_report_ko.pdf

pdftotext -bbox \
  tests/golden_mocks/business/expected/docx/10_research_report_ko.pdf -
pdftotext -bbox /tmp/10_research_report_ko.pdf -

Source: 10_research_report_ko.docx
Native Word PDF: 10_research_report_ko.pdf

Measurements on current main

Audited at dc905e9a46ac84f67bfb01744b83f1c25b7d2400:

Measurement Word GT office2pdf Delta
Research monthly-row pitch 25.440 pt 21.136 pt -4.304 pt/row
Last row on page 1 2025-11 2026-05 6 extra rows
Page-1 150-DPI diff at 5% fuzz 268,257 px (0.123339)

The source cells use 3.5 pt top/bottom margins, 1.5 pt paragraph-after spacing, and 9.5 pt text. office2pdf preserves those parsed properties but the resulting row track remains too short.

Expected

Single-line table rows match Word's row track after cell margins, paragraph spacing, the font line box, and Word's minimum/vertical-distribution rules are applied.

Actual

Rows are about 4.3 pt shorter in the research table, materially changing within-page pagination.

Visual checklist

  • Both pages, all 30 monthly rows, the repeated header, text, fills, borders, alignment, and bold emphasis are preserved.
  • No rotation, flip, clipping, or missing content was found.
  • The unresolved defect is row height; the independent first-heading offset is tracked in DOCX: first-paragraph space-before collapses at page top #420.

Related: #385, #396, #420

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions