Skip to content
AZ Tools

Why your PDF isn't searchable

PDF is not a text format that happens to be laid out. It is a page description: a list of instructions saying draw this glyph at this position, or paint this image over this rectangle. A page produced by a word processor draws characters and can be searched. A page produced by a scanner or a phone camera draws a single picture, and nothing in the file knows what the picture says.

Two kinds of page that look identical on screen

A text page carries fonts, character codes and coordinates. A scanned page carries one image, usually the whole sheet, and nothing else. Both render as a page of writing, and at normal zoom you cannot tell them apart.

The difference only shows up when something tries to read the page rather than draw it: search, select, copy, a screen reader, or a program pulling data out. All of those need characters, and on a scanned page there are none.

How to tell in a few seconds

Try to select a line. If the cursor draws a rectangle around a region instead of highlighting words, the page is an image. Then zoom in hard: real text stays sharp at any magnification because it is redrawn from the font outlines, while a scan turns into visible pixels.

File size is the other clue. A page of plain text is usually a few kilobytes; a scanned page is hundreds of kilobytes to several megabytes, because it is a photograph. A twenty-page document that weighs forty megabytes has been scanned, whatever it looks like.

Text that copies out as gibberish

Sometimes the page really does contain text and copying it still produces nonsense. Producers embed subsets of fonts and are free to number the glyphs however they like, so the code stored for the letter A may be any number at all. What maps those numbers back to real characters is an optional table, and when it is missing or wrong, extraction faithfully returns the wrong letters.

Two smaller effects come from the same place. Ligatures are single glyphs, so a word can arrive with fi or ffi collapsed into one character or dropped. And a PDF has no space character in the sense you would expect — gaps between words are usually just a move to a new position, which is why extracted text sometimes runs words together.

Why the words come out in the wrong order

Nothing in a PDF states the reading order. Glyphs are drawn in whatever sequence the producing program emitted, which for a two-column layout can mean a line of the left column, then a line of the right, alternating all the way down.

Every extractor therefore reconstructs the order from geometry, and headers, footnotes, tables and sidebars are where those heuristics break. If your extracted text is complete but scrambled, this is why, and it is a different problem from a page that has no text at all.

What OCR actually adds

Optical character recognition does not change the picture. It reads the image, guesses the characters, and writes them into the page as invisible text positioned over the corresponding marks — the scanned image stays on top as what you see, and the text underneath is what search finds.

That means OCR quality is permanent in a way the image is not. Its usual mistakes survive into every later search: rn read as m, a capital O as a zero, a lowercase l as the digit one. Recognising the wrong language is worse, because accented and non-Latin characters are then mapped onto whatever the chosen alphabet allows.

When a searchable PDF still refuses to find anything

Resolution is the usual cause. Recognition wants roughly 300 dots per inch on the printed page; below about 200 the strokes of small type merge and accuracy falls off a cliff. A photo of a page taken at an angle adds skew, and unstraightened lines confuse the line-finding step before character recognition even starts.

There are also two failure modes that look like bad OCR but are not. A document can be encrypted with permission flags that forbid extraction, so the text is there and the viewer refuses to hand it over. And a page can be rotated by a page-level attribute rather than in the image, which leaves the text layer sitting at ninety degrees to the words you can see.

The order of operations that works

Extract the text first and read what comes out, because that is the ground truth about what the file contains. Nothing means it is a scan. Complete but jumbled means an ordering problem, not a missing layer. Recognisable structure with wrong letters means the font mapping is broken, and the fix is to re-export from the original document rather than to fight the extractor.

If it is a scan, run recognition before the file goes into an archive, and keep the original: OCR is a guess written into the file, while the image is the evidence. And do it at the highest resolution you have, since compressing the pages first destroys exactly the detail the recogniser needs.

Related tools