Guide
Why converting a PDF table to CSV is harder than it looks
Updated
The frustrating thing about this problem is that the table is obviously there on the screen. Understanding why the computer cannot see it makes the rest of the subject straightforward.
Question 1
Open the PDF and try to select a line of text. What happens?
This one test separates the three fundamentally different cases, and it takes five seconds. Everything downstream depends on the answer.
Email me this result
We will send you these figures and a link back to them. One email, nothing else unless you tick the box.
There is no table in the file
A PDF describes where characters and lines go on a page. In general it does not record that characters form a cell, cells a row, or rows a table.
So every conversion is inference. The tool looks at positions and at any ruling lines and reconstructs a grid that was never stored. Two files that look identical can have completely different underlying structure, which is why one converts perfectly and the next one does not.
The three cases
A text layer with a table: the characters are present and only the structure has to be inferred. This is the good case.
A scanned image: there are no characters at all, only pixels, and optical character recognition has to invent them before anything else can happen.
A tagged PDF: the file carries semantic structure describing headings, tables and reading order. This is the best case and it is rare outside documents produced to an accessibility standard.
Why accessibility and extraction are the same problem
A screen reader and a converter are both trying to recover meaning from a file that records appearance. What defeats one defeats the other.
So gov.uk's accessibility guidance, though written for another purpose, is a useful diagnostic. A scanned document cannot be searched or read by a screen reader: exactly what makes it unconvertible.
Its note that PDF and PDF/A cannot be made fully accessible to all assistive technology users explains why PDF extraction is unreliable in general, not only sometimes.
The question to ask before converting anything
Does the source data exist in a machine-readable form? A PDF was generated by something, and that something had the data in a database, a spreadsheet or a report.
Asking for a CSV takes one email and succeeds more often than people expect, particularly with a supplier, a bank or a public body. Every hour spent on extraction is an hour spent recovering something that already exists somewhere in a better form.