Uvlio

Command Palette

Search for a command to run...

Back to articles
Technical Article

Extracting Text and Images from PDFs: Selectable Text versus OCR

Not every PDF contains text as text. Many are photographs of pages wrapped in a PDF container. Choosing extraction versus OCR without checking which case you have wastes time and produces confident-looking wrong output. The practical habit is to verify outputs under the same conditions your users will face, then keep a short record of what you checked. When accuracy matters more than speed, extract selectable text first and reserve OCR for pages that truly have no text layer.
Uvlio editorial team by limitcool2026-05-177 min read
Topic coverPDFPDF SplitterPDF Compressor

Extracting Text and Images from PDFs: Selectable Text versus OCR

If you can select text, extract it. If the page is only an image, you need OCR. How to tell which case you have and what quality to expect.

Guide subject preview
Understand
Check
Apply
Tool stack
PDF SplitterPDF CompressorImage to PDF ConverterPDF Protect
Reading focus
1Understand
2Check
3Apply

Original workflow visual

Extracting Text and Images from PDFs: Selectable Text versus OCR

This original Uvlio visual summarizes the practical path from input inspection to output review for this workflow.
1

Understand

Review before moving forward

2

Check

Review before moving forward

3

Apply

Review before moving forward

Maintainer and review note
Maintained by limitcool. Use it to understand the technical model, processing boundaries, privacy risks, and verifiable behavior.
Selectable text is already digital

If you can highlight words in a reader, the PDF has a text layer or text drawing operators. Extraction can copy those characters exactly, including spacing quirks. Start here before OCR. OCR on a text PDF is slower and can invent errors that were not in the original.

Image-only pages need OCR

Scans, photographed documents and some fax exports store only pixels. No extractor can recover perfect words without OCR. OCR quality depends on resolution, contrast, language models and skew. A crooked phone photo of a receipt will always be harder than a 300 DPI flatbed scan.

Hidden text layers can disagree with the image

Some PDFs show an image of the page and also contain an invisible text layer from a previous OCR pass. Copying text may then yield different words than you see. If accuracy matters, compare a few extracted sentences to the visible page before trusting the whole file.

Fonts and encoding oddities

Even born-digital PDFs can extract poorly when fonts use custom encodings or when text is drawn as curves. You may see correct glyphs on screen and mojibake after copy. In those cases rasterising the page and running OCR can ironically be more reliable than extraction.

Images are a separate extraction path

Pulling embedded images is not the same as rendering a page to PNG. Embedded extraction recovers original assets when present; page rendering flattens everything visible, including text, into one image. Choose based on whether you need the original photo or a snapshot of the page layout.

Language packs and mixed scripts

OCR engines need the right language data. A Chinese scan processed as English will produce garbage. Mixed documents may need multi-language mode. Always set language explicitly when the tool allows it; auto-detect fails on short pages and low contrast.

Validation after extraction

Spot-check numbers, names and table columns. OCR often confuses 0 and O, 1 and l, and multi-column layouts. For anything financial or legal, treat OCR output as a draft that a human must confirm, not as a finished record.

Keep provenance next to the extracted text

Extracted text without a pointer back to page and file becomes hard to trust in reviews. When possible, store page numbers with each block, and keep the source PDF hash or filename in the same record. If OCR was used, note the engine and language settings. That metadata is what lets a later reader decide how much verification the text still needs.

Tables are harder than paragraphs

OCR and extraction both struggle when text sits in multi-column tables or is interrupted by ruled lines. If the goal is a spreadsheet, expect to repair column boundaries after the first pass. For critical tables, a human-in-the-loop review of numeric columns is cheaper than discovering a shifted decimal in production. Prefer tools that can emit CSV with explicit page and bounding-box metadata when the layout is complex.

Language mismatches produce fluent nonsense

OCR set to the wrong language can still emit readable-looking words that are completely wrong. Always set language explicitly for production batches. For mixed-language pages, prefer multi-language mode or split the document by page language when the tool allows it. Spot-check proper nouns; they fail first when the language model is wrong.

Batch OCR needs failure isolation

When processing hundreds of pages, one catastrophic page should not discard the batch. Write per-page outputs and a manifest of successes and failures. Retry only the failed pages with different DPI or language settings. Operators then spend time on the hard pages instead of re-running the easy ones overnight.

Common Questions

How do I know if I need OCR?

Try selecting text. If nothing highlights, the page is probably image-only and needs OCR.

Why is extracted text different from what I see?

A hidden OCR layer may disagree with the visible image. Compare before trusting the extract.

Is higher DPI always better for OCR?

Up to a point. Around 300 DPI is a common sweet spot. Blurry higher-DPI photos still OCR poorly.

Can I extract original images from every PDF?

Only if they are embedded as images. Flattened page renders are snapshots, not original assets.