Scanned PDF Has Garbled Text? How to Fix Bad OCR Automatically

Recently, a user asked me how to access a poorly scanned PDF from the Internet Archive. The pages themselves were readable, but extracting the text produced mostly garbage.

At first, this sounds like a straightforward OCR problem: if a PDF contains scanned images instead of text, run optical character recognition (OCR) on it.

But this particular problem is more interesting.

The PDF already contains text. It is just the wrong text.

Many scanned books and documents contain two versions of each page: the visible scanned image and an invisible text layer generated by OCR. If that old OCR process produced poor results, the PDF may technically contain text even though that text is almost useless.

This creates problems for PDF readers, text extraction software and, importantly, accessibility and text-to-speech applications.

The Hidden Problem: A PDF Can Contain Text That Is Unreadable

A typical scanned PDF can be thought of as having two layers:

  • The page image — what you see when you open the document.
  • The OCR text layer — text recognized from that image, which software can search, copy, extract or read aloud.

When OCR works well, this is an excellent arrangement. You retain an image that resembles the original document while gaining searchable and accessible text.

But OCR is not always good.

This is particularly noticeable with older digitized books, unusual fonts, degraded originals, complex layouts and documents processed using older OCR technology. The scanned image may remain quite readable to a human while the associated OCR text is badly corrupted.

The result is a strange kind of PDF: it has a text layer, but that text layer can be worse than having no text at all.

Why PDF Apps Don’t Simply OCR the Document Again

There is a good reason most software doesn’t automatically perform OCR on every PDF.

OCR is considerably more computationally expensive than extracting text that is already embedded in a document. So an application can first ask a seemingly sensible question:

Does this PDF already contain text?

If the answer is yes, there normally isn’t a reason to run OCR.

Unfortunately, that asks the wrong question for a document with a broken OCR layer.

A better question is:

Does this PDF contain text that actually makes sense?

This distinction is important because some OCR tools deliberately avoid processing pages that already contain text. More specialized software can provide options to redo or force OCR, but that requires the user to recognize the problem and know which OCR mode to select.

For an ordinary reader, that isn’t a particularly good solution.

Why Bad OCR Is an Accessibility Problem

This isn’t merely an inconvenience when copying text from an old book.

It is also an accessibility problem.

A sighted reader looking at the PDF can ignore its defective text layer. They see the scanned image and can read the words printed on the page.

A text-to-speech application works differently. If it sees that the PDF contains text, it may reasonably assume that this is the content it should read.

Instead of hearing the book, the listener can end up hearing nonsense generated from a corrupt OCR layer.

That means making scanned documents accessible requires more than detecting the presence of text. Software also needs to consider whether the available text is actually usable.

How Speech Central Detects Bad OCR Automatically

This is an edge case that Speech Central is designed to handle automatically.

Speech Central doesn’t simply check whether characters can be extracted from a PDF. It also analyzes the extracted content at the semantic, word level.

In other words, it considers whether the extracted content resembles meaningful text.

If the existing PDF text is significantly abnormal, Speech Central concludes that the embedded text layer isn’t reliable. It then re-OCRs every page of the document rather than reading the broken text layer.

From the user’s perspective, there is no need to find a “force OCR” option, remove the old OCR layer, convert the PDF to images or understand why the PDF is behaving strangely.

The process is automatic.

Conceptually, it works like this:

  1. Speech Central extracts the existing text from the PDF.
  2. It evaluates that text at the word level to determine whether it appears meaningful.
  3. If the existing text is usable, Speech Central can use it normally.
  4. If the text is significantly abnormal, Speech Central treats the existing OCR as unreliable.
  5. It re-OCRs the pages and uses the newly recognized content instead.

This solves an important problem that a simple “does this PDF contain text?” test cannot solve.

Re-OCR Is Usually a Huge Improvement

The difference can be dramatic.

With the problematic documents that trigger this behavior, the original embedded text is often so corrupted that it is difficult to recognize what it was supposed to say.

Re-OCR isn’t magic, of course. Difficult scans can still produce recognition errors.

However, even when the newly recognized text isn’t perfect, it is typically coherent enough that a human listener or reader can infer the intended text from context. That is very different from an OCR layer in which much of the original content is effectively unrecognizable.

For reading a book or document aloud, that difference can turn an unusable PDF into an accessible one.

OCR With Apple Vision — On Your Device

On iOS and macOS, Speech Central uses Apple’s Vision technology for this OCR process.

There is an important consequence beyond recognition quality: the OCR processing is private and happens on the device.

Your scanned document doesn’t need to be uploaded to an external OCR website or sent to a remote OCR service just to extract its text.

This can matter for any document, but it becomes particularly important when OCR is used with private, personal or otherwise sensitive material.

It also fits the purpose of an accessibility tool particularly well: opening and listening to a document shouldn’t inherently require sending that document somewhere else for processing.

What About Internet Archive PDFs?

The Internet Archive contains an extraordinary collection of digitized books and historical documents. Inevitably, documents created across different periods, sources and digitization processes vary in scan and OCR quality.

Sometimes the scanned page image contains much more useful information than the text layer accompanying it.

If you encounter an Internet Archive PDF that looks readable but produces garbled text when you copy, extract or try to listen to it, the scan itself may not be the problem.

The PDF may simply contain a poor existing OCR layer.

In that situation, performing OCR again from the page images can produce substantially better results.

Speech Central Goes Beyond OCR

Re-OCRing a difficult PDF solves the text extraction problem, but that is only the beginning of the reading workflow.

The reason this capability exists in Speech Central is that Speech Central isn’t primarily an OCR utility. It is a comprehensive text-to-speech and reading application.

Once useful text has been extracted, Speech Central provides a versatile set of tools for consuming that content aloud.

It is designed to work with many kinds of reading material rather than requiring a separate workflow for every format. That includes documents, PDFs, web content, books and other textual sources, with extensive controls for turning that content into a practical listening experience.

This distinction matters for accessibility.

Extracting text is not the final goal. Making the information usable is.

OCR is therefore one part of a larger process: obtain meaningful text from the source, make it accessible, and provide the tools needed to efficiently consume that information through speech.

A Small PDF Edge Case With a Bigger Lesson

There is a broader software-design lesson in these problematic PDFs.

A document containing text doesn’t necessarily contain useful text.

Software can look at the technical structure of a file and reach a perfectly logical but incorrect conclusion: text exists, therefore OCR isn’t necessary.

Sometimes software needs to go one step further and evaluate the quality of what it has found.

For scanned PDFs with broken OCR layers, Speech Central does exactly that. It checks whether the extracted words make sense and, when they don’t, automatically goes back to the original pages and tries again.

There is no OCR setting to discover and no manual document conversion required.

For the user, it can be as simple as opening a document and listening to it.


Download Speech Central

The automatic PDF re-OCR functionality described here is currently available in Speech Central on iOS and macOS.

iPhone and iPad:
Download Speech Central on the App Store

Mac:
Download Speech Central for macOS on the App Store

Frequently Asked Questions

Why does my scanned PDF contain garbled or nonsense text?

A scanned PDF may contain an invisible OCR text layer in addition to the visible page images. If the OCR that created this layer performed poorly, the PDF can look correct while copied, extracted or spoken text appears garbled.

Can I OCR a PDF that already contains text?

Yes. This is sometimes called re-OCRing or forcing OCR. The challenge is that some software sees the existing text layer and assumes OCR is unnecessary. Speech Central can automatically detect significantly abnormal existing text and re-OCR the document.

Why won’t OCR software recognize my scanned PDF?

One possible reason is that the PDF already contains an OCR-generated text layer. Some OCR software avoids processing documents or pages that it detects as already containing text, even when the existing recognition is poor.

Can Speech Central read scanned PDFs aloud?

Yes. On supported Apple platforms, Speech Central can use OCR when necessary to obtain text from scanned PDF pages and then make that content available through its text-to-speech reading features.

Does Speech Central upload PDFs for OCR?

No. On iOS and macOS, the OCR described here uses Apple’s Vision technology and is performed privately on the device rather than requiring the document to be sent to an external OCR service.

Can this help with poorly OCRed Internet Archive books?

Yes. If a downloaded PDF has readable scanned page images but its embedded text is badly corrupted, re-OCRing the page images can recover much more usable text. Speech Central can detect this situation automatically when the existing text is sufficiently abnormal.