Choose native extraction when the PDF contains a usable text layer, and evaluate OCR where page content is image-based or the text layer is unreliable. The choice belongs at the page or region level for mixed documents.
Extraction and recognition recover different evidence
Native extraction reads text representations already stored in the PDF. OCR recognises characters from rendered visual content. Neither automatically preserves reading order, tables, or the business meaning of an extracted value.
The pypdf extraction guide explains why image-only pages may yield little text and require OCR. Use the actual parser and OCR documentation for the selected versions before implementing a pipeline.
For a proposed evaluation, retain the original page, extraction method, source location, parser configuration, and reviewed expected content. Do not replace good native text indiscriminately with recognition output without comparing quality and cost.
Compare fictional business pages
A digital policy page contains selectable text with an eligibility exception. A scanned invoice contains only a raster image. A third page has a poor hidden text layer that disagrees with the visible amount.
The fixture should check consequential words, identifiers, negations, amounts, and structure. Producing a long string is not enough if the exception disappears or a digit changes. Where the pipeline cannot establish the content, mark it uncertain and avoid definitive downstream claims.
| Page condition | Candidate processing |
|---|---|
| Usable digital text | Native extraction with fidelity checks |
| Image-only text | OCR under the supported configuration |
| Corrupt or misaligned text layer | Compare rendered evidence and selected recovery |
| Mixed image and native regions | Preserve complete relevant content |
| Unreadable source | Explicit limitation or human review |
These are labelled proposed fixtures, not measured parser benchmarks. Compare extracted results visually against the source pages before evaluating retrieval quality.
Preserve method and uncertainty downstream
A passage derived from OCR should keep enough provenance for reviewers to inspect the original location. Do not turn a low-quality recognition guess into a verified business fact merely because the answer model can read it.
OCR adds compute, configuration, language, and review requirements. Native extraction is often simpler for clean digital content but can still produce wrong order or missing structure. Evaluate the actual collection rather than choosing one method for every file.
This pipeline is proposed. The ChalkLens case study documents PDF extraction and OCR in an offline classroom product; it does not claim this parser stack. Pair it with mixed-page scan detection.
OCR versus native FAQ
Does selectable text prove the page is accurately extracted?
No. Check fidelity, reading order, and relevant structure against the visible source.
Should OCR run on every page?
Choose from evidence and supported tooling rather than assuming universal re-recognition improves quality.
What should an evaluation report?
Show fixture types, method configuration, consequential errors, unresolved content, processing cost, and known coverage limits.