A user sent us a slide exported to PDF. It held about the simplest table there is: three rows, three columns, a thin border, one short word in every cell. Anyone would call it a 3×3 table at a glance.

Papaya PDF called it 6×9: fifty-four cells, forty-five of them empty slivers squeezed between the real ones. Every real cell had a thin blank strip on its left, its right and above it. Editing it would have been miserable.

This post covers what the PDF actually contained, why our detector read it that way, and the one-line rule that fixed it.

Tables are drawn, not stored

As we wrote in how to edit a table in a PDF, a PDF has no table object. It has drawing instructions: put these characters here, draw a line from there to there, fill this rectangle. To recover a table, Papaya PDF collects every horizontal and vertical edge drawn on the page and looks for a grid where those edges meet.

That works well because borders are usually the most reliable evidence on the page. A ruled table's lines are where its columns and rows begin and end.

What was hiding in the cells

When we listed every drawing instruction on the slide, the visible borders were all there. So was something else: inside each cell, the exporting app had drawn a second, smaller rectangle and filled it with a colour that was fully transparent.

You cannot see these boxes. They paint nothing. They are probably text-frame bounds that the presentation app writes out with its layout, harmless in any PDF viewer.

To a grid detector, though, a rectangle is four edges, whatever its colour. Each invisible box added a left edge, a right edge and a top edge a few points inside the real border. Those extra edges lined up from cell to cell, which is exactly what a grid detector rewards. The result was a column boundary just inside each real one, a row boundary just below each real one, and a 6×9 table.

The fix: ink, not geometry

The rule is now that geometry only counts as a table line if it leaves ink on the page. A shape whose fill and outline are both fully transparent contributes no edges at all.

Two details made this less obvious than it sounds:

  • Shapes with no paint are already handled elsewhere. When a PDF defines a shape without filling or stroking it, the shape is either discarded or becomes a clipping region, so it never reaches the table detector. The transparent boxes were different: they really were filled, just with paint you cannot see.
  • Thin filled rectangles still count. Many generators draw table borders as long, thin filled rectangles rather than strokes. They are ink, so they stay.

With the invisible boxes ignored, the same slide lifts as three rows by three columns, every cell holding its word, and the grid lands exactly on the drawn borders.

A cousin: drawings that look like grids

While checking the fix against our test documents, we fixed a related false positive. Architectural drawings are full of long straight lines that cross at right angles: walls, dimension lines, door frames. A wall section or a door elevation can form a perfectly ruled grid, and a few callout labels scattered across it look like table cells.

Real tables read across. Even a mostly blank fill-in form has a header row of column names or a few rows of labels and values side by side. Drawing callouts almost never do: they sit about one to a row. So a ruled grid is no longer lifted automatically when its text covers under 30% of it and almost never sits side by side in a row. Schedules on those same drawings, such as door and window schedules, are full of rows of text and still lift as tables.

What we take from it

Neither bug came from a clever heuristic going wrong. Both came from treating something on the page as evidence of a table when it was not: a box nobody can see, and lines that are walls rather than borders. The fix in each case was to ask what a person looking at the page would count, and to make the engine count the same thing.

If Papaya PDF splits a table you can plainly see, or finds a table where there is none, tell us. Cases like this one are how the detector gets better.