Why text extraction from PDF financial statements fails, and how to fix it
Extracting data from financial statement PDFs fails for predictable reasons: the PDF is a scan with no text, the table breaks across pages, descriptions wrap onto two lines, money in and out share a column, dates are ambiguous, or one file holds several statements. Most of these cannot be fully prevented — but every one of them can be caught, because a bank statement carries its own proof: the running balance.
The eight common failures
1. It is a scan, not a digital PDF
A scan holds images, so a text extractor finds nothing. Fix: OCR first — see scanned PDFs to Excel.
2. Pages are sideways or upside down
Common with scanned bundles. OCR on a sideways page returns little or nonsense. Fix: turn pages upright before reading; Caelum detects the angle and does this automatically.
3. The table breaks across pages
Headers repeat, “balance carried forward” lines appear, and a transaction can be split across the break. Fix: read the statement as one continuous table, ignoring repeated headers and carried-forward lines.
4. Descriptions wrap onto two lines
The second line looks like a new transaction with no amount. Fix: join continuation lines to the transaction above.
5. Money in and money out share one column
Some banks use signs, some a “CR”/“DR” suffix, some two columns. Card statements reverse the sense entirely. Fix: determine each line’s direction — and confirm it with the balance.
6. Dates are ambiguous
03/04 is 3 April in the UK and March 4 in the US; some statements omit the year. Fix: read dates in the statement’s own convention, and take the year from the statement period.
7. One PDF holds several statements
A year of statements, or several accounts, in one file. Merged into one table, the balances stop making sense. Fix: split the file into its statements first, by account and period.
8. The PDF is password-protected
Many banks encrypt statement PDFs. Fix: unlock with the password before reading; Caelum unlocks them on your computer before upload.
Catching what slips through
Even good extraction occasionally misreads a figure. The defence is a check, not more care:
- Walk the running balance from the opening balance; every printed balance should be reached. The first one that is not marks the problem row.
- Compare printed totals of money in and out, where the statement has them.
- Check opening against the previous closing when statements run in sequence.
Caelum runs these checks on every statement and flags the one, and the row, that needs a look. For a faint scan or an unusual layout, you can run it again with the more careful Precision model and pay only the difference.
Frequently asked questions
Can Python libraries do this? For clean digital PDFs, tools like pdfplumber or Camelot extract tables well. They do not do OCR, split bundles, interpret signs, or check balances — that part is yours to build.
What accuracy should I expect? Judge it by the balances, not a percentage: a statement that reaches every printed balance is right; one that does not tells you where it is wrong.