← All posts

Tables that fall apart when you convert PDF to Word

Why a PDF table can reach Word split in two, with its labels piled up or with rows that keep growing, what we do to avoid it and how to fix it by hand if you need to.

Hernán Díaz Rodríguez··6 min read

You convert a report from PDF to Word, open it, and the table looks wrong. Part of it sits inside the table and part outside, the header takes up half a page, or a table that fitted on one page now runs over two. Tables are what breaks most often when you convert a PDF. Here is why it happens, what our converter does to avoid it, and how to fix the table by hand in Word if you have to.

A PDF has no tables

In Word, a table is a table: it has rows, columns and cells. A PDF has none of that. It has pieces of text placed at coordinates, some thin lines and a few coloured rectangles. We humans look at it and see a table. The converter has to work that out too. It must guess where the table starts and ends, how many columns it has and which text goes in each cell.

A table with all its lines is easy. The trouble starts with tables that have few lines, only background colours or a header with several levels. These are the cases we see most.

1. The table stops at the coloured columns

Conversion stuck to the colour High Low Div. 51.48 45.79 0.26 49.24 35.30 0.26 42.67 34.89 0.28 46.74 39.99 0.28 Quarter First Second Third Fourth Total 1.08 The whole table Quarter High Low Div. 51.48 45.79 0.26 First 49.24 35.30 0.26 Second 42.67 34.89 0.28 Third 46.74 39.99 0.28 Fourth Total 1.08
A made-up table for the example. On the left, the conversion only treats the shaded columns as the table and leaves the quarters and the total out. On the right, the whole table.

What goes wrong. In many reports the figure columns have a background colour and the label column has none. A converter that looks for rectangles and lines sees a table where the colour is and leaves the labels out. The labels end up piled below or beside it, as loose text. The same happens to a totals row that has no line under it.

What we do. We treat the background colour as a clue, not as the edge of the table. If text lines up with the rows right next to the shaded area, it belongs to the table. A shaded row below the last line, such as a total, belongs to it too.

How to fix it by hand. If you get this, it is usually quickest to rebuild the table. Select the labels and the figures. Go to Insert → Table → Convert Text to Table and pick tabs as the separator. If the labels landed somewhere else, copy that column into the new table.

2. A header with sub-columns becomes one row for everything

One row for everything Criterion Tenderers 1 2 3 4 Header with sub-columns Criterion Tenderers 1 2 3 4
On the left, the two-level header squeezed into one row: the numbers don't fit and the last one drops to a new line, so the row grows. On the right, “Tenderers” is a merged cell over four sub-columns.

What goes wrong. This is common in minutes, quotes and scoring tables. There is a wide cell at the top, like “Tenderers”, and a sub-column under it for each one (1, 2, 3, 4…). In the PDF, the line between the two levels sometimes doesn't run all the way across. If the converter misses it, it merges both levels into a single row. The sub-column numbers get squeezed, one drops to a new line and the whole row gets taller.

What we do. A header cell that ends exactly where another one starts is not on its own. It is part of a row of sub-columns. That tells us the sub-columns are a row of their own and that the cell above spans several of them.

How to fix it by hand. Insert a row above the numbers. Select the cells in that row that go under “Tenderers” and use Layout → Merge Cells. Then type or paste the group title there.

3. Rows that grow a little at a time

What goes wrong. The table looks right, but every row is slightly taller than in the PDF. Two or three points per row go unnoticed, but in a forty-row table they add up to more than half a page. Whatever was under the table jumps to the next page, and a one-page document becomes two.

Why. In Word, a row grows to fit its content. If the paragraph in a cell asks for a bit more room than the row had in the PDF, because of the space before the paragraph or the line spacing, Word makes the row taller.

What we do. We work out how much room the text in each cell needs. If a one-line cell would need more than its row's height, we take space off the top until it fits. The row keeps its height.

How to fix it by hand. Select the table and open Table Properties → Row. Set the height to Exactly and the value you want. Careful: with Exactly, text that doesn't fit gets cut off. The other option is to leave it at At least and set the space before and after the paragraph to zero (Home → Paragraph).

4. Text that slips into the next row

What goes wrong. A line of text that touches a row line in the PDF can end up in the row below. For example, the last line of a cell. One cell is left empty and the one under it has an extra line.

What we do. We use the text's baseline, where the letters sit, and not only its box. If the letters sit on the row line or above it, the text belongs to the row above.

How to fix it by hand. Cut the line and paste it into its cell. If it happens in many rows, it can be quicker to turn the table into text and back into a table (Layout → Convert to Text, then the other way round).

What to check after converting

The limits

If the table is an image, for example in a scanned document or a screenshot pasted into the PDF, there is no text to place: it has to be read with OCR first. We cover that in converting a scanned PDF to Word. And some tables not even a person could rebuild without hesitating, with cells that overlap or rotated text. For those, our aim is that every word stays where it was, even if the table structure is not perfect.

We measure every change on hundreds of documents so that fixing one case doesn't break others. We explain how in how we measure PDF to Word. For example, in one of our test reports, with a shaded table like the one above, the share of words in place went from 37% to 88% with these fixes.

If you have a table that falls apart, try PDF to Word. No sign-up needed. Each conversion runs in an isolated container and files delete themselves within an hour. We only keep a document if you send it to us so we can improve how it comes out.

Comments or ideas? Message me on LinkedIn. LinkedIn →