Key takeaways
- Native extraction reads existing character information; OCR recognizes text from page images.
- Returning text or JSON does not add a searchable text layer to the original PDF file.
- Check mixed documents page by page, and validate extracted data against the source context.
A PDF can display readable words without containing usable text objects. Another can contain text that extracts in the wrong order. Decide whether you need separate text data, a searchable document, or structured fields before choosing a conversion step. Those outcomes require different work.
Identify what the pages contain before choosing a tool
Try selecting and copying text from a few representative pages. A successful copy is useful evidence, but it does not establish that every page has text or that all characters map correctly. Inspect a page with columns, unusual fonts, small labels, and scanned attachments. A PDF viewer can paint a convincing page using image pixels or vector outlines that native text extraction cannot turn into the original words.
Keep the original file and note which version you tested. A replacement with the same filename can have different pages or text. Count the pages and flag any that return little or no text, then compare those pages with the extraction result. Finding one heading does not tell you whether the rest of the document was read.
Use native extraction for existing text objects
Native PDF text extraction reads character information already represented in the document. It can be efficient for digitally generated files, but PDFs describe page appearance rather than guaranteeing a sequence of paragraphs. A tool reconstructs ordering from available structure and geometry. Multi-column layouts, positioned glyphs, and missing character mappings can produce gaps or surprising order even when the page renders correctly.
The following Poppler command exports an existing document’s text with a layout-preserving heuristic. It does not recognize scanned pixels or promise parsed table rows. Run it on a trusted local fixture and compare the result with the rendered pages. A file containing a heading and a scanned body can return nonempty text that still omits most of the information the application needs.
pdftotext -layout input.pdf extracted.txt
# Review extracted.txt alongside the original pages.
# This command does not add a text layer to input.pdf.Use OCR when the information is in page images
OCR recognizes characters from raster content rather than recovering the original keystrokes. Resolution, tilt, noise, contrast, language, and layout affect the result. Prepare a bounded working image and compare recognition on real receipts, scans, or attachments. Deskewing can help line analysis, but changing contrast or removing noise too aggressively can erase faint punctuation or fine strokes.
Recognized text can be persuasive while wrong. A mistaken digit in an invoice total or a name can matter more than an otherwise low word-error rate. Preserve the page relationship and review critical fields against the image or another authoritative record. Decide what happens to empty or uncertain pages instead of automatically accepting any result that contains plausible words.
Specify text output or a searchable PDF explicitly
A text file or JSON response gives your application data to index or analyze. A searchable PDF text layer puts text inside the PDF itself so a viewer can search or select it, often as invisible words positioned over a scan. Check which output your OCR tool creates: returning recognized text does not necessarily change the PDF.
Transloadit’s /document/extract and /document/ocr return text artifacts; they do not add a searchable text layer to the source PDF. If that PDF itself must become searchable, use a separate tool such as OCRmyPDF that creates the required artifact. Validate page alignment and recognition quality, then associate the new document version with the exact original it came from.
Text for your application
Use separate text for search indexing or field extraction. Store the source version and page information with it so results can link back to the right document and passage.
Searchable document
Appropriate when the downloaded PDF itself must support text search or selection. Verify the output in a viewer; a nearby JSON transcript does not change that PDF’s contents.
Check every page in mixed documents
A document can combine native text, scanned pages, and pages containing both. A fallback that runs OCR only when native extraction returns no text for the entire document can miss image-only pages if a different page contains one readable heading. Understand the granularity of the selected tool’s decision. Use a page-aware policy or a deliberately chosen OCR path when complete scan coverage is required.
In /document/extract, text_method: "auto" falls back when the document yields no usable native text. A mixed PDF can therefore leave scanned pages unread. Use text_method: "ocr" with the required ocr_provider when scanned pages must be covered. OCR does not support encrypted PDFs. For text extraction, "ocr" and "auto" reject page_range and text_granularity: "page". page_range applies to native text and embedded image extraction; OCR processes the full document. Keep the mode explicit and verify coverage rather than treating any returned text as complete.
Validate the property the application will rely on
Check that all expected pages were read, characters are correct, and paragraphs appear in the right order. Verify important values against their source pages. Plain text that looks like a table still needs parsing to identify rows and columns. Searchable text also says nothing about PDF/A conformance, accessible reading order, or secure redaction; check those separately when required.
Keep sensitive originals and extracted text under deliberate access and retention rules. Search indexes and snippets can expose content even when the PDF itself is protected. If the workflow redacts information, verify the resulting text and prior-revision handling as well as visual appearance. Record the producing tool or service, run date, and source version so changes in extraction behavior can be investigated later.
Technical details worth knowing
- PDF painting instructions can show text as text objects, raster pixels, or vector outlines, with different extraction consequences.
- Native extraction relies on character mapping and order reconstruction, so correct visual rendering does not guarantee correct Unicode output.
- OCR recognizes characters from images and can return plausible mistakes in names, numbers, punctuation, or reading order.
- A searchable PDF associates text with page appearance, often through an invisible OCR text overlay positioned over the scan.
- A mixed PDF can have native text on some pages and scans on others; finding any text in the document does not prove complete coverage.
- Searchability, table recognition, accessibility, archival conformance, and secure redaction are separate properties requiring their own checks.
A practical approach
- 1
Inspect representative pages for native text, scans, unusual fonts, and mixed page types.
- 2
Decide whether you need separate text, a searchable PDF, or structured fields such as invoice totals.
- 3
Run the appropriate extraction or OCR path and preserve page/source relationships.
- 4
Review coverage, ordering, critical values, and any required document-level conformance.
When Transloadit is useful
Transloadit’s /document/extract and /document/ocr return extracted or recognized text; they do not add a searchable text layer to the original PDF. Use a separate tool such as OCRmyPDF when the deliverable must be a searchable PDF, and validate that new document independently.
Architecture boundary
Check each output against its intended use. Searchable text still needs review for recognition errors, and an accessible or archival PDF needs additional checks beyond OCR.
Frequently asked questions
Why can I see words but not copy them?
They may be raster pixels, vector outlines, or text without a usable character mapping. Inspect the page structure and compare native extraction before deciding whether OCR is needed. Visual readability alone cannot establish extractability.
Does OCR always return a searchable PDF?
No. OCR can return plain text, JSON, positioned records, or a modified PDF depending on the tool and options. Specify the required artifact and verify that exact output instead of inferring it from the process name.
Why did a mixed PDF produce text for only some pages?
Some pages may have native text while others contain only scans. A document-level fallback can decide that native extraction succeeded after finding any text. Check coverage and the tool’s fallback granularity before accepting the result.
Can extracted invoice fields be trusted automatically?
Check important values against the source page and your business rules before using them. For an invoice, that might mean verifying the supplier, currency, total, and whether line items add up. Send uncertain results for review.