Schema LawSign in with Google

How to Make PDF Text Searchable Inside Pictures and Stamps

By Schema LawPublished Updated

To make PDF text searchable when the file is typed but some words will not search, find the parts of each page that are pictures of text, run OCR so those pictures gain a hidden text layer, and then confirm that the typed text still searches exactly as it did before you started.

This is a narrower job than converting a scan. The typed part of the file already searches. The risk is that a word locked in a picture is the one somebody searches for, or that the repair spoils the text that was fine.

Search the typed body for the defendant and the docket number, and confirm those hits still agree with the page image. Then search a statute cited in a stamped notice, or a scanned exhibit label that sits in a picture. A complaint title in real text should keep finding. A notice locked in a letterhead image stays invisible until you recognize that picture.

Why is some text in a typed PDF not searchable?

Some text in a typed PDF is not searchable because it is not stored as text. A page can hold typed characters and pictures side by side, and words inside a picture are only pixels. Search reads the characters and skips the pictures, so a pasted screenshot, a logo or a stamped notice stays silent.

A PDF page is a container. When a word processor saves a letter as a PDF, the paragraphs go in as characters with fonts and positions. Anything that was a picture in the source document goes in as a picture. The program does not read the picture to see whether it happens to show words.

That leaves three kinds of content that can sit on one page of a typed PDF:

What is on the pageHow the file stores itDoes search find its words?
Paragraphs, headings, typed tablesCharacters with fonts and positionsYes
Screenshots, photographs, scanned inserts, picture logos, picture stampsA grid of pixelsNo
Lettering converted to outlines or curvesDrawn shapes with no charactersNo

Picture text gets into a typed document in ordinary ways. A letterhead is placed in the header as an image file. A paralegal pastes a screenshot of a text message thread into a declaration. A chart is copied from a spreadsheet and lands in the brief as a picture, axis labels and all. A signature block is scanned and dropped in. A filing system or a mailroom applies a received stamp as an image over the first page. None of these changes how the page looks, and none of them is text.

If the file began in Word, the choice between saving and printing to PDF also matters, and the post on converting Word to a searchable PDF covers that. If no word on any page can be selected, the whole file is a picture and the cause is different; see why you can't copy text from a PDF.

Spotting picture text on a page that otherwise selects normally

Select everything on the page and look for words that stay unhighlighted. Lettering that remains plain while the paragraphs around it turn blue is not text. Three further checks confirm it: click the item, search for a word from inside it, and paste the page into a text editor to see what is missing.

Run the checks in this order, because each one costs a little more effort than the one before.

  1. Select all. Click in the page and press Ctrl+A (Command+A on a Mac). Typed text highlights line by line. A picture either stays untouched or is covered by one flat rectangle.
  2. Click the item. With the selection tool, click once on the suspect area. A picture is selected as a single block with a border round it. Text lets you place a cursor between letters.
  3. Search a word from inside it. Pick a word that appears in the suspect area and nowhere else on the page. Search for it. No hit on that page settles the question.
  4. Paste the page. Copy the whole page and paste it into a plain text editor. Read the result against the page. Whatever you can see on the page and cannot find in the pasted text is a gap.

The post on how to see the text layer in a PDF goes further into reading what a file holds behind its pages.

A gap list for one document

Write the gaps down as you find them. Suppose you are reviewing a twelve-page demand letter from the fictional firm Marlowe Finch LLP to your client, Tessaly Freight. The letter is typed. Your gap list might read:

PageItemWords locked in the pictureSearch someone might run
1LetterheadFirm name, address, phoneNone that matters
1Received stamp"RECEIVED MAR 14"The date of receipt
4Screenshot of a message threadDriver's name, "I never signed for it"The driver's name; "signed"
7Invoice table pasted as a pictureInvoice numbers and amountsInvoice 20417; 18,450.00
12Scanned signature blockSigner's printed name and titleThe signer's name

The list does two things. It tells you which pages need recognition, and it gives you the exact words to search for afterwards to prove the repair worked.

Look closely at pages that carry exhibits inside the body of the document. A typed declaration that reproduces an email as a picture in the middle of page six will pass every casual test, because the paragraphs on either side of the picture select and search without complaint.

Can OCR add searchable text to the pictures without disturbing the typed text?

Yes, when the tool recognizes only the picture regions and leaves the existing characters alone. Whether your tool works that way is something to establish by test, because an OCR program meeting a page that already has text can do one of three things: skip the page, redo the whole page, or read only the pictures.

Each behaviour has a different consequence for a typed file with picture gaps.

What the tool does with a page that has textResult for the picture wordsResult for the typed words
Skips the page because text is presentStill not searchableUnchanged
Treats the whole page as an image and recognizes all of itSearchableReplaced by recognized text, or joined by a second copy of itself
Recognizes only the regions that are picturesSearchableUnchanged

The first behaviour looks like success because the tool finishes without an error. The second fixes the gap and can cost you accuracy everywhere else: typed characters that were exact are swapped for a reading of their picture, or a second layer is added so that copying a sentence gives you the sentence twice. The post on when OCR makes a PDF document worse explains that hazard in full.

You will not always find the behaviour described in a tool's settings. Establish it with one page:

  1. Take a single page that has both typed paragraphs and a picture with words in it.
  2. Search for one typed word and one picture word. Note the hit counts: one and zero.
  3. Run the page through the tool and open the result.
  4. Search again. One and one means the picture was read and the typed text kept. Two and one means a second layer was added. One and zero means the page was skipped.
  5. Copy a typed sentence from the result and compare it, character by character, with the same sentence copied from the source.

If the tool offers only whole-page recognition, you still have a route that leaves the typed pages alone. Extract the pages that have gaps into a separate working file, run recognition on those, and keep the result beside the typed source as a search aid, clearly named. The typed file stays the record. The working file exists so that a search for the driver's name reaches page four.

Text turned into outlines or curves by a design or print program

Outlined text is lettering stored as drawn shapes with no characters behind it. Design and print-preparation programs can convert type to outlines so that a page prints the same on a machine that lacks the font. The page stays sharp at any zoom, yet nothing selects, and OCR has to treat the page as a picture to read it.

Outlined pages are easy to misjudge, because they fail the zoom test that identifies a scan. Zoom to 800% on a scanned page and the letters turn soft and blocky. Zoom to 800% on an outlined page and the letters stay crisp, exactly as real text does. The difference shows only when you try to select a word and nothing responds.

Use this to sort a page that will not select:

At 800% zoom the letters areClicking the letteringWhat the page is
Soft, blocky, speckledSelects one large blockA picture
SharpPlaces a cursor and highlights wordsReal text
SharpDoes nothing, or selects a small odd shapeOutlines

You meet outlined lettering in material that passed through a designer or a print shop: brochures, annual reports, certificates, printed forms, title blocks on drawings, and logos that spell out a name. A whole document can be outlined, or only its headings and cover.

Two things follow for search. A tool that hunts for image objects on a page to recognize will find none on an outlined page, and may report that the page needs no work. And there is no text layer to fall back on, so the page is as silent as a photograph.

The repair, in order of preference:

  • Ask for a copy exported with live text. Whoever produced the file can export it again with the type left as type. That copy is searchable with no recognition and no risk of misreading.
  • Recognize the page as an image. Where no better copy exists, export the outlined pages as images at a resolution that keeps the smallest print legible, then run OCR on those images. The result is a picture of the page with hidden text behind it.

The second route changes what the page is made of. Keep the outlined file as you received it, and name the recognized version as a working copy.

Letterhead, screenshots, charts and stamped notices: which picture text is worth the work?

Fix picture text that someone will search for, quote or rely on, and leave the rest. A firm name in a letterhead adds little to a search. Words in a screenshot of a message, figures inside a pictured table, or a stamped date of receipt can decide whether a search finds the page at all.

Ask three questions of each item on your gap list.

  • Would anyone search for these words? Names, dates, amounts, account numbers and reference numbers are searched. Decorative lettering is not.
  • Do the words appear elsewhere on the page as typed text? A chart whose figures are repeated in the paragraph under it loses little by staying a picture.
  • Is the picture itself evidence? A screenshot of a message, a photographed sign or a reproduced email matters for what it says. Treat it as you would an exhibit.
ItemWorth making searchable?Reason
Letterhead and logoSeldomThe sender is named in the typed text and in the file name
Screenshot of messages or emailYesThe content exists nowhere else in the file
Chart with labelled axesDependsYes when the labels or figures are not repeated in the typed text
Table pasted as a pictureYesNumbers are the first thing a reviewer searches for
Scanned signature blockYes for the printed nameA search for the signer should reach the signature page
Received, filed or exhibit stampYes for the date or numberThe stamp may be the only record of that fact on the page
Watermark such as "DRAFT"NoIt repeats on every page and tells a search nothing

Stamps deserve a separate note. A stamp that sits on white space reads like any other small picture. A stamp that overlaps typed words is harder for recognition, and the result needs checking by eye. The post on whether OCR can read stamps over text covers what to expect.

A pictured table raises a different question. If you need the figures for arithmetic, a hidden text layer is the wrong target. Convert that page and export it to a spreadsheet, where each figure sits in its own cell. Schema Law reads pages into text and tables and offers Excel among its export formats on every plan.

Where the answer is "seldom" or "no" for every item, leave the file alone and note in the matter file that the letterhead and watermark are pictures. A short note costs less than a conversion, and it stops the next reader from assuming every visible word is searchable.

Making the picture text searchable and showing the typed text is unchanged

Work on a copy, record how the typed text searches before you begin, run OCR, then repeat the same searches and compare. The picture words should now be found, and every count you recorded for the typed text should be identical to the count you started with.

  1. Copy the file. Keep the PDF as received in a folder you do not work in.
  2. Record a baseline for the typed text. Choose five terms that appear only in typed paragraphs: a surname, a dollar amount, a date, a defined term and one long ordinary word. Search for each and write down the hit count. Note the page count. Copy one typed paragraph into a text file and save it.
  3. List the picture words you expect to gain. Take them from your gap list, one or two per picture.
  4. Run recognition. In Schema Law, sign in, upload the copy (PDF, PNG or JPEG, up to 20 MB) and wait for the pages to be read. The guide to making a scanned PDF searchable covers the basic procedure. Open the parsed pages for each page on your gap list and look for the picture words there. If they are missing from the parsed page, they will be missing from the export.
  5. Export a searchable PDF and save it under a new name, such as the original name with _ocr added.
  6. Repeat every search from steps 2 and 3 in the exported file, and copy the same typed paragraph again.
  7. Compare.

A finished comparison for the Tessaly Freight letter might look like this:

CheckBeforeAfterVerdict
Page count1212Same
"Tessaly" (typed)31 hits31 hitsSame
"18,450.00" (typed, page 3)1 hit1 hitSame
"indemnification" (typed)4 hits4 hitsSame
Typed paragraph, page 2, pastedSaved textIdenticalSame
Driver's surname (screenshot, page 4)0 hits2 hitsGained
"20417" (pictured table, page 7)0 hits1 hitGained
"RECEIVED" (stamp, page 1)0 hits0 hitsNot gained; note it

Read the verdicts this way. A typed count that doubled means a second text layer now sits behind the typed one. A typed count that fell, or a pasted paragraph that no longer matches, means typed characters were replaced by recognized ones. A picture word that is still at zero was not read, or was read wrongly; look at it on the page and decide whether a note in the file is enough.

The free plan handles one document a day of up to three pages, so you can run this whole comparison on your worst three pages before deciding anything about the full file. The pricing page lists the page limits on the other plans.

Keep the comparison with the working copy. If the recognized file is ever sent outside the office, say in the cover note that it is an OCR copy of a typed original and that the typed original is the authoritative one.

All posts in Searchable PDFs