Tabula is a free tool for extracting tables from PDFs into CSV or spreadsheet files, and it works on text-based PDFs where the text can be selected. It does not work on scanned PDFs. The extraction is a draft until every cell has been checked against the source table.
What you need
- Tabula installed with Java
- A text-based PDF containing a table
- A spreadsheet app to open the exported CSV
Step 1: Import and select the table
Open Tabula, import the PDF, and drag a selection over the table you want, or use Auto Detect Tables to let Tabula find it.
Step 2: Preview and export
Choose Preview and Extract Data, check the preview table looks right, then select CSV from the export menu and save the file.
Step 3: Check the CSV against the PDF
Open the CSV in a spreadsheet and compare it cell by cell with the PDF table, checking row count, column count and every number.
Worked example: synthetic Tabula extraction of a budget table
The table below is a synthetic example. It shows the expected result of extracting a table; no table was extracted.
| Check | PDF table | CSV export |
|---|---|---|
| Rows | 12 | 12 |
| Columns | 4 | 4 |
| Numbers matching | 48 of 48 | Pass |
| Headers matching | 4 of 4 | Pass |
Expected result (UNTESTED). the CSV holds 12 rows and 4 columns, all 48 numbers match the PDF table and all 4 headers match. Use the data only after this cell-by-cell check. This check was not run live; the table shows the expected result for the synthetic example.
Limits
- Tabula only works on text-based PDFs; it cannot detect a scanned PDF document.
- Tabula does not work well on multi-line rows or merged cells.
- For a batch of similar documents, the tabula-extractor command line tool can run the same extraction repeatedly.
