PDF Text Extraction
PDF Text Extraction asks PDF.js for each page's text content and joins every text item's str value with spaces. It adds a Page n heading between pages. This works for PDFs containing extractable text, but it does not perform OCR, reconstruct columns or tables, preserve styles, follow the tagged reading order reliably, extract images, or reproduce line breaks accurately.
Runs locally — files stay on your deviceWhy does a scanned PDF return little or no text?
A scan may contain only page images. This tool has no OCR engine.
PDF text storage is positioned content, not a word-processing flow
Glyphs may be placed independently with fonts and transforms. Text extraction must infer order and spacing from content items and document structure.
How it works
PDF.js loads the bytes, iterates every page, calls getTextContent, takes each item's str property, joins values with spaces, and returns plain text.
Key concepts
Visual order can differ from content order
PDF painting sequences and tagged structure determine extraction quality.
Font encodings matter
Missing or unusual Unicode mappings can produce garbled text.
When to use it
- Copy text from a digitally generated PDF.
- Create a rough searchable transcript.
- Inspect which text PDF.js can expose.
When not to use it
- Do not expect OCR for scans.
- Do not use it for faithful table or column reconstruction.
- Do not assume extracted order is accessible reading order.
Worked examples
Simple report
- Input
Tagged text PDF- Expected output
Page-labelled plain text
Paragraph content is generally readable.
Two-column paper
- Input
Complex layout- Expected output
Potentially interleaved text
Items are joined without layout reconstruction.
Image scan
- Input
Scanned page- Expected output
Little or no text
OCR is absent.
Common mistakes
Calling extraction OCR
No image recognition occurs. Correction: Use OCR software for scans.
Trusting table layout
Cells are flattened. Correction: Compare against the visual PDF.
Assuming complete accessibility
Tags and reading order are not audited. Correction: Use a PDF/UA accessibility workflow.
Best practices
- Compare output with every page.
- Use OCR separately for image-only pages.
- Preserve the original for layout and citation.
Related operations and differences
Add Text Watermark to PDF
Choose Add Text Watermark to PDF when you need to apply a diagonal text watermark to every page.; use PDF Text Extraction specifically for pdf.
Extract PDF Pages
Choose Extract PDF Pages when you need to create a new PDF from selected pages.; use PDF Text Extraction specifically for pdf.
PDF Split
Choose PDF Split when you need to extract selected pages into a new PDF.; use PDF Text Extraction specifically for pdf.
Add Blank Page to PDF
Choose Add Blank Page to PDF when you need to append a custom-size blank page to a PDF.; use PDF Text Extraction specifically for pdf.
Add Page Numbers to PDF
Choose Add Page Numbers to PDF when you need to place centered page numbers on every page.; use PDF Text Extraction specifically for pdf.
Crop PDF Pages
Choose Crop PDF Pages when you need to set a custom crop box on every PDF page.; use PDF Text Extraction specifically for pdf.
Limitations and privacy
- Plain text only.
- No OCR, images, annotations, forms, table reconstruction, style, coordinates, font, or reliable reading-order preservation.
- 25 MB registry limit applies.
The PDF is read and processed locally in this browser.
Frequently asked questions
Does it OCR scans?
No.
Are tables preserved?
No.
Are page headings added?
Yes.
Can text order be wrong?
Yes.