Skip to content

v0.10.4

Choose a tag to compare

@danmolitor danmolitor released this 05 Jun 15:11
· 158 commits to main since this release

Forme 0.10.4

Four layout bug fixes, all user-reported. The
table header one is silent — upgrade if you use
<Row header>.


Fixed

Tables with <Row header> no longer inflate
page count 3–5×

When a table started low enough on a page that
the header didn't fit before a page break, the
engine emitted multiple near-duplicate pages —
the same body rows repeated, with the header
visibly "doubling and sliding one column to the
right" on each successive page. A 24-row,
5-column table produced 8 pages where the same
content without a header row produced 3.

// Before: 8 pages, garbled doubled headers
// After:  3 pages, correct

  
  
    {headerCells}
    {rows.map(r => {...})}
  

<View> wrapping a <Table> no longer
auto-grows to roughly the page height

measure_node_height had no handler for
Table or TableRow, so they fell into a
generic path that summed cell heights instead
of taking the max — a 3-column row of 16pt
cells measured to 48pt, and any wrapping
<View> inherited that inflation. Now
delegates to the same helpers layout_table
already uses, so measurement matches what
renders.

<Svg viewBox="…"> content scales to fit
the display box

SVG paths previously rendered at raw viewBox
coordinates and overflowed — the viewBox
parameters were parsed but unused, and the
PDF scale was always 1.0. Now implements the
SVG viewport algorithm with xMidYMid meet
as the default preserveAspectRatio (uniform
min(sx, sy) scale + centering).

// Before: paths spilled outside the 200×80 box
// After:  scaled to fit

  …paths…

marginTop: 'auto' works in column layouts

Previously a no-op in flexDirection: 'column'
parents — only the horizontal version worked.
Now distributes slack the same way: top-only
pushes to bottom, both autos center, bottom-only
carries forward. Auto margins consume slack
before justifyContent, per the CSS spec.

// "Sign here" now sits at the bottom, not the top

  
    Sign here
  

Upgrade

npm install @formepdf/core@0.10.4 @formepdf/react@0.10.4
# plus any of: cli renderer hono next mcp resend sdk tailwind templates

Other consumers:

  • Rust: cargo add forme-pdf@0.10.4
  • Python: pip install formepdf==0.10.4
  • Go: go get github.com/formepdf/forme-go@v0.10.4
  • Docker: docker pull formepdf/forme:0.10.4
    docker pull formepdf/rasterizer:0.10.4
  • VS Code: update "Forme PDF Preview" in the
    Extensions panel