New1 billion tokens free on sign-up — crawl, parse, chunk and embed on the houseSee pricing
SarvCrawlSarvCrawl

Glossary · Extraction and parsingUpdated

What are scanned vs text PDFs?

A text PDF contains a text layer, the actual characters, which can be extracted exactly. A scanned PDF contains only images of pages, so its text has to be reconstructed with OCR. The two need different parsing and different quality checks.

01Two kinds of PDFof 05

Two kinds of PDF

PDF is a container, and the same .pdf extension covers two very different things.

Text (born-digital) PDF
Exported from Word, a browser or a typesetting tool. Each character is stored with its font and position. You can select and copy text. Extraction is deterministic.
Scanned (image) PDF
A photograph or scan of paper, wrapped in a PDF. Each page is an image. Selecting text selects nothing. Text has to be produced by OCR.
Hybrid
A scan with an OCR text layer already added, or a document where some pages are scanned. The existing text layer may be good, poor or partial.

The difference is not cosmetic. A text PDF gives you exactly the characters the author typed. A scanned PDF gives you whatever the OCR model believes it saw.

Tables add a twist. In a text PDF, a table is still just positioned glyphs, so structure has to be inferred even though every character is exact. In a scan, both the characters and the structure are inferred.

How to tell which one you have

Try to select a sentence in a viewer. If nothing highlights, the page is an image. Programmatically, extract the text per page and look at how much comes back relative to the page count:

# Characters of extractable text per page. Near zero means a scan.
pages=$(pdfinfo report.pdf | awk '/^Pages:/ {print $2}')
chars=$(pdftotext -layout report.pdf - | wc -m)
echo "$((chars / pages)) chars/page"

# Image-only pages show an image per page and no fonts.
pdfimages -list report.pdf | head
pdffonts report.pdf

Check per page, not per file. Many real documents are mixed: a typed report with a scanned signature page appended, or a scanned archive with a few digital cover pages.

Why it matters downstream

  • Quality checks break. The usual way to score a conversion compares output to the PDF's text layer. On a scan that comparison succeeds against an empty string and returns zero, so every scan fails, and the documents that most need checking are the ones the check cannot see.
  • Errors differ. Text PDFs fail structurally: interleaved columns, lost table structure, repeated headers and footers. Scans fail at the character level: misread names and numbers, plus all of the structural problems.
  • Cost differs. OCR is far slower and more compute-heavy than text extraction, which matters at corpus scale.
  • Trusting an existing OCR layer. A hybrid PDF's embedded text may come from an old, poor OCR pass. If it reads badly, re-OCR.

Conflating the two is how you end up with a knowledge base that is quietly full of misread table cells.

How SarvCrawl handles it

When you upload a PDF, SarvCrawl extracts the text layer when there is one and sends scanned PDFs, those with no text layer, through OCR. Both end up as markdown in your knowledge base.

The conversion audit runs in a matching mode. Text PDFs are scored against their own text layer with ROUGE-1, Jaccard, vocabulary coverage and length fidelity; scans are judged intrinsically, and the report says which mode it used so the two scores are never read as the same thing. The method is in scoring your own PDF conversion; try a file at PDF to Markdown.

Frequently asked questions

How do I know if a PDF is scanned?

Try selecting text in a PDF viewer. If you cannot select individual words, the page is an image. Tools like pdftotext return little or no text for scanned pages.

Can a scanned PDF be made searchable?

Yes. Running OCR produces text, which can be stored as a hidden layer in the PDF or extracted to a separate format such as markdown for search and indexing.

Is text extraction from a text PDF always accurate?

The characters are exact, but structure can still be wrong: two-column pages can interleave, tables can flatten, and headers and footers repeat on every page. Check structure as well as text.

SarvCrawl

Turn any site into a searchable knowledge base

Crawl pages and parse documents into clean markdown, then chunk, embed and search them from one API.