# Case study: pdfmake committed the broken PDF three times

> A new feature in pdfmake broke tables with cells that span rows, for four releases. The project's own example PDF showed it, and was regenerated and committed three times while the bug was live. Nothing compared it with the last good one. We replayed the commit with VisualCI.

Source: https://visualci.com/blog/pdfmake-case-study/

2026-12-04, Nathan Broadbent

[pdfmake](https://pdfmake.github.io) builds PDFs from a JSON description of the document, in Node and in the browser. Its repository has an `examples` folder: about 30 scripts that each write a PDF, from basic text to tables, columns and SVG. The PDFs are committed to the repository too, in `examples/pdfs/`.

That's most of a visual test suite already. What's missing is the comparison.

## The bug

On 20 February 2026, [d4aed28](https://github.com/bpampuch/pdfmake/commit/d4aed28) ("Implement snaking columns") added a long-requested feature: text that flows from one column into the next, like a newspaper. It changed how pdfmake decides where content goes on the page, and with it, how tables with cells that span several rows are laid out when the spanning cell is in the last column. The rows after it were pushed down, and a cell spanning three rows and three columns came apart from the rows it was meant to cover.

It shipped in 0.3.5 on 22 February and in 0.3.6, 0.3.7 and 0.3.8. A user reported it in April. It was fixed on 23 May by [1c803c4](https://github.com/bpampuch/pdfmake/commit/1c803c4) ("fixed table rowSpan cell height in last column"), released in 0.3.9: **four releases, three months**.

![Page 9 of the tables example with pdfmake 0.3.4, 0.3.5 and 0.3.9](https://visualci.com/blog/pdfmake-case-study/pdfmake-tables-p9.png)

## The PDF that showed it

The bug is in pdfmake's own `tables` example, on pages 3, 9 and 10. While it was live, the example PDFs were regenerated and committed three times: on 10 March, 17 March and 6 May ("refresh pdf examples"). We rendered page 9 of each of those committed files: all three are pixel for pixel the broken layout. The evidence sat in the repository for months. Nobody compared the new file with the old one, because nothing does that for PDFs in a code review: GitHub shows a binary file changed, and that's all.

## The replay

In our fork ([visualci-com/pdfmake](https://github.com/visualci-com/pdfmake)), a GitHub Actions job builds pdfmake from the commit, runs every example, and sends the PDFs to VisualCI. We pushed d4aed28's parent as the baseline and opened a pull request with d4aed28 on top.

VisualCI's build for that pull request, [build #3](https://app.visualci.com/visualci-com/pdfmake/builds/3):

- **`tables.pdf` changed, on pages 3, 9 and 10**, with each changed region marked. On pages 3 and 10 the text diff also shows the extra line the broken layout adds.
- **`snaking_columns.pdf` added**: the commit's own new example, which is the feature working.
- **29 unchanged**: every other example.

A reviewer sees the new feature and, next to it, the one thing it broke. We rejected the build with the reason attached.

Before building the story on it, we checked the cause by rendering, not by reading the code: built from source, d4aed28's parent renders the tables example exactly as 0.3.4 does, and d4aed28 exactly as the broken 0.3.5. The fix commit does the reverse.

![Page 3 of the tables example with pdfmake 0.3.4, 0.3.5 and 0.3.9](https://visualci.com/blog/pdfmake-case-study/pdfmake-tables-p3.png)

## What it takes

pdfmake already had everything but the comparison: the examples, a script per document, even the committed PDFs. The VisualCI setup is one shell script (build, run the examples, collect the PDFs) and one workflow step. It runs in about two minutes on GitHub's free runners.

## Try it

If your project writes PDFs in its tests or examples, that's your test suite. See [PDFs](https://visualci.com/docs/pdfs.md) and [GitHub Actions](https://visualci.com/docs/ci/github-actions.md).

<!-- Sources: fork https://github.com/visualci-com/pdfmake (PR #1); VisualCI builds #1 (baseline) and #3; release tags 0.3.5 to 0.3.9; committed tables.pdf at c443710, e9d4b6c and 2927f32. -->
