Monday, November 2, 2026

Extract Data from PDFs with AI: A Review-First Workflow

A PDF table can look tidy on a screen and still turn into scrambled columns when copied elsewhere. AI and optical character recognition (OCR) can help reshape the information, but numbers, dates, and row boundaries need a deliberate review before you rely on them.

Check what kind of PDF you have

First try selecting a few words. If the text highlights cleanly, the document probably contains selectable text. If you can only select the whole page as an image, OCR is needed to recognize the characters. Scans often confuse similar marks such as 0 and O, 1 and I, decimal points, and faint minus signs.

Look at a representative page before processing a large file. A table that crosses a page break, uses merged headings, or has footnotes may need different handling from a simple list. Keep a copy of the original so you can compare every extracted value against its source.

Define the output before extraction

Decide what one row should represent and name the fields you need. For an invoice table, that might be item code, description, quantity, unit price, line amount, and source page. If a field is absent, ask the tool to leave it blank or mark it for review instead of filling it from a guess.

Keep source labels and units. “12” could mean pieces, dollars, or a page number; a bare value loses context. If the table is long, process a few pages at a time and include the page range in your request.

Preserve uncertainty instead of cleaning it away

Do not ask for a neat table at any cost. Tell the tool to mark unclear cells, retain the printed text when it is uncertain, and show which page each row came from. This gives you a review queue. You can then inspect just the uncertain entries in the PDF rather than checking every character from scratch.

A good first pass keeps source wording intact. Normalize dates, abbreviations, or currency only after you have confirmed the source format and chosen a rule. If different pages use different headings, preserve that variation in a note.

Verify the result before reuse

  • Compare the first and last row on each processed page with the PDF.
  • Check a few values from the middle, including decimals and negative values.
  • Recalculate visible totals and compare them with the printed total.
  • Confirm that rows were not merged or split at page breaks.
  • Keep the page reference until the extracted data has been approved.

For sensitive documents, follow your organization’s handling rules and use an approved tool. You can often test the workflow with a short synthetic table before uploading a real file. Extraction saves retyping; it does not remove the need to check the source.

Copy-ready prompts and example results

Open an example to view the complete prompt and a sample result. Results are illustrative; tools may respond differently.

Extract a short invoice table and check its total

Complete prompt

Extract the table below into CSV with these columns: item_code, description, quantity, unit_price, line_amount, source_page. Keep the printed values. Do not infer missing values. After the CSV, add the sum of line_amount and say whether it matches the printed total. Mark anything uncertain as REVIEW.

OCR text from PDF page 2:
R-11 | Notebook | 3 | 4.50 | 13.50
R-12 | Envelope | 2 | 1.25 | 2.50
R-13 | Labels | 1 | 6.00 | 6.00
Printed total: 22.00
Source page for all rows: 2

Illustrative expected result

item_code,description,quantity,unit_price,line_amount,source_page
R-11,Notebook,3,4.50,13.50,2
R-12,Envelope,2,1.25,2.50,2
R-13,Labels,1,6.00,6.00,2

Line amount sum: 13.50 + 2.50 + 6.00 = 22.00. It matches the printed total. No uncertainty is visible in the supplied OCR text.
Keep an unclear OCR value visible for review

Complete prompt

Convert these OCR lines into a table with columns date, reference, amount, and source_page. Do not correct a value by guessing. If a character is ambiguous, preserve the OCR text in raw_value and put REVIEW in status. Add a short note explaining what to inspect in the original PDF.

OCR text from page 4:
2026-03-08 | INV-2O4 | 18.50
2026-03-09 | INV-205 | 7.?0

The second amount is faint in the scan. The character in INV-2O4 may be a zero or the letter O.

Illustrative expected result

| date | reference | amount | source_page | status | note |
| 2026-03-08 | INV-2O4 | 18.50 | 4 | REVIEW | Check whether the third character in the reference is zero or letter O. |
| 2026-03-09 | INV-205 | 7.?0 | 4 | REVIEW | Inspect the faint amount in the original scan before entering a value. |

No ambiguous character has been silently corrected.

No comments:

Post a Comment

Featured Post

Extract Data from PDFs with AI: A Review-First Workflow

Popular Posts