// Knowledge systems · 3 min read

PDF Extraction Before AI: Fix the Input Before the Prompt

A model cannot reliably reason about a column the extraction pipeline misplaced.

By Jamil Darwish ·

Inspect the extracted evidence first. When an AI answer misreads a PDF, the problem may be missing text, broken table structure or incorrect reading order rather than weak reasoning.

Identify the source type

A PDF can contain selectable text, scanned images or a mixture of both. It may include multiple columns, repeated headers, footnotes and tables. The same visible page can therefore produce very different text representations depending on the parser.

Document-capable models offer another route, described in guides such as Gemini document understanding. That capability still needs testing on the actual source format and task. Do not assume that a file was interpreted correctly because upload succeeded.

Check the fields that affect decisions

For a proposal, inspect prices, exclusions, dates and optional fees. For a policy, inspect definitions and exceptions. For a venue record, inspect the relevant hours and access information. These are more useful checks than merely asking whether the extracted text looks readable.

Preserve document identity, revision and location information. If the pipeline merges several files, keep their boundaries clear so the answer step cannot accidentally assign one supplier's condition to another.

A worked two-column brochure example

Imagine a brochure with package descriptions on the left and prices on the right. A simple text extraction might interleave the descriptions and attach the wrong price to each package. A fluent summary can then reproduce the error confidently.

Compare the extracted record to the rendered page. Check a few rows manually and include a test that asks for the package with a specific exclusion. If the relationship is wrong before generation, fix extraction or supply an appropriate visual representation instead of adding more prompt instructions.

Represent uncertainty in the intermediate data

Use an explicit missing or low-confidence state where the pipeline cannot read a field reliably. Do not substitute zero for an unreadable amount or an empty string for a condition that may matter. Those replacements can create misleading downstream calculations.

If a human correction is needed, retain the corrected record and its provenance. Avoid letting a generated summary become the new source of truth without preserving the original document and review history.

Build a document regression packet

  • A clean digital document with ordinary paragraphs.
  • A scan with imperfect recognition.
  • A table whose headings carry units or conditions.
  • A two-column layout with footnotes.
  • A revised document that conflicts with an earlier version.

Measure critical-field accuracy, source-location quality and review effort for each format. A pipeline can be acceptable for one document class and unsuitable for another.

Only after the evidence is dependable should you compare model prompts or reasoning depth. Better preparation often makes a smaller, simpler analysis path possible—and makes the remaining model errors easier to see.

Sources and editorial scope

Researched and published 30 November 2026. Provider capabilities are attributed to official documentation; recommendations and worked examples are editorial analysis. No independent model benchmark or client outcome is claimed. Confirm current access, pricing and terms before implementation.

Download an AI starter skill · Explore the MCP directory

Build the useful version.

Discuss an AI workflow, knowledge assistant or digital-product brief with Jamil Darwish.

Start a conversation