What is a text layer?
The text layer of a PDF is the set of real characters stored in the file, as opposed to pictures of letters. It is what lets you search with Ctrl+F, select a sentence, copy it, or have a screen reader read it aloud. PDFs made from office documents have one automatically; scans do not.
Visible and invisible text
In a PDF exported from a word processor, the text layer is the visible text itself, drawn with embedded fonts. In a scanned document made searchable with OCR, the text layer is invisible: recognised words are placed exactly behind the image of each word, so the page looks unchanged while the text can be found and copied. This hidden arrangement is sometimes called a sandwich PDF.
How to check for a text layer
Open the PDF and try to select a word with the cursor, or search for a word you can see. If the selection highlights text and the search finds it, the page has a text layer. If the cursor draws a box over the whole page or the search returns nothing, the page is an image and needs OCR first. A text extractor gives the same answer: an empty result means no text layer.
Quality of the layer
An OCR text layer is only as good as the recognition. Errors are common with small print, handwriting, stamps and skewed photos, and they make searches miss words. Straight, well-lit scans at about 300 DPI give the best results. Detecting the document language first also helps, because the OCR engine needs to know which language to expect.
Tools that use this
Guides that put it into practice
Common questions
- Can a text layer contain errors even if the page looks perfect?
- Yes. In OCR files the visible page is the original image, while the hidden text comes from recognition and may contain mistakes.
- Does redaction keep the text layer?
- No. The free redaction tool outputs image-only pages, so the hidden words are gone. Run OCR afterwards if you need search again.
- Can I add a text layer to a phone photo?
- Yes. Convert the photo to PDF, then run OCR. Straighten and crop the photo first for better accuracy. Good lighting and a flat page make a big difference to the result.