Skip to content
mentoor

Topic 2 of 5 · 4 min read

Reading PDFs: text versus vision

Goal: Choose between text extraction and page-image reading for a given PDF and predict what each approach will miss.

A PDF can reach a model in two ways: as extracted text, or as images of each page. Pick by what the document contains, because each way misses something the other sees. Many tools do both at once.

Check yourself · 1 of 3

A PDF is a scan of a paper form. What happens if you rely only on text extraction?

Choose one answer

Why it matters

People upload contracts, invoices, papers and slide decks and trust the summary. If the PDF is a scan, a plain text extractor returns nothing or garbage, and the model may still answer from the few words it got. If the PDF has a chart, extracted text holds only the axis labels, not the shape of the line.

The two routes

  • Text extraction. The tool pulls the text layer out of the file. It is cheap and fast, and it gives exact words you can quote. It loses layout, so a table can turn into a stream of numbers with no columns. It fails on scanned pages, because a scan is only a picture of text.
  • Page images. Each page is rendered as an image and the model reads it as it would a photo. It can see tables, charts, stamps, handwriting and columns. It costs more tokens and is more prone to small misreads, such as a digit in a dense table.
  • Both together. Claude's PDF support, for example, gives the model the extracted text and an image of each page. The docs say each page typically uses about 1,500 to 3,000 tokens of text, plus the image cost, which is why long PDFs get expensive.

How to choose

  1. Open the file and try to select a sentence. If you can, there is a text layer. If you cannot, it is a scan and needs vision or OCR.
  2. Look for tables, charts and forms. If the answer lives there, use page images or ask for the table to be rebuilt and then check it.
  3. Count the pages. For 300 pages, do not send everything. Find the chapter first, then send those pages.
  4. Ask for page references. "Give the page number for each figure you quote" lets you check the source quickly.

Before and after

Weak: "Summarise this PDF" on a 40-page scanned annual report. The extractor returns the cover page title and little else, and the summary is vague and partly invented.

Better: send page images for the pages with the income table, then ask, "From page 12, list revenue and net profit for each year as a table. Say if any value is unclear."

What goes wrong

  • Silent empty text. A scan yields almost no words and the model fills in from general knowledge.
  • Flattened tables. Columns merge, so a number lands under the wrong heading.
  • Charts read as words. Only the labels are seen, so trends are guessed.
  • Cost surprise. A long PDF sent as images can fill the context window before you ask your question.

Examples

A scanned invoice

An accounts clerk uploads a scanned supplier invoice and asks for the total. The text route returns nothing, so the model answers from the file name. Sending the page as an image and asking "What is the total including tax? Quote the line you read it from." gives a checkable answer.

A chart in a research paper

A student asks what trend Figure 3 shows. Extracted text contains only the caption and axis names. With the page image, the model can describe the line, and the student still checks two points on the axis themselves.

Key points

  • Text extraction is cheap and exact but loses layout and fails on scanned pages.
  • Page images see tables, charts and handwriting but cost more and can misread small digits.
  • Test for a text layer by trying to select a sentence in the PDF.
  • Send only the pages that matter for long documents, and ask for page numbers with every claim.
  • Claude's docs say each PDF page typically uses 1,500 to 3,000 text tokens, before the page image.

Common mistakes

  • Assuming every PDF has a text layer and never checking whether the extraction was empty.
  • Trusting a table summary when the columns were flattened by extraction.
  • Sending a 300-page PDF whole when only one chapter is relevant.
  • Not asking for page numbers, which makes errors hard to find.

Check yourself · 2 of 3

Your report has a key line chart. Which approach best lets the model describe the trend?

Choose one answer

Check yourself · 3 of 3

You must ask about one table in a 300-page PDF. What is the sensible step?

Choose one answer

Practice items, not counted towards your mastery.

Start here

More for this topic