Extracting Data From PDFs and Forms With AI
By CodexierPublished 5 min read
Retyping numbers from PDFs is some of the most repetitive work in a small company, and modern AI can read most of those documents faster than a person. The catch is that it reads them confidently even when it is wrong. This guide covers which documents extract reliably, the validation rules that catch mistakes, where a human must stay in the loop and how the data travels onward safely.
Documents that extract well and badly
The mechanism matters here. A digital PDF already contains the text as characters, so the model only has to work out which number is the total and which is the VAT. A scan is an image: the text first has to be recognised, and every smudge, fold or skewed page adds uncertainty before the interpretation even starts.
| Document type | Typical reliability | What to watch |
|---|---|---|
| Digital supplier invoices | High | Credit notes and multi-page invoices |
| Order forms from your own website | Very high | Free-text fields |
| Scanned contracts and applications | Medium | Signatures, stamps, crossed-out text |
| Handwritten forms | Low to medium | Digits like 1 and 7, dates in different formats |
| Receipts photographed by staff | Medium | Faded thermal paper, cropped totals |
Reliability here is about mechanism, not a promise. Test on a sample of your own documents before deciding.
Validation rules for extracted fields
Validation means checking the extracted values against rules that must hold if the reading is correct. Good rules catch most errors without anyone looking at the document, because a misread digit usually breaks some arithmetic or lookup.
- Arithmetic: line totals add up to the net amount, and net plus VAT equals the gross total.
- Format: organisation numbers have ten digits and a valid check digit, bankgiro and plusgiro numbers match their patterns, dates are real dates.
- Lookup: the supplier exists in your register, and the bankgiro matches the one you already have on file for that supplier.
- Plausibility: the amount is within the usual range for that supplier, and the VAT rate is one that exists in Sweden.
- Duplicates: the same invoice number from the same supplier has not already been registered.
The bankgiro check deserves emphasis. Invoice fraud often works by sending a genuine-looking invoice with a changed payment number. A rule that flags any new or changed payment detail stops that, whether a human or an AI reads the invoice.
Human review for uncertain values
Every extraction should end in one of two states: passed all rules, or sent to a review queue. The queue is where a person sees the document next to the extracted fields, with the failing field highlighted, and confirms or corrects it in seconds.
- Send to review whenever any validation rule fails.
- Send to review whenever the model reports low confidence on a field that matters, such as amount, due date or payment number.
- Always review the first documents from a new supplier or a new form version.
- Sample a few passed documents each week anyway, so you notice if a supplier changes layout.
Corrections from the queue are valuable data. Log them, and you will quickly see which suppliers or fields cause trouble, which tells you where to add a rule rather than more review.
Sending data onward to your systems
Extraction is only useful when the data lands where work happens: a supplier invoice in Fortnox or Visma, an order in the webshop, an application in the CRM. The integration should create drafts rather than final records wherever the target system allows it, so the last approval stays with a person who has attestation rights.
If invoices are your main case, our guide to automating supplier invoices into Fortnox covers the accounting side in detail. For other flows, a workflow automation system connects the reader, the rules, the review queue and the target system into one pipeline with logging at every step.
Privacy for scanned documents
Applications, contracts and patient or employee forms contain personal data, sometimes sensitive. Sending them to an AI service makes that provider a processor under GDPR, so you need a data processing agreement, a clear answer on where the data is processed and a guarantee that it is not used to train models. Prefer EU processing and delete source files and logs on a schedule you can defend to IMY.
When you do not need this: if you handle a few dozen documents a month, a person typing them in is cheaper and safer than any pipeline. Automation pays off when the volume is steady, the document types repeat and errors are costly. If you are unsure which side of that line you are on, a free 15-minute call is enough to tell, and our price list is on the pricing page.
Frequently asked questions
Can AI read handwritten forms?
Partly. Clear block capitals in boxed fields work reasonably well, joined-up handwriting much less so. For handwritten forms, plan for a high share of review and consider replacing the paper form with a web form instead, which removes the problem at the source.
Is extracted invoice data safe to send straight into bookkeeping?
Only as drafts. Let validation rules check arithmetic, supplier and payment details, and keep a person with attestation rights approving before payment. That protects you from both misreadings and invoice fraud.
Do we need a custom solution or is there software for this?
For supplier invoices, Fortnox and many accounting tools have built-in scanning that may be enough. Custom pipelines make sense for document types no standard tool covers, or when data must be combined with your own rules and systems.
What does the privacy setup require?
A data processing agreement with every AI provider involved, processing in the EU where possible, no training on your data, access limited to the people who need it and a deletion schedule for both documents and logs.
Wondering whether your documents are worth automating?
Bring a handful of real sample documents and a rough monthly volume. In fifteen minutes we can tell you how reliably they will extract, which validation rules you need and whether the volume justifies a pipeline.
Book a free 15-minute call