Free Tool Desk

Guide

The Searchable PDF: How an OCR Text Layer Works and How It Fails

Last updated October 7, 2026

A scanned page is a photograph of text. To make it searchable, an OCR program recognises the words and adds them back as text, invisibly, on top of the picture. Search, copy, selection and screen readers then work on that text while your eyes see the picture. It is a clever trick, and it has one fragile requirement: the hidden text must sit where the words are in the image.

How the layer is built

PDF can draw text in several modes. Mode 3, "neither fill nor stroke", draws nothing (ISO 32000-1, clause 9.3.6). OCR programs put each recognised word or line on the page in that invisible mode, at the position and size where it was found in the picture, often squeezed or stretched horizontally so its width matches the word in the scan. Because it is invisible, a misplaced layer does not show as an error when you look at the page.

How it fails

  • Offset. The whole layer is shifted, often by a margin or by a cropped or deskewed picture whose text was not moved with it. Search highlights land beside the words.
  • Rotation. The page was recognised in one orientation and displayed in another, so the layer is turned 90 or 180 degrees against the picture.
  • Scale. The picture was resized but the layer was not, so the layer drifts across the page.
  • Partial coverage. Some regions were not recognised at all, so part of the page cannot be found or selected.
  • Wrong text. The layer sits in the right place but the letters are misread. That is a recognition problem, not an alignment problem.

Measuring alignment honestly

The PDF OCR Layer Alignment Checker measures the first four problems by overlap. It renders each page, so only the picture is shown, and compares the boxes of the hidden text with the dark pixels. The page score is the share of boxes that sit on ink. It also slides the layer around the page and turns it by quarter turns to see whether another position fits clearly better, and reports an offset in millimetres or a rotation only when the improvement is clear. It does not recognise words and says nothing about spelling. When the picture is a photograph, very faint, handwritten or evenly dark, overlap cannot show alignment, and the tool reports "inconclusive" or "not applicable" instead of inventing a number.

You can see the result for yourself: the overlay view draws the boxes on the page, green where they sit on ink and red where they do not.

What to do about a misplaced layer

  • Run OCR again on the original scan, with the correct page orientation, rather than on an already processed copy.
  • If you deskew, crop or resize pages, let the OCR program do it as part of the same step so the layer follows the picture.
  • Check how the text itself copies with the PDF Copy-Paste Text Health Checker, since a good position does not help if the font mapping is broken.
  • For Bangla documents, Bangla OCR reads Bangla and English text from images and says how unreliable it can be.

To judge how much of a page is text and how much is picture before you start, the PDF Text Density Checker gives a quick answer. See also the guide to text extraction and OCR.