How to catch wrong cells in a PDF table with the right total
9 April 2026
Two wrong amounts can cancel out and leave a convincing total. In this three-page PDF, the deliberately altered entries still add up to 173.00. Compare the keyed rows with the original table, then try the missing-value and duplicate-row examples. Each catches a fault the grand total alone cannot reveal.
Related articles
- How to extract a table that continues on the next PDF page
- When a PDF table adds up but two line amounts are wrong
- What does 1,234 mean in an extracted PDF table?
- How to preserve an empty middle cell in an extracted PDF table
Which label belongs to each value?
Define the intended output before selecting an extractor. A CSV needs a stable column schema; a spreadsheet may need usable data types and readable labels; a structured record may also need identifiers and source references. Decide whether merged headings become separate metadata, repeated values or another explicitly documented structure.
Readable PDF text is not the same as a correctly reconstructed table. Searchable text helps locate words, but downstream data needs the correct row and column meaning. Validated business data adds another layer: required values, permissible formats and the relevant reconciliation rules.
Where this guidance stops
This guide covers table structure and value validation. Invoice-specific tax, supplier and payment controls require a separate workflow. The local example demonstrates a narrow extraction and checking method; it does not establish ArkePDF capabilities or a general extraction accuracy rate.
Sample the table layouts
Merged cells, repeated headers and multi-page tables
Build a sample matrix before measuring performance. Include ruled and unruled tables, merged cells, repeated page headers, multi-line descriptions, split records and tables continuing across pages. Add scans, languages and quality variations that occur in the intended work. Keep a simple baseline, but do not let easy pages dominate the evidence.
| Sample dimension | Question for the ground truth | Error to watch |
|---|---|---|
| Merged heading | Which rows inherit its meaning? | Heading lost or treated as a transaction |
| Repeated header | Where does continuation begin? | Header inserted as a data row |
| Multi-line cell | Is the text one record or several? | Record split at a line break |
| Page boundary | Which rows belong to one logical table? | Omission or duplicate during joining |
| Numeric notation | What do separators and signs mean? | Value transformed into a different number |
Ask someone competent in the source material to establish expected rows and cells independently of the extractor output. Record ambiguous source content as unresolved. Do not make the software's answer the ground truth merely because it is easier to export.
Supplier output structures differ. Amazon Textract's table documentation, for example, describes cells, merged cells, column headers and other table elements. Check which relationships your selected tool actually returns and which your own transformation must reconstruct.
Eight rows, four fields and two offsetting errors
Inputs, assumptions and the expected result
The original three-page synthetic table fixture contains eight data records with four fields each: item, quantity, unit price and amount. One logical table spans two pages, repeats its column headers and includes a merged group heading. The values are synthetic units, with no commercial price or tax claim.
The example was created with ReportLab 4.4.9 and processed locally using Python 3.12.14 and pdfplumber 0.11.9. The saved extraction and checks preserve the tool versions, input hash and measured results. pdfplumber's documentation describes its table extraction and notes that it works best with machine-generated PDFs; it does not provide OCR.
The script uses default table detection, then applies explicit rules written for this fixture. It removes known column-header rows, treats the merged “Region B” row as a group heading, and joins the two known continuation pages. Each extracted field retains its source page, table row and cell coordinates in the normalised records.
The comparison checks 32 expected data cells: eight records multiplied by four fields. Printed headers and the merged heading are outside that cell denominator and checked as structural elements. All 32 data cells matched the authored expected values in this local run; the result retained eight distinct records.
The CSV output is useful for inspecting the result, but the JSON preserves richer source references. Retain that provenance when moving data into a system that cannot store it directly, using a stable record identifier to link the two.
What the results establish
This is a controlled text-based fixture with rules tailored to its layout. It does not test scans, OCR, missing grid lines, arbitrary continuation detection or real supplier documents. Expected values were authored with the fixture; independent human checking and measured review time remain necessary before treating it as representative evaluation evidence.
Measure structural and value errors
Rows, columns, totals and cell-level accuracy
Use deliberately introduced errors to test the validator separately from the extractor. In the accompanying value-error fixture, one quantity is changed and one amount is removed. The checker reports 30 matching cells out of 32, one incorrect value and one missing value. Those are injected faults, not errors observed in pdfplumber's extraction.
A separate structural fixture removes record A04 and duplicates B02. It still has eight rows. Comparing only the row count would miss both problems; checking record identities detects one omission and one duplicate. Where source rows have no natural identifier, define a reviewable alignment method rather than assuming row position remains reliable.
Totals are also incomplete evidence. Another injected case increases one amount by one unit and decreases another by one unit. The combined amount remains 173.00, while two source cells are wrong. The validator catches the individual discrepancies despite the matching total.
Report at least the expected and extracted record counts, missing and extra records, missing values, incorrect values and unresolved alignments. Where useful, add arithmetic checks such as quantity multiplied by unit price, while respecting the source's rounding and business rules.
Keep raw text beside parsed values. A conversion from “1,234” requires a declared notation rule; silently assuming whether the comma marks a decimal or thousands separator can change the value while leaving a plausible-looking result.
Acceptance checklist for PDF table extraction accuracy
Manual review, missing headers and split records
Route structural uncertainty to a reviewer before importing data. Missing column labels, unexpected column counts and ambiguous continuation pages need interpretation; a high word-recognition confidence cannot resolve the meaning of an unknown column.
The reviewer should see the source region, extracted value, proposed transformation and reason for referral together. Record the correction and the decision rule it required. If the source itself is unreadable, request a better copy or retain an unresolved state rather than inventing a value.
Acceptance should establish that:
- Every expected record is accounted for, including page-boundary records.
- Column meanings remain consistent across the logical table.
- Merged labels and repeated headers are handled explicitly.
- Missing, extra and duplicate data are visible.
- Numeric parsing uses the declared notation and required precision.
- Material values can be traced back to source cells.
- Corrections and unresolved exceptions have accountable owners.
Keep critical-field requirements separate from an overall average. A wrong identifier that attaches an otherwise correct row to another account may matter more than several harmless spacing differences. Define the consequence and required review before choosing an acceptance threshold.
Approve data for downstream use
A reconciliation and ownership checklist
Approve a bounded document family and destination schema when the representative results support them. Identify which layouts can proceed automatically, which require review and which must be rejected or rescanned. Preserve the extraction version and transformation rules with each accepted batch.
Include review effort in the operating model. In a hypothetical 200-table batch, 40 exceptions taking four minutes each, 20 routine checks taking 1.5 minutes each and 20 minutes of reprocessing produce 210 minutes of work. That is 3.5 hours before any additional setup or investigation. These assumptions illustrate a cost model; no human review time was measured for the synthetic fixture.
Multiply observed effort by your actual staffing cost only after a representative pilot. Have the data owner accept the reconciliation and the receiving-system owner accept the schema. Use failures to refine the sampling matrix and retest the affected layouts, keeping extraction success distinct from approval to use the resulting data.
How to extract a table that continues on the next PDF page
Use the repeated column headings to align the next page of a table and exclude that header row from the extracted records.
Read “How to extract a table that continues on the next PDF page”.
When a PDF table adds up but two line amounts are wrong
Two transcription errors can cancel each other out. Compare suspect cells with the original table even when the extracted total balances.
Read “When a PDF table adds up but two line amounts are wrong”.
What does 1,234 mean in an extracted PDF table?
Establish the source table’s numeric convention before parsing a value such as 1,234, whose magnitude depends on the decimal separator.
Read “What does 1,234 mean in an extracted PDF table?”.
How to preserve an empty middle cell in an extracted PDF table
Keep an empty cell in its original column so a missing value cannot shift every following figure under the wrong heading.
Read “How to preserve an empty middle cell in an extracted PDF table”.
Sources
- pdfplumber, Official project documentation, accessed 31 October 2026. Local test used version 0.11.9.
- Amazon Web Services, Amazon Textract tables, accessed 31 October 2026. No Textract service request was made.
Published by Arke Technologies (Pty) Ltd, Johannesburg. Drafted with ChatGPT. Editorial and technical checks by Kairos (Codex). The linked articles were drafted with NotebookLM and independently checked and edited by Kairos (Codex).
