Skip to content

Commit 57aae08

Browse files
danmolitorclaude
andcommitted
0.10.4: four layout fixes (table headers, view-around-table, svg viewBox, marginTop auto)
Issue 4: <Table> with <Row header> starting low enough on a page that the header didn't fit before the page break inflated output to 3-5x the right page count, with header cells "doubling and sliding one column right" per page. layout_table now pre-checks header fit and page-breaks before laying out if needed; layout_table_row drops cell-overflow trial pages for header rows. Issue 3: A <View> wrapping a <Table> auto-grew to roughly the page height. measure_node_height had no arms for Table / TableRow so they fell into the generic column-summing branch (a 3-col row of 16pt cells measured to 48pt). Now delegates to the same resolve_column_widths + measure_table_row_height helpers layout_table uses. Issue 2: <Svg viewBox="..."> rendered content at raw viewBox coordinates and overflowed the display box. PDF emission now applies the SVG viewport algorithm with xMidYMid meet defaults (uniform min(sx, sy) scale + centering). Issue 1: marginTop / marginBottom: 'auto' on a child in a column-flex parent with fixed height now distributes slack to push the child to the bottom / center / etc., matching CSS spec and mirroring the existing flex-row cross-axis logic. Versions bumped to 0.10.4 across engine, server, rasterizer, python-sdk, and all twelve npm packages (cross-package pins updated, lockfiles regenerated, WASM rebuilt for all targets). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent a2333a9 commit 57aae08

33 files changed

Lines changed: 134 additions & 66 deletions

engine/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## [0.10.4] - 2026-06-05
4+
5+
### Fixed
6+
- `<Table>` with `<Row header>` no longer inflates page count 3–5× when starting low enough on a page that the header doesn't fit before the page break. The header loop had no pre-fit check (unlike the body loop), so when forced to lay out where it didn't fit, each header cell's inner View/Text triggered a widow/orphan page-break that `layout_table_row` then captured as a "trial" snapshot page. Each successive cell's snapshot accumulated one more cell of the in-progress row — the reporter's "doubled header sliding one column right per page" symptom. `layout_table` now page-breaks before laying out headers if they don't fit; header rows additionally drop any cell-overflow trial pages instead of committing them
7+
- A `<View>` wrapping a `<Table>` no longer inflates to roughly the page height. `measure_node_height` had no arms for `NodeKind::Table` or `TableRow`, so they fell through to the generic column-summing branch — a 3-column row of 16pt cells measured to 48pt instead of 16pt, and the wrapping View inherited the inflated value. Now delegates to the same `resolve_column_widths` + `measure_table_row_height` helpers `layout_table` already uses, so measurement matches what gets rendered
8+
- `<Svg width={W} height={H} viewBox="x y w h">` now scales content to fit the display box. `parse_svg`'s viewBox parameters were unused and the PDF emission's `cm` transform scaled by `element.width / display_width` (always 1.0), so paths rendered at raw viewBox coordinates and overflowed. PDF emission now implements the SVG viewport algorithm with `xMidYMid meet` as the default `preserveAspectRatio` (uniform `min(sx, sy)` scale + centering)
9+
- `marginTop` / `marginBottom: 'auto'` on a child in a column-flex parent with fixed height now pushes the child to the bottom / centers it / etc., matching CSS flex spec. The flex-row cross-axis already had auto-margin slack handling; the column branch of `layout_children` did not. Mirrors that block, ordered before `justify-content` so auto-margins consume free space first
10+
11+
### Internal
12+
- New `measure_node_height` arms for `NodeKind::Table` and `TableRow`, plus an auto-vertical-margin pass in `layout_children`'s column branch. SVG viewBox dimensions are plumbed through `DrawCommand::Svg`
13+
314
## [0.10.3] - 2026-05-28
415

516
### Fixed

engine/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

engine/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "forme-pdf"
3-
version = "0.10.3"
3+
version = "0.10.4"
44
edition = "2021"
55
description = "A page-native PDF rendering engine. Layout INTO pages, not onto an infinite canvas."
66
license = "MIT"

package-lock.json

Lines changed: 30 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cli/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## [0.10.4] - 2026-06-05
4+
5+
_Bump `@formepdf/core` to 0.10.4 — picks up four engine layout fixes (Table repeating-header page-count, View-around-Table auto-height, SVG viewBox scaling, column-axis `marginTop: 'auto'`)._
6+
37
## [0.10.3] - 2026-05-28
48

59
_Bump `@formepdf/core` to 0.10.3 — picks up the engine fix for `<Text style={{ width }}>` rendering at the parent's full width in a flex row._

packages/cli/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@formepdf/cli",
3-
"version": "0.10.3",
3+
"version": "0.10.4",
44
"description": "CLI for Forme PDF rendering engine — dev server with live preview and build command",
55
"type": "module",
66
"bin": {
@@ -14,7 +14,7 @@
1414
"dist"
1515
],
1616
"dependencies": {
17-
"@formepdf/renderer": "0.10.3",
17+
"@formepdf/renderer": "0.10.4",
1818
"chokidar": "^4.0.0",
1919
"ws": "^8.18.0",
2020
"open": "^10.1.0"

packages/core/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## [0.10.4] - 2026-06-05
4+
5+
### Fixed
6+
- WASM rebuilt against engine 0.10.4, picking up four layout fixes:
7+
- `<Table>` with `<Row header>` no longer inflates page count 3–5× when the header doesn't fit before a page break (silent — produced "doubled and sliding column" header artifacts)
8+
- A `<View>` wrapping a `<Table>` no longer auto-grows to roughly the page height — Table/TableRow now have explicit measurement arms that match what `layout_table` actually renders
9+
- `<Svg viewBox="…">` content now scales to the display box via the SVG viewport algorithm (`xMidYMid meet` default) instead of rendering at raw viewBox coordinates and overflowing
10+
- `marginTop: 'auto'` on a child in a column-flex parent with fixed height now pushes the child to the bottom, matching the cross-axis behavior already shipped for flex rows
11+
312
## [0.10.3] - 2026-05-28
413

514
### Fixed

packages/core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@formepdf/core",
3-
"version": "0.10.3",
3+
"version": "0.10.4",
44
"description": "WASM-powered PDF rendering engine for Forme",
55
"type": "module",
66
"main": "./dist/index.js",
@@ -59,7 +59,7 @@
5959
"prepublishOnly": "npm run build && ./scripts/assert-tarball.sh"
6060
},
6161
"dependencies": {
62-
"@formepdf/react": "0.10.3"
62+
"@formepdf/react": "0.10.4"
6363
},
6464
"peerDependencies": {
6565
"react": "^18 || ^19"

packages/hono/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## [0.10.4] - 2026-06-05
4+
5+
_Bump `@formepdf/core` to 0.10.4 — picks up four engine layout fixes (Table repeating-header page-count, View-around-Table auto-height, SVG viewBox scaling, column-axis `marginTop: 'auto'`)._
6+
37
## [0.10.3] - 2026-05-28
48

59
_Bump `@formepdf/core` to 0.10.3 — picks up the engine fix for `<Text style={{ width }}>` rendering at the parent's full width in a flex row._

packages/hono/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@formepdf/hono",
3-
"version": "0.10.3",
3+
"version": "0.10.4",
44
"description": "PDF middleware and responses for Hono — works on Workers, Deno, Bun, Node",
55
"type": "module",
66
"main": "./dist/index.js",
@@ -13,9 +13,9 @@
1313
"dist"
1414
],
1515
"dependencies": {
16-
"@formepdf/react": "0.10.3",
17-
"@formepdf/core": "0.10.3",
18-
"@formepdf/templates": "0.10.3"
16+
"@formepdf/react": "0.10.4",
17+
"@formepdf/core": "0.10.4",
18+
"@formepdf/templates": "0.10.4"
1919
},
2020
"peerDependencies": {
2121
"hono": ">=4.0.0"

0 commit comments

Comments
 (0)