Scanning and OCR
What makes a PDF searchable
The PDFStack team · 28 April 2026 · 4 min read
A PDF can look identical whether or not it contains any text at all. The difference only shows up when you try to search it.
Two kinds of page
A digital PDF was created from a document. It stores text as text: characters, positions and font references. Search works, copying works, and screen readers can read it aloud.
A scanned PDF was created from paper. It stores a picture of the page. There is no text in it anywhere, just pixels arranged so a human eye reads them as words. Search finds nothing, because there is nothing to find.
The quickest test: open the file and try to select a word with your cursor. If a text cursor appears and the word highlights, it is digital. If you get a selection rectangle over the whole page, it is a scan.
What OCR actually does
Optical character recognition looks at the image, identifies shapes as characters, and produces text. Good OCR then writes that text back into the PDF as an invisible layer positioned exactly over the corresponding image. The page still looks like a scan, but the text is now there underneath, so search and copy work.
This is why a searchable scanned PDF is often described as having a "text layer". The image is what you see; the text layer is what your computer reads.
Why results vary so much
OCR accuracy depends almost entirely on the input:
- Resolution below about 200 dpi loses the fine detail that distinguishes similar characters
- Skewed pages confuse line detection
- Background noise, shadows and creases produce spurious characters
- The wrong language setting will confidently return nonsense
- Handwriting is a different and much harder problem
The practical implication is that fixing the scan is usually more effective than trying a better OCR engine. Rescanning a page straight, at 300 dpi, in good light, will beat any amount of post-processing on a bad capture.
A useful middle ground
If you only need the words rather than a searchable document, extracting text is simpler and often enough. Paste it into a document, check it against the original, and work from there.
How the text layer is stored
In a searchable scan, the recognised words are drawn onto the page in an invisible rendering mode, positioned over the image of the corresponding word. The page looks exactly like the scan because the text is not painted; it is simply present.
That is why a searchable scan is larger than the original. It carries both the image and the text, and both are needed: the image for the reader, the text for the machine.
It also explains a common oddity. Copy a paragraph from a searchable scan and you sometimes get slightly wrong words. You are copying the recognition output, not what your eye is reading from the picture underneath.
Checking whether the text layer is any good
Search for a word you can see near the middle of a page. If it is found, there is a text layer and it is roughly aligned.
Then copy a paragraph into a text editor. What comes out tells you the recognition quality immediately: confident output is clean, poor output is full of plausible-looking substitutions: "rn" read as "m", the digit 1 as a lowercase L, a capital O as a zero.
If the copied text is unusable, the document will not be usefully searchable either, and no amount of indexing will fix it. Rescanning is the answer.
What to do before running recognition
Straighten the pages. Line detection assumes text runs horizontally, and a few degrees of skew makes words merge across lines.
Do not compress first. Recognition works on what it is given, and compressing beforehand means recognising a degraded image. Compress afterwards if you need to.
Make sure the resolution is high enough. Below roughly 200 dpi, the shapes that distinguish similar characters start to disappear and accuracy falls sharply.
When you only need the words
If the goal is to quote from a document rather than to file a searchable version of it, extracting the text is simpler and faster. You get a plain file you can read, check and correct, without carrying the page images around.
That is often the honest answer. A searchable PDF is for archives; a text file is for working.
Why searchable scans are larger
Because they contain both things. The image is still there, at full resolution, and the recognised text is added on top of it.
A searchable scan is typically five to ten per cent larger than the original, occasionally more on dense pages. That is a small price for a document you can actually find things in, but it does mean the order matters: run recognition first, then compress, or you will be recognising an image you have already degraded.