OCR & Document AI
How to Find Out if a PDF Is OCR'd or Just a Scanned Image
Check in seconds whether a PDF has a real text layer or is only a scanned image: a quick search test, Acrobat's Fonts tab, command-line tools, and a script that checks whole folders page by page.
- Published
- 9 min read
Table of Contents
- What does it mean for a PDF to be OCR'd?
- What's the fastest way to check a single PDF?
- How do you check in Adobe Acrobat?
- How do you check from the command line?
- How do you check thousands of PDFs automatically?
- Which PDFs fool the usual checks?
- What should you do if your PDF isn't OCR'd?
- When is OCR alone not enough?
- Get a free document AI feasibility check
Two PDFs can look identical on screen and behave completely differently. In one you can search, copy text and pull data out automatically. The other is a photo of a page: to a computer it's pixels, and every word in it is invisible until it goes through OCR (optical character recognition).
Knowing which kind you have decides whether search will find the document, whether a screen reader can read it, and whether an extraction pipeline will get data or an empty string. This guide shows how to check a single file in seconds, how to check thousands of files automatically, and what to do when a PDF turns out to be a scan.
What does it mean for a PDF to be OCR'd?
A PDF can hold text as real characters, as an image, or both. That gives three kinds of PDF you'll meet in practice:
- Text PDF (born digital): exported from Word, a browser, an accounting system or a design tool. The text is stored as characters with fonts, so it's searchable without any OCR.
- Scanned PDF, no text layer: made by a scanner or phone app. Each page is a single image. Nothing in it can be searched or copied until OCR runs.
- Scanned PDF with OCR: the page is still an image, but OCR software has added an invisible text layer behind it, word by word in the right place. It looks like the scan and searches like a text PDF.
| Text PDF | Scanned, no OCR | Scanned with OCR | |
|---|---|---|---|
| What a page contains | Text and vector graphics | One full-page image | Full-page image plus a hidden text layer |
| Search (Ctrl+F) | Works | Finds nothing | Works, as well as the OCR read the page |
| Copy and paste | Exact text | Nothing, or the whole page as a picture | Text, possibly with OCR mistakes |
| Fonts listed in the file | Yes | No | Usually one font used only by the hidden text |
| Ready for data extraction | Yes | No, needs OCR first | Yes, if the OCR quality is good |
The cover image of this article shows all three. It's the same invoice saved three ways, and the checks below tell them apart.
What's the fastest way to check a single PDF?
Open the PDF, press Ctrl+F (Cmd+F on a Mac) and search for a word you can clearly see on the page, such as a name or a total. Then try to select a sentence with the mouse.
- Search finds the word and the text highlights line by line: the PDF has a text layer. It's either a text PDF or a scan that has already been OCR'd.
- Search finds nothing and dragging draws a box over the whole page: it's an image-only scan and needs OCR.
- Search works on some pages and not others: it's a mixed document. This is common when scanned signature pages or attachments are added to a typed contract.
One caution: recent versions of macOS Preview can select text in images using Live Text, which recognises the text on screen when you open the file. That can make a scan look selectable even though the PDF itself has no text layer. If it matters, confirm with one of the checks below, or with search in a different viewer.
How do you check in Adobe Acrobat?
In Acrobat or the free Acrobat Reader, open File › Properties and choose the Fonts tab. Text is drawn with fonts, so a PDF with a text layer lists at least one font there. An image-only scan lists none.
This tells you about the file as a whole, not every page. A scanned document with a single typed cover page will still list fonts. Use the search test on a few later pages, or the page-by-page script further down, when the answer has to be exact.
If the file turns out to be a scan, Acrobat Pro's Scan & OCR tool can add the text layer. Reader can't.
How do you check from the command line?
The free poppler-utils package (on Linux through the package manager, on a Mac with Homebrew: brew install poppler) has three small tools that answer the question for any number of files:
- pdffonts file.pdf lists every font the PDF uses. An empty list, just the column headings, means no text layer.
- pdftotext file.pdf - prints the PDF's text. Blank output, or only a few stray characters, means there is nothing to search.
- pdfimages -list file.pdf lists the images on each page with their size and resolution. One page-sized image per page, typically at 200 to 300 ppi, is the signature of a scan.
Together they settle all three cases: fonts and no page-sized images is a text PDF, page-sized images and no text is a scan that needs OCR, and both is a scan that has been OCR'd.
How do you check thousands of PDFs automatically?
When documents arrive in bulk, such as invoices from suppliers, scanned archives or claim files, you want a verdict per page before anything goes into an extraction pipeline. We use a short Python script built on the open-source pypdf library. For each page it measures two things:
- How much text can be extracted. Fewer than about 25 characters means there's no usable text layer. Page numbers and stamps alone don't count.
- Whether one image covers most of the page. The script watches where each image is drawn and how big it is. An image covering 60% or more of the page means the page is a scan or a photo.
Those two answers combine into a verdict for the page. Here is the script's real output on the three invoices from the cover image:
| File | Text characters | Full-page image | Verdict |
|---|---|---|---|
| text-pdf.pdf | 348 | No | Text PDF, no OCR needed |
| scanned-pdf.pdf | 0 | Yes | Scanned, needs OCR |
| scanned-with-ocr.pdf | 303 | Yes | Scanned, already OCR'd |
Checking page by page matters. A 40-page contract can be 38 pages of text and two scanned signature pages, and a file-level check would call the whole thing searchable.
Which PDFs fool the usual checks?
The checks above are right for the vast majority of files. These are the cases worth knowing about before you automate anything:
- Poor OCR. A scan can have a text layer that's mostly wrong: misread numbers, merged words, columns read across instead of down. It passes every "has text" test. Copy a paragraph and a few amounts and compare them with the image.
- Text that extracts as gibberish. Some PDFs draw characters with fonts that have no mapping back to real letters, so search fails and copied text comes out as symbols even though fonts are listed. For a computer this is no better than a scan, and OCR is the fix.
- Text PDFs on a full-page background image. Letterheads, certificates and some forms put typed text on top of a page-sized image. They look like an OCR'd scan to an automatic check, and they don't need OCR either way.
- Mixed documents. Typed pages with scanned attachments, signature pages or handwritten notes. Always check per page.
- Handwriting. Standard OCR reads print well and handwriting poorly. A handwritten form that has been "OCR'd" may have a text layer that's mostly empty or wrong.
What should you do if your PDF isn't OCR'd?
Add the text layer before you search, archive or extract from it. Which tool to use depends on how many documents you have and where they can be processed:
- A few files: Adobe Acrobat Pro's Scan & OCR tool adds a searchable text layer and keeps the page looking the same.
- Many files, on your own servers: OCRmyPDF is free and open source and uses the Tesseract OCR engine. Running ocrmypdf --skip-text input.pdf output.pdf OCRs only the pages that don't already have text, which is exactly what mixed documents need.
- Large volumes or difficult layouts: cloud services such as Google Document AI, Amazon Textract and Azure AI Document Intelligence return text along with its layout, tables and form fields.
OCR quality is decided mostly at scanning time. Scan at 300 dpi, keep pages straight, and avoid heavy compression: a blurry 150 dpi phone photo of a crumpled receipt loses characters that no software can recover afterwards.
When is OCR alone not enough?
OCR turns pixels into text. It doesn't know that one number is the invoice total and another is the VAT number, or that a table continues on the next page. If the goal is to get specific fields into an ERP or a database, you need document AI on top of OCR: models that find fields, read tables and assign each value to the right place.
That step needs the same discipline as any computer vision model. A set of documents is labelled by hand into a checked golden dataset, extraction is measured against it field by field, and low-confidence fields go to a person instead of straight into a system. Read What Is Data Annotation? for how that data is prepared, and AI Agents vs Chatbots for what happens when an agent acts on extracted data.
We build OCR and document extraction pipelines for invoices, forms, IDs and scanned archives as part of our AI and computer vision services.
Get a free document AI feasibility check
Have scanned documents you need to search or extract data from? Send us a few samples for a free feasibility check and we'll tell you what can be automated and how accurately.
