Skip to content

feat(html): floor a text document's page box at one page height - #657

Merged
andiwand merged 2 commits into
mainfrom
feat/text-page-min-height
Aug 6, 2026
Merged

feat(html): floor a text document's page box at one page height#657
andiwand merged 2 commits into
mainfrom
feat/text-page-min-height

Conversation

@andiwand

@andiwand andiwand commented Aug 6, 2026

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

A text document renders as a single .odr-page-outer that grows with its content, so TextHtmlFragment discarded the page height outright. A document shorter than one page therefore came out as a sliver of white rather than a page — visible now that the downstream apps paginate.

The height now floors the box instead of being dropped:

- width:8.2681in;
+ width:8.2681in;min-height:11.6929in;

Anything longer than a page is unaffected, since min-height can only ever be below the content height there. The other frontends are untouched — slides, drawing pages and PDF pages already emit both dimensions from their real page geometry.

New translate_outer_flowing_page_style keeps the "this box flows past its page" rule in document_style.cpp next to its fixed-size sibling, rather than as a page_layout.height = {} mutation at the call site.

Verification

  • New html_document_style unit tests cover the fixed/flowing/missing-height cases.
  • End-to-end on odr-public/odt/empty.odt with text_document_margin = true: emits width:8.2681in;min-height:11.6929in;.
  • HtmlOutputTests for odt/docx pass. No reference-output regen neededtext_document_margin defaults to false, and no committed reference for a text document contains a page box (only odg/odp/ppt/pptx do, and those paths are unchanged).

A text document renders as a single box that grows with its content, so a
document shorter than a page produced a sliver of white instead of a page.
The page height was discarded outright; it now floors the box as a
`min-height`, which leaves anything longer than a page untouched.

Only affects `text_document_margin`, so the reference outputs — generated
with the default config, which draws no page box for text documents — are
unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CebbfAJfN4veeUPJXSqqY8
Comment thread src/odr/internal/html/document_style.hpp Outdated
@andiwand
andiwand enabled auto-merge (squash) August 6, 2026 17:48
@andiwand
andiwand disabled auto-merge August 6, 2026 18:26
@andiwand
andiwand merged commit f2795f9 into main Aug 6, 2026
17 of 22 checks passed
@andiwand
andiwand deleted the feat/text-page-min-height branch August 6, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant