Check 17.12 · Videos, PDFs and multimedia

Check that PDFs contain selectable text

Spot scanned PDFs or PDFs with unreadable text using pdffonts and pdftotext, then fix them by re-exporting the source file or running OCR with Acrobat or OCRmyPDF.

Priority
Complementary
Difficulty
Easy
Estimated time
30 min to 2 h
Free, no account: your progress is saved in this browser.

Ask an AI to check this point on your site

Opens the assistant with a ready-made question: this check, its goal and your site URL.

For Gemini, Copilot or another assistant, copy the question. The link opens the chosen service directly: nothing goes through this site.

In short

A PDF has selectable text when its pages contain real characters, not just an image of the page. Check every public PDF: if the text cannot be selected, searched or copied correctly, re-export it from the source file or apply optical character recognition (OCR). Expected result: every public PDF returns complete, readable text when converted to plain text.

Why it matters

Search engines do not “see” a PDF: they extract its text. There are three possible situations:

  • Native PDF: exported from Word, LibreOffice, Google Docs or layout software. The text is there and extraction is reliable.
  • Image PDF: a scan, a photo of a document, a page “printed as an image”. There are no characters, only pixels. Google says it can apply OCR to images of text, but the result is neither guaranteed nor controllable, and other crawlers do not necessarily do it.
  • PDF with broken text: the text can be selected but comes out as gibberish when copied and pasted (“Ĝƌ ƚŚĠ”), because the font does not embed the mapping to Unicode characters. For a search engine, it amounts to nonsense.

A PDF with no usable text cannot rank for what it contains, cannot be cited by a generative engine, and remains unreadable for a screen reader. It is also an accessibility requirement: WCAG asks for text rather than images of text.

What it improves

  • Indexing The PDF's content becomes readable by Google, Bing and generative engine crawlers.
  • Snippets and titles The search engine can display a relevant snippet instead of empty or incorrect text.
  • AI citations Extractable text is a prerequisite, not a guarantee.
  • Accessibility Screen readers, zoom, searching within the document, copy and paste.
  • File size A PDF re-exported from the source is often much lighter than a scan.

How to check

Manual test, two minutes per file:

  1. Open the PDF in Acrobat Reader or Firefox's viewer.
  2. Press Ctrl+F (Cmd+F on a Mac) and search for a word visible on a page: it must be found.
  3. Select a paragraph, copy it and paste it into a text editor: it must come out identical, accents included.

Warning: some recent viewers, such as Preview on macOS, recognize text in images on the fly. Selection works there even when the file contains no text at all. Confirm with the command-line method below.

Command-line test, with the free Poppler utilities (brew install poppler on macOS, sudo apt install poppler-utils on Debian and Ubuntu):

pdffonts document.pdf

A native PDF lists at least one font. An image PDF only shows the two header lines:

name                                 type              encoding         emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------

The uni column shows whether the font provides a Unicode mapping table. A no is not necessarily a problem (standard encodings such as WinAnsi or MacRoman do without one), but combined with a custom encoding (Custom, Identity-H), it signals a risk of broken text: confirm with a copy and paste.

pdftotext -l 3 document.pdf - | head -40

Compliant result: the first three pages come out as readable text, in reading order, with correct accents.

How to implement

Step 1 — Check all PDFs in bulk

List the public PDFs from the server, a crawl or the CMS media library (see optimize public PDFs (opens in a new tab)), then run this script, saved as verifier-pdf.sh:

#!/usr/bin/env bash
# Usage: bash verifier-pdf.sh file1.pdf file2.pdf ... > rapport.tsv
printf 'file\tfonts\tfonts_without_unicode\tchars_3_pages\n'

for f in "$@"; do
  fonts=$(pdffonts "$f" 2>/dev/null | tail -n +3 | wc -l | tr -d ' ')
  nouni=$(pdffonts "$f" 2>/dev/null | tail -n +3 | awk '{print $(NF-2)}' | grep -c '^no$')
  chars=$(pdftotext -l 3 "$f" - 2>/dev/null | tr -d '[:space:]' | wc -m | tr -d ' ')
  printf '%s\t%s\t%s\t%s\n' "$f" "$fonts" "$nouni" "$chars"
done
find /var/www/example/public -iname "*.pdf" -print0 | xargs -0 bash verifier-pdf.sh > rapport.tsv

Open rapport.tsv in a spreadsheet and sort:

Result Diagnosis Action
fonts = 0 Image PDF (scan) Re-export from the source, otherwise OCR
fonts > 0, chars_3_pages very low Pages mostly images, text limited to headers Check visually, OCR the image pages
fonts_without_unicode > 0 Risk of broken text Copy and paste a paragraph to confirm, then re-export
Normal values Native PDF Check a random excerpt

In WordPress, PDFs are in wp-content/uploads/. Without SSH access, download them via FTP or from the host's File Manager and run the script locally.

Step 2 — Re-export from the source file

This is always the best fix: exact text, smaller file, structure preserved.

  • Word (Windows): File > Save As, PDF type, Options, check “Document structure tags for accessibility”.
  • Word (Mac): File > Save As, PDF format, option “Best for electronic distribution and accessibility”.
  • LibreOffice: File > Export As > Export as PDF, check “Tagged PDF (add document structure)”.
  • Google Docs: File > Download > PDF Document.
  • Layout software (InDesign, Affinity, Canva…): export to PDF without converting text to outlines or flattening the document. Outlining fonts, sometimes requested by printers, removes all the text: keep a “print” version and a “web” version.

Do not use “Print as image” or a scanner to produce a PDF from a digital document.

Step 3 — Apply OCR when the source no longer exists

For a paper document or a scanned archive, OCR adds an invisible text layer beneath each page's image.

With Adobe Acrobat Pro. Open the “Scan & OCR” tool, then the text recognition command on the open file. Choose the document's language. Then review the words flagged as suspect with the function for correcting recognized text. Exact labels vary with the Acrobat version. Acrobat Reader, which is free, does not do OCR.

With OCRmyPDF, free and open source (macOS, Linux, Windows via WSL):

# Installation
brew install ocrmypdf tesseract-lang          # macOS
sudo apt install ocrmypdf tesseract-ocr-fra   # Debian, Ubuntu

# OCR in French, pages that already have text left untouched
ocrmypdf -l fra --skip-text --deskew --rotate-pages scan.pdf document-ocr.pdf

# Bilingual document
ocrmypdf -l fra+eng --skip-text scan.pdf document-ocr.pdf
  • --skip-text skips pages that already have text (recent versions also offer --mode skip).
  • --deskew straightens pages scanned at an angle, and --rotate-pages fixes the orientation.
  • --redo-ocr redoes an existing poor-quality OCR; --force-ocr rasterizes and redoes everything, to be kept for desperate cases because it also turns native text into an image.
  • For an entire folder: for f in scans/*.pdf; do ocrmypdf -l fra --skip-text "$f" "ocr/$(basename "$f")"; done.

Good to know: OCR does not fix broken text (fonts with no Unicode mapping), since the page already contains text. In that case, re-export from the source, or force OCR and accept losing the native text.

Step 4 — Check the quality of the result

OCR always makes mistakes. Before replacing the file online:

  1. Run pdftotext again and read the key pages: headings, figures, product names, amounts, references.
  2. Look for the classic confusions: l and 1, O and 0, rn and m, lost accents.
  3. Check the reading order of documents in columns: pdftotext -layout shows the layout; without the option, the text must follow the logical order.
  4. For a document intended for the public, test accessibility with PAC (PDF Accessibility Checker), which is free, or with Acrobat Pro's accessibility checker.

Then replace the file at the same URL, purge the CDN cache and request a recrawl through URL inspection in Search Console. For critical figures (prices, specifications), also publish them in HTML: see offer an HTML version of critical resources (opens in a new tab).

Step 5 — Prevent the problem from coming back

  • Add a “selectable text checked” line to the document publishing procedure.
  • Forbid uploading scans without OCR, and always ask suppliers (printer, agency) for the source file.
  • If a department often publishes PDFs, run the Step 1 script every month on recent files.

Common mistakes

  • Testing only in Preview on a Mac: on-the-fly recognition gives the illusion that text is present.
  • Publishing the outlined “print” version supplied by the printer: no fonts, no text.
  • Using --force-ocr by default: native text becomes an image and then approximate OCR.
  • Not proofreading the OCR: a misrecognized price or reference becomes false information, indexed and potentially picked up by a generative engine.
  • Choosing the wrong OCR language: accents and French words are poorly recognized with the English model alone.
  • Publishing the fixed PDF at a new URL: the old scan stays indexed and existing links point to it.

Frequently asked questions

How can I tell whether a PDF is scanned or contains real text?

To find out whether a PDF contains real text, search for a visible word with Ctrl+F in Acrobat Reader or Firefox, then copy and paste a paragraph into an editor. On the command line, pdffonts lists the document's fonts: no fonts means the pages are images, so a scan. pdftotext then lets you read the extracted text and judge its quality.

Can Google read a scanned PDF?

Google says it can apply optical character recognition to PDFs whose text is in image form. However, the result is neither guaranteed nor verifiable on your side, and other search engines or AI crawlers do not necessarily make that effort. To be sure the content is understood, publish a PDF with a real text layer, obtained by exporting the source file or by proofread OCR.

Is there a free tool to make a scanned PDF searchable?

Yes. OCRmyPDF is a free, open source tool, available on macOS, Linux and Windows via WSL, that adds a text layer to a scanned PDF using the Tesseract engine. A command such as ocrmypdf -l fra --skip-text scan.pdf output.pdf processes a document in French while leaving pages that already have text untouched. Always proofread the result before publishing.

Why does my PDF's text become unreadable when I copy it?

Text that becomes unreadable when copied and pasted usually comes from an embedded font with no Unicode mapping table: the viewer displays the right letter shapes, but the character codes map to nothing. Search engines then extract the same gibberish. The fix is to re-export the document from its source file, with standard fonts properly embedded.

Updated on

Topic checklist (PDF)

And now?

In the “Videos, PDFs and multimedia” topic

  1. Optimize video titles and descriptions
  2. Create relevant thumbnails
  3. Add subtitles and transcripts
  4. Add chapters
  5. Create a dedicated video page if strategic
  6. Implement VideoObject
  7. Create a video sitemap if needed
  8. Check access to videos and thumbnails
  9. Monitor video indexing
  10. Optimize related YouTube videos
  11. Optimize public PDFs
  12. Check that PDFs contain selectable text
  13. Fill in PDF titles and metadata
  14. Offer an HTML version of critical resources
  15. Provide a text alternative for charts