Skip to content
Ask for a Budget
BusinessAugust 31, 20266 min readUpdated on September 6, 2026

Extracting data from ten thousand PDFs with AI: where the demo misleads

Reading a document in a demo is easy. What breaks in production is layout variation, bad scans, tables and missing fields. How to size it before you hire.

Extracting data from ten thousand PDFs with AI: where the demo misleads
Índice do artigo
faltam 6 min de leitura

An AI document-reading demo almost never fails. You drop in a PDF, it returns the right fields, everyone is impressed. The real project starts at document number two thousand, when the supplier changed the layout and nobody noticed.

There is an entire category of work that is still done by people typing: checking invoices, entering contracts, registering proposals, verifying forms, transcribing reports. It is repetitive, it is expensive and it is exactly the kind of thing AI should solve.

And it does, with a condition that rarely comes up in the buying conversation: the problem is not reading one document. It is reading ten thousand without anyone checking them one by one.

Article summary

  • Searching and extracting are different problems. One allows approximation, the other enters your database as truth.
  • Four things break at scale and none of them shows up in the pilot: variable layout, bad scans, tables and missing fields.
  • A table in a PDF is the hardest case and one of the most common, because the structure is visual and does not exist in the file.
  • The validation that sustains the project is done with business rules, not by humans reviewing everything.

Searching and extracting are different problems

It is worth separating two things the market sells under the same name, because they fail in different ways and require different projects.

Searching is what an assistant with RAG does: someone asks, the system finds the relevant passage and answers citing the source. The error here is a worse answer, and the person who asked notices.

Extracting is returning an exact value in a structured field, to go into a system: the invoice number, the issuer's CNPJ (Brazil's company tax ID), the due date, the total amount. The error here is not a worse answer. It is wrong data inside your database, treated as true by everyone who consults it later, possibly for months.

This difference changes what you are buying. A search project is measured by usefulness; an extraction project is measured by accuracy rate and, above all, by how many errors get through undetected.

Where the demo misleads

The demo uses chosen documents. Not out of bad faith, but because that is what was at hand: the clean files, from the main supplier, in the current layout, scanned properly.

Production sends something else. It sends the document from the small supplier who does everything in a spreadsheet, the 2019 contract in a template nobody uses anymore, the crooked scanned sheet with the stamp over the number, the PDF that is actually a photo taken on a phone. And it sends all of this mixed together, with no warning of which is which.

The four things that break at scale

  • Layout that changesEach issuer has its own, and they all change without telling anyone.
  • Bad scansCrooked paper, stamp over the number, low contrast, phone photo.
  • TablesThey exist for the eye and do not exist in the file. Rows that break across pages.
  • A field that does not existThe document simply does not include that data, and the system expects a value.

The first two are the ones everyone anticipates. The bottom two are the ones that blow up the schedule, because they require a business decision, not a technical adjustment.

Tables are the hardest case, and one of the most common

This one deserves a closer look, because almost every relevant operational document has a table inside: invoice line items, contract installments, procedures on a health insurance form, products on an order.

The problem is that the table exists visually and almost never structurally. In a PDF, what exists is a lot of text positioned at coordinates; the columns are an effect of position, not declared information. That is where the most treacherous errors of this kind come from: the row that breaks across two pages and becomes two records, the merged cell that pushes values one column over, the borderless column that merges with its neighbor.

What makes this dangerous is not the difficulty, it is the appearance of success: the extraction returns a nice table, with the right number of columns, and one value is in the wrong column. No alarm goes off.

What this unlocks, if it is addressed at the design stage: if validation includes a rule that adds up the items and compares them with the document's total, this specific error stops getting through. It is one line of rules that is worth more than any model improvement.

OCR still exists, and the choice still matters

With models that read images, it has become common to treat OCR as a closed subject. In practice, the path still changes by document type.

When the PDF is native, generated by a system, the text is inside and extracting it directly is cheaper, faster and more faithful than asking a model to look at the page. When the document is scanned paper or a photo, some recognition step remains in the path, either as a separate tool or built into the model itself.

The practical decision is to have both paths and choose per document, instead of standardizing on one. Many AI bills grow unnecessarily because a pipeline sends the model, as images, pages whose text was already available.

The field that does not exist in the document

This is the point where the project stops being technical. The destination system requires a field, and the document does not include that data. It is not an extraction failure: the information is not there.

There are three ways out, and choosing between them is a business decision, not the vendor's: look up the data in another source the company already has, leave the field empty and send it to a human handling queue, or accept a default value when the rule allows it.

Defining this upfront is worth more than it seems, because it is what determines the size of the exception queue, and the exception queue is what decides whether the automation really saves work or just moves it.

Validation is what sustains the project

Here is the difference between a nice pilot and an operation that works without someone checking everything. Validation is not human review: it is the business's own rules running on top of the result, on every document.

Input, document received, with its type identified
Extraction, fields and tables turned into structured data
Rule-based validation, a sum that adds up, a date in range, a code that exists in the master data
Exception queue, only what the rule rejected goes to a person
Destination system, with a record of what was extracted and where it came from
The person comes in at the end and only for what the rule could not approve, not in the middle of everything.

The most effective rules are mundane and specific to the business: the sum of the items has to match the total, the issue date cannot be in the future, the CNPJ has to exist in the supplier master data, the procedure code has to be in the current table. They cost little to write and catch most of the errors a quick human reading would let through.

Along with them, a small, continuous, sample-based human check serves to discover the errors no rule anticipates, especially when a layout changes.

When the document has personal data

Operational documents almost always carry personal data, and sometimes sensitive data. This is not a compliance detail: it decides the architecture, because it defines what can be sent to an external vendor.

The cheapest way out is usually to minimize the data before sending it: send only the region of the page that matters, or remove identifiers the task does not need. A model that needs to classify the document type does not need the person's name. When that is not possible, the discussion becomes about where processing happens, which is the subject of sensitive data and architecture.

How to size the pilot

A well-sized extraction pilot answers a specific question, not "whether AI can read".

  • A single document type, the highest-volume one, not the hardest one
  • A random sample from real production, including the bad documents
  • Validation rules written upfront, with the team that does the work today
  • Measurement of what passed the rule and what fell into the exception queue, separately
  • A defined decision for each field the document may not include

The fourth item gives the number that matters to the business. The raw accuracy rate impresses and decides nothing; what decides is how much human work remains after automation, and that is the size of the exception queue.

Frequently asked questions

Searching answers a question with a relevant passage and allows approximation. Extracting has to return an exact value in a structured field, to go into a system. A search error produces a worse answer; an extraction error enters your database as if it were true.

Sources and method

This article describes patterns observed by the X-Apps team in projects involving the processing of operational documents and integration with destination systems. The cases have been anonymized.

The text does not present accuracy rates, work reduction percentages or comparisons between recognition tools, because those numbers depend entirely on the document type and the quality of each company's data, and publishing them as a general reference would give an estimate the appearance of a measurement. The reference to personal data follows the regime of Law No. 13,709/2018 (LGPD, Brazil's data protection law), covered in detail in the article on sensitive data and architecture.

Previous post
In healthcare, the data decides the architecture before the model
Next post
Social media in your company's systems: comments, catalog and ads
Newsletter

One email a month, no noise

What we learn shipping custom software and applied AI.

Related articles

How to turn your company into an exponential organization3 min · Business
What to consider when validating a software development project2 min · Business
Open and closed scope: software and the urgency of innovation1 min · Business
Basic API guide for companies3 min · Business
The power of collective intelligence in software development1 min · Business

Accelerate your business with X-Apps

Ask for a Budget
X-Apps is an IT provider partner and advised by
Gartner
Receive our e-mails
News on software and applied AI.
Follow X-Apps