Make a Scanned PDF Searchable
Operator: Abdulla Al Fahad. How tools are built and checked
A scanned PDF is a stack of pictures. Your viewer shows words, but there are no words in the file, so Ctrl+F finds nothing and a drag across a paragraph selects nothing. This tool reads each page with OCR and writes the recognised words into the PDF as invisible text, placed exactly over the printed ones. The page still looks like the scan; it just behaves like a document.
It differs from the Image to Text (OCR) tool on this site, which hands you the text and discards the page. Here the page stays and the text rides along under it. You can feed it one scanned PDF or several photos (PNG, JPG, WEBP), and each photo becomes a page.
Key features
- One scanned PDF edited in place, or several photos and PDFs combined into a new file
- 17 languages, up to three at once, with the language data cached after the first download
- Page range for a single PDF, and an option to skip pages that already have text
- Invisible text in render mode 3, stretched to each word's box so selection and search highlights line up
- Progress per page with a Cancel button that stops the engine
- A search box on the result that shows which pages contain a word, before you download
How the invisible text layer is placed, and which scripts become searchable
Recognition is Tesseract's LSTM engine running in your browser, in one to three languages at once from a list of 17. PDF pages are drawn at 200 DPI before reading; photos are scaled so the longest side is at most 4,000 pixels. A run is limited to 40 pages in total, because each page takes several seconds and the worker's memory grows as it goes.
For every word the engine returns a box in pixels. The tool converts the box to points using the page's displayed width, then writes the word with PDF text rendering mode 3, which draws nothing but keeps the text selectable. Each word is set in Helvetica with a horizontal stretch chosen so the font's own width for that word equals the width of its box. That is why a highlight made by a viewer's search lines up with the printed word rather than drifting along the line.
Words the engine itself rates below 30 percent confidence are not written, so junk from smudges and stamps does not fill search results. The text layer uses the standard Helvetica font and its WinAnsi encoding. Latin letters with accents, digits and common punctuation are encoded; characters such as Cyrillic, Greek, Arabic, Devanagari and Chinese, Japanese and Korean cannot be, so words that are mostly made of them are left out and counted in the result. The page images for those scripts are untouched.
When the input is a single PDF it is edited in place: your original page images, bookmarks and form fields stay as they were, and only a text layer is appended to the chosen pages. Pages that already have 25 or more selectable letters are skipped by default. Photos are different: each is re-saved as JPEG at 92 percent quality and drawn on a page sized at 150 pixels per inch, so a 1,240-pixel-wide photo makes an A4-wide page.
How it works
For each target page the tool draws a canvas, hands it to Tesseract, and receives lines of words with pixel boxes and confidences. A line's height gives the font size (the box spans about 94 percent of the em), and the baseline sits 20 percent of the size above the box bottom to leave room for descenders.
The words of one page become a single text object in a content stream appended after the page's own drawing. A space is added after each word except the last on a line, so copied text reads as words instead of one long string. The stream is wrapped in a graphics-state save and restore and applies the page's rotation and crop box, so a page marked as rotated by 90 degrees still gets text that runs along the printed lines.
Common use cases
- Making a scanned tenancy agreement searchable so a clause can be found by keyword
- Turning a phone-photographed handout into a PDF whose text can be pasted into notes
- Preparing a scanned book chapter for a reader that highlights search results
- Giving a scanned invoice batch a text layer so a document manager can index it
How to use this tool
- Drop the scanned PDF, or several photos, onto the input box.
- Tick the language the text is written in; add a second if the page mixes two.
- For one PDF, type the pages to read, such as 1-3, 7, or leave it blank for all.
- Press Make searchable and wait; the first run also downloads the language data.
- Check the summary and try a word in the search box.
- Download the PDF; it is named after the first file with -searchable added.
Example
A 6-page scanned lease in English, pages 1 to 5 scanned and page 6 a pasted-in typed schedule
File lease-scan.pdf, 6 pages, 11.4 MB
Language English
Pages blank (all)
Skip text onWhat the result reports
Page 6 has 310 selectable letters, so it is left alone.
Pages 1-5 are read at 200 DPI: 2,940 words written, 37 below 30% confidence skipped.
Search 'deposit' -> page 2: 3 matches, page 4: 1 match.
Output lease-scan-searchable.pdf, slightly larger than the inputTips for best results
- Pick the language of the text, not of your interface; reading French with the English model turns every accented letter into a guess.
- Scans of 200 to 300 DPI read best. A 72 DPI screenshot of a PDF reads poorly because the engine sees letters about 8 pixels tall.
- If a page was scanned crooked, straighten it first; a skew over a few degrees makes the stretch-to-box widths uneven.
Common pitfalls
OCR is a guess. Names, account numbers and amounts can be misread, and a misread word will not be found by search; keep checking against the image.
The text layer is invisible, so selecting a word shows a highlight over the picture, not the characters themselves. If the scan is misread, what you copy is also wrong.
Photos become JPEG pages at 150 pixels per inch. A very large photo is scaled to at most 4,000 pixels on its long side before it is read and stored.
Low-confidence words are dropped, so very faint text can be missing from search while still visible to a human.
Common errors and how to fix them
- "The OCR engine could not start"
- The engine and language data are fetched from a public CDN the first time. Check your connection or any content blocker, then run again; once cached, later runs work without the download.
- No readable words found on a page
- The page is blank, a drawing, or too faint or small. Rescan at 300 DPI in grey or colour rather than a harsh black-and-white threshold.
- Words in a non-Latin script are missing from search
- The standard PDF font cannot encode them, so they are counted and left out of the text layer. The page image is unchanged; use the Image to Text tool if you need that text as a Word file.
- "That is N pages; the limit is 40 per run"
- Use the page range to do the file in parts, or split the PDF and run each piece, then merge the results.
Best practices
- Run a short range first, such as the two worst pages, to see the language and quality before committing all 40.
- Choose all the languages a page really contains, but no more than needed: each extra one slows reading and can add wrong guesses.
Why the text is stretched rather than sized
The standard Helvetica font has fixed character widths, and a printed word in a different typeface will never match them. Choosing a font size to match the word's width would make a short word with wide letters the wrong height. Instead the size comes from the height of the line and the width is matched with a horizontal scale, anywhere from 0.1 to 10 times, which keeps selection rectangles the same size as the printed words.
What a half-scanned file looks like
Reports often mix typed pages with scanned attachments. Reading the typed pages would add a second, slightly different copy of text that already exists, and double matches in search. The skip option checks each page's existing text with the PDF text extractor and leaves any page with 25 or more selectable letters alone, so only the scanned pages are read and the summary lists which pages were skipped.
Frequently asked questions
Does it change how my scan looks?
No. For a PDF the page content is not touched; the text is added on top as an invisible layer. Photos are the exception because they have to be placed on new pages and are re-saved as JPEG.
How big are the language downloads?
The OCR engine is a few megabytes and each language adds roughly 2 to 15 MB, fetched once from a public CDN and cached by your browser.
Can I make a Word file from the result instead?
Not here. This tool keeps the page and adds text under it. For text you can edit, use the Image to Text (OCR) tool, which exports TXT or Word.