Scanned PDFs vs searchable PDFs
Text layers, OCR, file size and how to tell which one you have
Why a scanned PDF has no text to search or copy, how OCR adds a text layer and where it goes wrong, why scans are so large, how they compress, and the quick checks that tell you which kind of file you have.
- By HelpMeJPG editorial team
- Published
- Updated
- 9 min read
On this page
Quick answer: A scanned PDF stores each page as a picture, so there are no characters in it to search, select or copy; a searchable PDF has a text layer, either because it was produced from a digital document or because optical character recognition (OCR) has added recognised text behind the image. Try selecting a word in a viewer or run the file through a text extractor: if nothing comes back, the file is image-only, and OCR – not conversion or compression – is the only way to give it text.
Two ways to put a page in a PDF
A PDF page is a set of drawing instructions. In a document exported from a word processor, those instructions say, in effect, "using this embedded font, place the glyphs for these character codes at these positions". The characters are in the file as data; the font turns them into shapes when the page is displayed. A table mapping glyphs to Unicode lets a reader know that a particular shape is the letter "a", which is what makes searching, copying and reading aloud possible.
A scanned page is one instruction: "paint this image across the page". The image is a photograph of paper – a JPEG, a Flate-compressed bitmap or, for black-and-white scans, a fax-style CCITT or JBIG2 image. What looks like text is a pattern of dark and light pixels, and the file knows nothing about letters, words or lines.
A searchable scan combines the two. The page still paints the image, but an OCR step has added a second layer: the recognised characters, positioned where they were found and drawn in an invisible rendering mode, so that the picture provides the appearance while the hidden text provides the meaning.
| Born-digital PDF | Image-only scan | Scan with OCR layer | |
|---|---|---|---|
| What a page contains | Text operators, fonts, vectors, images | One large image | One large image plus invisible text |
| Search, select, copy | Yes, exactly | No | Yes, as accurately as the OCR read it |
| Sharp when zoomed | Yes, at any magnification | Only up to the scan resolution | Only up to the scan resolution |
| Readable by a screen reader | Yes, best with structure tags | No | Yes, with possible errors and no structure |
Why text extraction comes back empty
Text extraction reads the text-showing instructions in each page's content stream and maps the glyphs back to characters. An image-only page has no such instructions, so the extractor finds nothing – not because it failed, but because there is nothing of that kind to find. The PDF text extractor flags these pages explicitly and tells you that OCR would be required, rather than leaving you to wonder whether something went wrong.
A few other situations produce empty or garbled text and are often mistaken for scans:
- Text converted to outlines. Some design and print workflows turn every letter into vector shapes so that fonts need not be embedded. The result zooms perfectly and extracts nothing, because the characters have become drawings.
- Fonts without a Unicode mapping. Some producers embed a subset font with arbitrary codes and omit the table that maps them back to characters. Selection works and the copied text is nonsense.
- Text in annotations and form fields. Comments, stamps and field values are not part of the page content and are not returned by extraction.
- Encrypted files. Content cannot be read until the password is entered.
OCR: how a scan becomes searchable, and where it falls short
Optical character recognition looks at the pixels of a scanned page, finds regions that look like lines of text, segments them into characters or words, and matches the shapes against models of letters in the languages it has been told to expect. The output is characters with positions and confidences. Writing that output into the PDF as invisible text over the image produces a searchable scan without changing the visible page.
OCR is the only route from pixels to text, and modern engines are very good on clean, printed, well-scanned pages. Its limits are worth knowing:
- Resolution and contrast. Around 300 dots per inch, dark text on a light background, is what recognisers expect. Low-resolution scans, faxes and photographs with shadows lose accuracy fast.
- Skew and layout. Pages scanned at an angle, multi-column layouts, tables and text wrapped around pictures cause missed lines and jumbled reading order.
- Fonts and languages. Unusual typefaces, handwriting, very small print and text in a language the engine has not been configured for degrade recognition.
- Silent errors. OCR does not know when it is wrong. A "0" read as "O", a "1" as "l" or a dropped line in a column of figures will not be flagged; it will simply be searchable under the wrong text. Anything that will be quoted, totalled or relied on should be checked against the image.
The tools on this site do not perform OCR; the text extractor reads whatever text layer exists and reports pages without one. To make a scan searchable, use OCR software or a scanner driver that offers it; merging, compressing and extracting afterwards all preserve the OCR layer because they never rasterise text.
Why scans are so much larger
The arithmetic of a scanned page explains the file sizes. An A4 page scanned at 300 dots per inch is roughly 2,480 by 3,508 pixels – about 8.7 million pixels. Even after JPEG compression, a page of colour or greyscale text costs hundreds of kilobytes, and a colour page with photographs can cost well over a megabyte. Pure black-and-white scans stored with fax-style compression are far smaller per page, which is why archive-grade scanners default to it for text.
A born-digital page is tiny by comparison. Its text is a few kilobytes of character codes and positions, and the fonts it uses are embedded once for the whole document rather than once per page. Dividing a file's size by its page count – the PDF page counter gives the count for many files at once – is a quick way to guess what you are dealing with before you open it. How to reduce PDF file size breaks down where the bytes in each kind of file go.
Compressing scans
Because a scan is almost entirely image, it is also where compression achieves the most. The Compress PDF tool reduces oversized JPEG and Flate images to a resolution suited to reading on screen and re-encodes them as JPEG at a moderate quality, and on a high-resolution colour scan that routinely removes most of the file. Text layers, whether born-digital or added by OCR, are never touched: the compressor does not rasterise text, so a searchable scan stays searchable after compression.
Some scans resist, and it pays to know why. Images stored as JBIG2 or CCITT – the bilevel formats used for black-and-white text scans – and JPEG 2000 images are left as they are, because a browser cannot re-encode them safely; they are usually compact already, so there is little to gain. CMYK and indexed-colour images are also left alone. Why PDF compression sometimes fails goes through each case.
The best compression happens at scanning time. Scan text in greyscale rather than colour unless colour carries meaning, at 200–300 dots per inch rather than 600, and trim dark borders with Crop PDF afterwards if the scanner left them – bearing in mind that cropping hides rather than removes content.
Accessibility
An image-only PDF is inaccessible to anyone who cannot see it. Screen readers have nothing to read, search finds nothing and text cannot be reflowed or enlarged as text. Web accessibility guidelines treat images of text as non-text content that requires a text alternative, and an OCR layer is the minimum that satisfies that requirement for a scan.
It is a minimum, not the goal. Accessible PDFs are also tagged: a structure tree records headings, paragraphs, lists, tables and reading order, and gives alternative text to pictures, so that a screen reader can navigate rather than read one undifferentiated stream. Tags come most reliably from the authoring application at export time; adding them to a scan afterwards is laborious. The PDF metadata viewer flags whether a document is tagged, which is a quick indicator of how much work accessibility will take. PDF versus JPG for documents makes the related case for producing PDFs from the source document rather than scanning a printout.
How to tell which kind you have
| Check | Image-only scan | Searchable PDF |
|---|---|---|
| Select text in a viewer | Nothing selects, or the whole page selects as one picture | Individual words highlight |
| Search for a word you can see | No results | Found |
| Run the text extractor | Pages flagged as having no text | Text returned page by page |
| Metadata viewer | Producer names a scanner or copier; not tagged | Producer names an office or layout application; often tagged |
Two caveats: crisp letters when you zoom in are not proof of a text layer, since outlined text zooms perfectly and extracts nothing; and a text layer is not proof of accuracy, since OCR text is only as good as the recognition that produced it. Read a paragraph of the extractor's output against the page and you will know both whether text exists and whether it can be trusted.
Working with each kind
Image-only PDFs are robust – there is nothing to break – and the page tools treat them like any other file: merging, splitting, reordering, rotating and cropping copy the images unchanged, and PDF to JPG gives you back something close to the original scan. Photos of documents converted with JPG to PDF are scans in every sense that matters here.
Searchable PDFs deserve one extra care: never rasterise them casually. Rendering pages to images and rebuilding a PDF from the result discards the text layer. Keep the searchable file as the master, compress it when size matters, and use the text extractor rather than retyping when you need the words.
Frequently asked questions
How do I make a scanned PDF searchable?
Run it through OCR software, which recognises the characters in the page images and writes them into the file as an invisible text layer. The tools on this site do not perform OCR; the text extractor reads an existing layer and flags pages that have none. Scan at around 300 dots per inch with good contrast first, because recognition accuracy depends heavily on the quality of the image.
Why can I see text in my PDF but not copy it?
Either the page is an image – a scan or a photo – in which case there are no characters to copy and OCR is needed, or the text was converted to vector outlines, or the embedded font lacks a mapping back to Unicode, which gives gibberish on copy. The text extractor identifies the first case by flagging image-only pages; the other two need the original document re-exported.
Does compressing a searchable PDF remove the text layer?
No. The compressor changes only raster images – downsampling and re-encoding them – and never rasterises or removes text, so a born-digital text layer or an OCR layer survives intact and the file remains searchable. The same is true of merging, splitting, reordering and rotating, which copy pages without re-rendering them.
Sources and further reading
About the author
HelpMeJPG editorial teamEditorial team
The people who build and maintain the HelpMeJPG tools. Guides are written from the tools' own behaviour and the standards they implement, and are revised whenever a tool changes.