Skip to main content
Skip to content
AI

PDF Statement OCR in 2027: Check Minus Signs, Columns and Balances

DN’s clean synthetic OCR run preserved all twenty checked amount cells. Separate deliberate transcript changes show why missing signs, reversed columns and offsetting errors require row-level checks.

A sapphire scanning plane crosses two cream paper strips beside a small displaced coral dash and amber alignment guides.
Reading options: audio, text size & sections

DECENTRALISED NEWS · DOCUMENT EVIDENCE · 2027 GUIDE

A statement can contain all the right digits and still be reconciled incorrectly. A debit may lose its minus sign. A parenthesized amount may be treated as positive. A correctly recognized number may be assigned to the money-in column when it belongs under money out. Before an agent summarizes the result or proposes ledger entries, those interpretations need to be checked against the page.

Compare the source location, the extracted spelling and the accounting direction separately. Then reconcile both individual rows and the closing balance. This guide uses an original fictional statement, an actual local OCR run and deliberately altered transcript exercises so that the observations can be reproduced without customer records.

Evidence checked: 29 November 2026. The 2027 date is the guide’s editorial edition and the statement period is invented. DN ran Tesseract 5.5.0 on a clean 300 dpi rendering. It preserved all twenty checked amount cells. The missing-sign and column-error cases below are controlled teaching changes, not mistakes attributed to that run.

What the real OCR run returned

DN created a one-page PDF labelled “DN FICTIONAL STATEMENT” using ReportLab. The page shows five invented movements twice: first in money-out, money-in and running-balance columns, then as signed amounts. A second PDF contains only the rasterized page image. Native text extraction from that image-only copy returned no substantive text; the authored source PDF retained its text layer.

Tesseract processed the 300 dpi PNG and wrote both plain text and a TSV containing word positions and confidence fields. The comparison selected words whose centres fell inside twenty amount boxes defined from the fixture’s known coordinates: fifteen cells in the column view and five signed-amount cells. All twenty matched the expected spelling, and all twenty matched after the declared numeric interpretation.

The reference text did contain an observed error. In the raw output, the source references R01 through R05 appear as RO1 through RO5, with letter O replacing zero, in both views. The amount boxes still matched because they were linked by known coordinates. The worksheet uses manually verified source IDs. This is a concrete reason that correct amounts cannot establish correct row identity.

This is a successful observation on one clean, authored page. It does not test automatic discovery of unfamiliar table layouts. The boxes were specified from the source design, and the two views repeat the same five movements. They are not twenty independent transactions or evidence of a production-wide accuracy rate. The raw OCR output, coordinates, comparison results and file checksums are in the download.

Establish the source convention before calculating

The fixture uses USD, a decimal point, comma thousands separators in the printed page and explicit zeroes. Money out reduces the balance; money in increases it. Parentheses in the signed view mean money out because the page explicitly says so. Those rules belong to this fixture. Confirm the rules for a real statement instead of inferring them from familiar-looking punctuation.

ReferenceMoney out, USDMoney in, USDSigned movement, USDBalance, USD
Opening———1,000.00
R01125.400.00-125.40874.60
R020.00250.00+250.001,124.60
R0312.500.00(12.50)1,112.10
R0480.000.00(80.00)1,032.10
R050.005.25+5.251,037.35

The two displays are alternative representations of the same movements. Do not add both tables together. A reconciliation dataset needs one row per source movement and a stable link back to its location. The duplicate view exists here to test sign and parenthesis recognition alongside column placement.

Two checks answer different questions

For each row, the expected signed movement is money in minus money out. For R01 that is 0.00 − 125.40 = −125.40. The closing check adds those signed movements to the opening balance:

1,000.00 − 125.40 + 250.00 − 12.50 − 80.00 + 5.25 = 1,037.35

If R01 becomes positive 125.40, the extracted balance becomes 1,288.15. The difference is 250.80, which is twice the original debit: the erroneous transcript both removes a 125.40 reduction and adds a 125.40 increase. Checking only the number of digits would miss the issue. Checking the row against its source direction identifies the precise disagreement.

The source reconciliation is separate. If the source-side rows themselves do not reach the printed closing balance, investigate missing rows, duplicated pages, the wrong period, an opening-balance mistake or a transcription error in your supposed reference. An OCR transcript should not be declared wrong solely because it disagrees with an unverified “answer key.” Preserve the evidence on both sides.

Four deliberate transcript changes

The following changes were made manually after the successful OCR comparison. They are included to test whether the reconciliation check would detect these conditions. They say nothing about how frequently an OCR engine produces them.

Teaching changeRows that disagreeExtracted closing minus source closing
Remove the minus from R01: -125.40 becomes 125.401USD 250.80
Drop R03 parentheses: (12.50) becomes 12.501USD 25.00
Reverse R04 column direction: an 80.00 outflow becomes +80.001USD 160.00
Offset two edits: R01 becomes -115.40; R02 becomes +240.002USD 0.00

The last case is particularly useful. One row is ten dollars too high and another is ten dollars too low, so the balance still agrees. A workflow that releases a statement merely because its final variance is zero would miss both row errors. Keep the row-level comparison even when the period total passes.

Try the local review worksheet

The default is a deliberately altered transcript: R01 has lost its minus sign. It is not the observed Tesseract output. The source columns remain the verified teaching fixture. Enter 0.00 for a known zero; blanks are unresolved. This tool compares supplied numbers and does not perform OCR or upload a PDF.

1 of 5 extracted rows differ from the supplied source columns. The source rows reconcile to the supplied closing balance. The extracted closing balance differs by USD 250.80 (extracted minus source closing).

Source-implied closing balance
USD 1,037.35
Source rows minus source closing
USD 0.00
Extracted-implied closing balance
USD 1,288.15
Extracted minus source closing
USD 250.80
Row mismatches
1
ReferenceSource money in − outRaw extracted spellingInterpreted amountExtracted minus sourceRow comparison
R01USD -125.40125.40USD 125.40USD 250.80Mismatch: inspect original page
R02USD 250.00+250.00USD 250.00USD 0.00Matches supplied source row
R03USD -12.50(12.50)USD -12.50USD 0.00Matches supplied source row
R04USD -80.00(80.00)USD -80.00USD 0.00Matches supplied source row
R05USD 5.25+5.25USD 5.25USD 0.00Matches supplied source row
  • This browser worksheet compares manually supplied strings. It does not upload a PDF or run OCR. Confirm the source columns against the original page first; the source side is not automatically authoritative.
  • This fixture defines money out as negative and money in as positive. Parentheses mean a negative extracted amount here; establish the real statement convention before adopting that interpretation.
  • Every amount is required as a JSON string. Enter 0.00 only when zero is known. Blank, null and omitted cells are unresolved, not zero. Currency is USD, decimal point is a dot, and grouping commas are excluded from inputs.
  • The calculation uses integer cents. An agreeing total does not prove row identity, column assignment, completeness or authorization; offsetting errors can leave the closing balance unchanged.

Using the worksheet without hiding uncertainty

The default deliberately removes R01’s minus sign while leaving the source columns unchanged. Restore extractedAmount to "-125.40" and calculate again: all five rows agree and the extracted closing balance returns to USD 1,037.35. You can reproduce each separately labelled scenario from the evidence pack.

Every amount is a quoted JSON string. The money-out and money-in fields are nonnegative magnitudes, and this small worksheet permits one direction per row. A known empty side is entered as "0.00". A blank, omitted field, null or JSON number is rejected so that missing information cannot silently become zero or lose its original spelling. The amount inputs use a dot decimal and no grouping commas.

The extracted amount may have an explicit sign or parentheses under the fixture’s stated rule. The calculation uses integer cents and supports at most fifty rows. It compares manually supplied values; it does not upload a document, perform OCR, identify the correct bank account or authorize an accounting entry. A row marked as matching agrees only with the source values you supplied.

A practical statement review sequence

  1. Identify the document and its boundaries. Check the account or report identity, currency, period, page sequence, opening balance and closing balance. Resolve overlapping downloads and repeated pages before summing rows.
  2. Preserve the page and extraction separately. Retain the original document, a rendered view, raw extracted text and any positional output. Record the engine, configuration and source checksum. A corrected table should not replace the raw observation.
  3. Map each value to a source row and column. A nearby number may be a balance, reference or credit. Inspect the heading and location. Record unresolved assignments explicitly rather than selecting a direction because it makes the total agree.
  4. Compare row amounts and running balances. Validate signs, decimal placement, parentheses and currency scale, then recompute the row transition and closing invariant. Investigate both mismatching rows and apparently successful totals with missing records.
  5. Release only the reviewed interpretation. Keep the difference log, reviewer decision and exact output version linked to the source. Any instruction to post an entry belongs in a separate authorized workflow.

A repeated amount is not necessarily a duplicate transaction. Conversely, two copies of a page can carry distinct extraction identifiers while representing the same movements. Use source position, date and reference context together. Do not deduplicate solely on amount, or treat a fresh row ID as proof that a movement is new.

How DN ran the OCR experiment

The downloadable build script creates the statement from fixed synthetic records, renders it with Poppler at 300 dpi and runs the following local command. The input is an image of the authored page, so the OCR step cannot read the original PDF’s text layer.

tesseract statement-300dpi.png tesseract-psm6 --oem 1 -l eng --psm 6 txt tsv

Tesseract’s command-line documentation describes the engine and language switches and its text and positional output formats. DN used the English language data installed with this environment and recorded its SHA-256 hash. Page segmentation mode 6 was a fixed choice for this controlled fixture, not a recommended universal setting for statements.

The official image-quality guidance discusses resolution, skew, noise and table-recognition limits. Those variables matter when designing a representative test. This run uses a clean digital rendering; it includes no camera perspective, low-resolution scan, handwriting, compression damage or unfamiliar font. A result on this page cannot establish tolerance to those conditions.

The comparison script preserves exact text first, then interprets the fixture’s known punctuation. It removes thousands separators only under the declared source convention and recognizes parentheses as negative. It does not silently repair a missing minus sign. Word-confidence values are retained as engine output, not converted into a probability that a financial row is correct or used as authorization to skip review.

What to require before an agent uses extracted amounts

Specify acceptance in terms of the work being delegated. A draft summary might need highlighted unresolved cells. A proposed reconciliation needs traceable rows, documented sign conventions and complete balance checks. Posting a transaction needs the appropriate business authorization in addition to an accurate extraction. Passing an OCR test does not confer that authority.

Build a representative collection from permitted documents and define expected rows before evaluating the workflow. Include the document formats and quality conditions actually encountered. Keep any deliberately corrupted test transcripts in a separate category from observed engine errors. This lets you distinguish a weak detector from a weak extractor without manufacturing a model-performance claim.

When a discrepancy appears, return to the page. Repeating the same question to an agent that is reading the same flawed transcript is not independent verification. A second view helps only if it supplies new evidence, such as a source image, a known layout rule or a separately verified amount. Record the correction and its basis so the next run does not depend on a reviewer remembering an exception.

Download the source and observed output

Download the OCR statement evidence pack. It contains the labelled source PDF, image-only PDF, 300 dpi PNG, native text-extraction outputs, unedited Tesseract TXT and TSV, amount-box checks, controlled transcript scenarios, calculation fixtures and reproduction code. You can also open the fictional statement PDF while checking the worksheet.

The method records Python 3.12.14, Tesseract 5.5.0, the exact command and language-data hash. The twenty comparisons all passed for the supplied run. No real bank or customer data was used, and no paid API, subscription or outside account was required. Reproducing the OCR step requires local Tesseract, Poppler and the documented Python dependencies.

DN Research Desk can scope a review around your actual document formats, permitted samples and acceptance rules. The AI Operations Starter Kit is an optional DN-owned resource for broader workflow planning. Neither is required to reproduce this public fixture or inspect the observed output.

Frequently asked questions

Did Tesseract miss a minus sign in DN’s test?

No. On the one clean 300 dpi teaching page, Tesseract 5.5.0 matched all 20 checked amount cells, including the signed and parenthesized examples. It did read the reference zeroes as letter O; that is separately recorded. The missing-minus, parentheses-loss, column-reversal and offsetting-error cases are separately labelled deliberate transcript changes.

Does a matching closing balance prove the OCR is correct?

No. Two row errors can offset. In the supplied exercise, changing -125.40 to -115.40 and +250.00 to +240.00 leaves the closing balance unchanged while two rows disagree with the source. Compare row identity, signs, columns and completeness as well as the total.

Can the worksheet decide what a blank debit cell means?

No. It requires a documented source rule. The teaching statement writes 0.00 explicitly, and the worksheet rejects blank, missing or null amounts. On a real statement a blank might mean no movement, an unreadable value or a layout omission; resolve that distinction from the document and its format.

Is 20 out of 20 an OCR accuracy benchmark for financial documents?

No. It is a reproducible observation for one authored page, one rasterization and one engine configuration. The amount boxes were defined from the known fixture layout. It does not establish performance on unfamiliar statements, damaged scans, multiple languages or automatic table discovery.

Download the dated worked example, checks and source record. The original local calculation code is available for reproduction.

Get the most talked about stories directly in your inbox

Join the Decentralised News briefing for independent crypto, DeFi and AI analysis. No spam, unsubscribe anytime.