Problem
When a continuous section break switches from single-column to multi-column layout, Word balances the content across columns so they end at roughly the same height. Our current implementation fills column 0 completely before overflowing to column 1 (sequential fill).
Word behavior:
┌──────────────┬──────────────┐
│ Paragraph 1 │ Paragraph 3 │
│ Paragraph 2 │ Paragraph 4 │
└──────────────┴──────────────┘
Current behavior:
┌──────────────┬──────────────┐
│ Paragraph 1 │ │
│ Paragraph 2 │ │
│ Paragraph 3 │ │
│ Paragraph 4 │ │
└──────────────┴──────────────┘
Context
Multi-column layout rendering was added in PR #175. The paginator correctly handles column advancement when content overflows, but it doesn't balance columns for continuous section breaks. Balancing only applies to continuous breaks — nextPage section breaks fill columns sequentially (top-to-bottom, left-to-right) as we currently do.
Implementation Notes
Column balancing requires:
- Detect when a continuous section break ends a multi-column section
- Calculate total content height for that section's blocks
- Binary search or iterative approach to find the optimal split point where all columns end at roughly the same Y position
- Re-layout the section's content with the balanced split
Test file: examples/vite/public/continuous-columns-test.docx demonstrates the issue.
References
Problem
When a continuous section break switches from single-column to multi-column layout, Word balances the content across columns so they end at roughly the same height. Our current implementation fills column 0 completely before overflowing to column 1 (sequential fill).
Word behavior:
Current behavior:
Context
Multi-column layout rendering was added in PR #175. The paginator correctly handles column advancement when content overflows, but it doesn't balance columns for continuous section breaks. Balancing only applies to continuous breaks —
nextPagesection breaks fill columns sequentially (top-to-bottom, left-to-right) as we currently do.Implementation Notes
Column balancing requires:
Test file:
examples/vite/public/continuous-columns-test.docxdemonstrates the issue.References