All insights

PDF purchase order data extraction: templates, OCR or AI?

PDF purchase order data extraction means pulling the customer, PO number, delivery details and order lines out of a PO file so they can become a sales order without anyone retyping them. There are three broad methods: fixed templates, OCR with rules, and AI extraction. For a business with many customers and mixed layouts, AI extraction checked by a person is usually the most practical choice; for a few customers sending identical machine-generated POs, templates can still be enough.

We’ve already explained the AI approach step by step in how AI reads a purchase order. This post compares it with templates and OCR, and covers scans and the spreadsheets and Word files that arrive alongside PDFs.

Why is a PDF purchase order hard to read automatically?

A PDF describes how a page should look. It doesn’t describe what the content means. In a typed PDF produced by a customer’s buying system, the text is there, but it’s stored as fragments placed at coordinates on the page. What looks like a table to you is, to a computer, a scatter of words that happen to line up.

That causes predictable problems. Long descriptions wrap onto a second line and get read as a new order line. A table continues onto page two without its header. A delivery address and an invoice address sit side by side and their lines interleave. And a scanned PDF has no text at all, only a picture of a page.

Three ways to extract data from a PO PDF

Template-based parsing

You define, for each customer’s layout, where each field sits: the PO number is to the right of “Order No.”, the lines are in the table below “Description”. Software then reads those positions from every PDF in that layout.

Templates are fast, cheap per document and very predictable on the layout they were built for. They need setting up for every customer and break, sometimes silently, when a customer changes their system or adds a column.

Purchase order OCR plus rules

OCR (optical character recognition) turns an image of text into text. On its own it doesn’t know which number is the PO number and which is the phone number, so in practice it’s paired with templates or keyword rules. “Purchase order OCR” is often used loosely to mean the whole job, but strictly OCR is only the first step for scanned documents.

OCR is mature and widely available. Its output quality depends heavily on the scan, and it adds a second place for errors to arise: a character misread by OCR and then placed into the right field by a perfectly good template is still wrong.

AI extraction

A large language model reads the document as a whole, much as a person does, and fills in a fixed structure: customer, PO number, dates, addresses and lines. It doesn’t need a template per customer, and the better models can read scanned pages directly.

AI extraction handles layout variety well, including first orders from new customers. It costs a little per document, it can be wrong in ways that look fluent and plausible, and it needs to be designed to show where it’s unsure.

Templates, OCR and AI compared

Template parsing OCR plus rules AI extraction
Setup per customer A template for each layout Rules or templates for each layout None, beyond a fixed output structure
Typed PDFs Very good on known layouts Not needed (text already present) Very good on any layout
Scanned PDFs Not on its own Yes, quality depends on the scan Yes, quality depends on the scan
Customer changes layout Template breaks Rules may break Usually unaffected
Orders typed in the email body No No Yes
Spreadsheets and Word Separate handling Separate handling Read alongside the PDF
Customer’s own product codes Extracted as printed Extracted as printed Extracted as printed, can also read descriptions
Shows uncertainty Rarely Sometimes, per character Can give a confidence score per field, if designed to
Running cost per document Very low Low A few pence
Best fit Few customers, identical layouts Digitising archives, stable layouts Many customers, mixed formats

Each method has a situation where it’s the sensible choice, and plenty of real systems combine them.

Scanned vs typed PDFs: what changes?

The quickest test is to open the PDF and try to select a word. If you can, it’s a typed PDF with a text layer, and every character is exactly what the customer’s system produced. Extraction from these is about understanding the layout, not reading the characters.

If you can’t select anything, it’s an image: a printed order that was scanned, photographed on a phone, or sent through a fax-to-email service. Now every character has to be recognised, and the usual suspects reduce certainty:

  • low resolution or heavy compression
  • pages fed in at an angle
  • company stamps or signatures over the table
  • handwritten amendments, such as a quantity crossed out and rewritten
  • faint dot-matrix print on multi-part stationery

Scanned purchase orders still pay to automate. They’re usually where keying is slowest, because the person has to squint at them too. Expect more fields to be flagged for checking, though, and where a customer could send the original file instead of printing and scanning it, ask them to.

What about spreadsheets and Word documents?

Plenty of POs never touch a PDF. A spreadsheet gives you clean values, with none of the character recognition problems, but its structure is anyone’s guess: several sheets, merged header cells, totals rows in the middle of the lines, hidden columns, or a template the customer has quietly edited.

Word documents tend to hold a typed table, often with delivery notes in free text above or below it. And the email itself may carry information the attachment doesn’t, such as “please deliver to our Leeds site this time”.

The practical approach is to convert each file into a form the extraction step can read, then process the email body and every attachment together as one order. Treating each attachment separately is how a delivery instruction or an extra line gets lost.

Why confidence scoring matters more than accuracy

Every method gets things wrong sometimes. What matters is whether it tells you.

A template that hits a changed layout may fail loudly, or it may read the wrong column and produce a neat, confident, incorrect order. AI output reads fluently whether it’s right or not. In both cases the danger is a wrong value that looks exactly like a right one.

Per-field confidence scores change the reviewer’s job. On our platform, each field is scored out of 10, and anything under 7 is flagged against that field. The person checking the order doesn’t have to re-read the whole PDF. They look at the two or three values the system was unsure of, compare them with the original shown alongside, and move on.

Why a blank field is better than a guess

Asked to fill in a delivery date that isn’t on the order, a badly designed system will produce something plausible. That invented date then flows into the ERP, onto the pick list and into a promise to the customer.

A blank field does the opposite. It’s obvious, it stops at review, and it prompts the right question: does the customer have a date in mind, or should it go on the next available delivery? The same applies to quantities, units and prices. Our rule is that if it isn’t in the order, the field stays empty and the order can’t be approved until a person has dealt with it.

Extraction is only half the job

Even a perfectly read PO can be wrong. The customer may quote an old price or a discontinued code, or send the same order twice. Those questions are answered by checking the extracted data against your ERP with ordinary code, then showing the results to a reviewer. We cover how to design that stage in building an order approval workflow.

Which extraction method should you choose?

  • Templates if a small number of customers send most of your orders in fixed, machine-generated layouts, and you can live with maintaining them.
  • OCR plus rules if you’re mainly digitising a stable archive of similar documents.
  • AI extraction with review if orders come from many customers in mixed formats, including scans, spreadsheets and orders typed into emails.
  • EDI if your largest customers can trade electronically. It avoids extraction entirely for them, and you can automate the rest by email. See order automation vs EDI.

If you’d like to test this on your own documents, send us a handful of real POs, scans and spreadsheets included. Our order capture page shows what the extracted result looks like, and we’re happy to talk it through on a free call.