Extraction

How to Extract Transactions from a PDF Bank Statement

Understand how transaction extraction works inside a PDF statement, what fields to capture and how to validate the result before it reaches a ledger.

By FlowParsePublished 8 min read

Extracting transactions from a PDF is not the same as reading its text. A statement can contain the right words in the right order and still produce the wrong table if the rows are reconstructed incorrectly.

This article explains the mechanics: what a PDF actually stores, how a parser turns words into rows, which fields matter, and how to validate extraction before the data reaches a ledger.

Two kinds of PDF, two extraction paths

A digital statement stores characters and positions. Extraction can read them directly. A scanned statement stores images, so recognition has to happen first. Some PDFs have an OCR text layer added by the scanner, which behaves like a digital file but inherits OCR errors.

The first step in any extractor is deciding which situation it is dealing with. Treating a scan as a digital file produces an empty result; treating a clean digital file as a scan wastes time and reduces accuracy.

A PDF is a page, not a table

Under the surface, a statement is a set of text runs placed at coordinates. There is no column object and no row object. The visual table is an emergent effect of alignment, lines and whitespace.

To reconstruct a table, an extractor builds lines from words with similar vertical positions, finds the header and column anchors, and assigns each word to a field based on its horizontal position. Multi-page statements require repeating that process per page and stitching the rows together.

The fields worth extracting

Transaction fields
FieldWhy it matters
Posting dateThe primary date for sorting and period filtering
Value dateUsed by some reconciliation and settlement processes
DescriptionThe audit trail and the main input for coding
ReferenceMatches the row to an invoice, cheque or transfer
Debit / CreditDirection, kept separate to avoid sign ambiguity
BalanceValidates the running total
CurrencyNeeded for multi-currency accounts

Why multi-line descriptions break naive parsing

A merchant description often wraps onto a second line. If the parser treats every line as a transaction, one payment becomes two rows and every later row shifts. If it drops continuation lines, the description loses the part that identifies the merchant.

The correct behaviour is to detect that a line has no date and no amount, then attach it to the preceding transaction. The same rule prevents page headers from becoming rows.

Validation is part of extraction

These checks catch the failures that a visual skim misses: a decimal point read as a comma, a page missed entirely, or a transaction split across two rows.

  • Opening balance plus credits minus debits should equal the closing balance.
  • Consecutive running balances should agree with the amounts between them.
  • Every row should have a date, a description and at least one amount.
  • Duplicate detection should compare date, description and amount, not just one field.
  • Unresolved lines should be reported, not silently discarded.

Manual extraction versus a parser

Manual extraction is viable for one short, digital statement. Select the table, paste it, repair the columns and reconcile. It becomes expensive when statements are long, scanned or recurring.

A parser automates the geometry and the field assignment, but it cannot remove the review step. The useful question is not "is it automatic?" but "does it show me what it was unsure about?". FlowParse's PDF transaction extractor exposes the ledger, the reconciliation and the review reasons before export.

What to do with the extracted rows

Export to XLSX when a person will analyse or annotate the data, or to CSV when a system will import it. Keep the original PDF with the export so the source can be checked later. If you are converting statements for clients, read Bank statement converter for accountants.

Frequently asked questions

Can I extract transactions from a scanned statement?

Yes, after OCR. The extractor needs recognised text with positions, which OCR provides. Expect more review flags than a digital statement.

Why does a table have more rows than the statement?

A wrapped description or a repeated page header was treated as a new row. A parser that groups lines by date and amount avoids this.

Should I extract the running balance?

Yes, when the statement prints one. It is the cheapest way to validate the extraction and to spot a missing or duplicated transaction.

Does extraction change the original PDF?

No. The PDF is stored privately and the extracted rows are saved separately, so the source remains available for comparison.

Read less, convert more

Put the guide into practice on a real statement. The Free plan includes 3 processed pages per month, with no card required.