New Tool Radar

AI for Data & Spreadsheets

How to Verify AI-Extracted Invoice Lines Against the PDF Invoice

Compare the quantities, prices and line totals an AI tool extracted from an invoice PDF with the invoice itself, then check the invoice total.

Schematic with three steps: Check quantities and prices line by line; Recompute each line total; Re-add the lines and compare with the.

Invoice lines are where extraction errors cost money: a wrong quantity or a shifted decimal changes what gets paid. Check each line against the PDF invoice, then re-add the lines and compare with the invoice total printed on the PDF.

What you need

  • The invoice PDF
  • The extracted invoice lines in a sheet
  • The invoice total as printed on the PDF

Step 1: Check quantities and prices line by line

For each extracted line, read the quantity and unit price against the PDF. Mark any line where either value differs, and note the PDF line number so the correction is traceable.

Step 2: Recompute each line total

Multiply quantity by unit price for each line in the sheet and compare the result with the extracted line total. A line total that does not equal quantity times price means one of the three values is wrong.

Step 3: Re-add the lines and compare with the invoice total

Sum the checked line totals and compare the sum with the invoice total printed on the PDF. If they differ, work back through the lines until the gap is explained; do not adjust the total to force a match.

Worked example: synthetic six-line invoice

The table below is a synthetic example. It shows the expected result of checking extracted invoice lines; no invoice was read and no extraction was run.

Check Lines Result
Lines extracted 6 Source has 6 lines
Quantities matching the PDF 6 Pass
Unit prices matching the PDF 5 1 price differs
Line totals recomputed correctly 5 1 line total is wrong
Sum matches the printed invoice total No Gap equals the wrong price

Expected result (UNTESTED). 5 of 6 invoice lines are correct, 1 unit price differs, and the summed total is short by exactly that price difference. Correct the price from the PDF before paying. This check was not run live; the table shows the expected result for the synthetic example.

Limits

  • Discounts, tax and shipping lines are often extracted into the wrong columns; check them separately.
  • A PDF that continues a table across pages can lose the first line of the second page.
  • Never overwrite the printed invoice total to match the extracted lines; the printed total is the check.

Sources

See all