PDF to Text & OCR: Extract Text from PDFs and Scanned PDFs
Pricing
from $3.50 / 1,000 pdfs extracted
PDF to Text & OCR: Extract Text from PDFs and Scanned PDFs
Turn PDFs into clean text for search, analysis and AI pipelines. Give it PDF links and get each document's full text, page-by-page text, word and page counts and metadata. Scanned pages can be read with OCR in 12 languages. $5 per 1,000 PDFs; OCR $8 per 1,000 scanned pages, only when switched on.
Pricing
from $3.50 / 1,000 pdfs extracted
Rating
0.0
(0)
Developer
SpellzCode
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
20 days ago
Last modified
Categories
Features
Share
PDF to Text Extractor & OCR: Extract Text from PDFs and Scanned PDFs
PDF to text extractor for links to PDF files. Give it one PDF or thousands and get back each document's full text, optional page-by-page text, word, character and page counts, and the document's own metadata, ready for search, analysis, spreadsheets or an AI pipeline. Scanned PDFs, which are pictures of pages, can be read with OCR in 12 languages.
$5 per 1,000 PDFs ($0.005 each). OCR is off unless you turn it on, and then it is charged only for the pages that need it.
Try it now: press Start. The example input (a well-known 15-page research paper) is already filled in. Apify's free $5 monthly credit covers about 1,000 ordinary PDFs.
- You pay only for PDFs whose text was extracted. Broken links, files that are not PDFs and password-protected PDFs come back with a status and cost nothing.
- Scanned pages are detected for you.
looksScannedtells you when a PDF is images of text, so empty results never go unnoticed. - Mixed PDFs cost less with OCR: only pages without stored text are read and charged.
What you get for each PDF
| Field | What it is |
|---|---|
url | The link you gave |
status | ok, download-failed, not-a-pdf, unreadable or invalid-input |
error | The reason on rows that are not ok, for example http-404, timeout, file-too-large, password-protected or damaged-or-unsupported |
text | The full text, pages separated by a blank line, with words hyphenated across line breaks rejoined |
pages | Optional: one entry per page with page, text and source (text or ocr) |
pageCount | Number of pages |
wordCount, characterCount | Size of the extracted text |
looksScanned | true when more than 80% of pages had no stored text, which means the PDF is images of text |
ocrPageCount | How many pages were read with OCR |
ocrConfidence | The OCR engine's own average confidence, 0 to 100; null when OCR was not used |
ocrIncomplete | true when some scanned pages were left unread because of your page limit or spending limit |
truncated | true when the text was cut at 4 million characters |
title, author, subject, creator, producer | The document's own metadata, when it has any |
createdAt, modifiedAt | Document dates in ISO format |
fileBytes | Size of the downloaded PDF |
How to extract text from a PDF link
- Paste one or more PDF links into PDF addresses, one per line.
- Leave the options off for ordinary PDFs.
- Press Start, then open the Output tab. Each PDF is one row; download as JSON, CSV or Excel, or read the dataset through the API.
Links that redirect (for example a "download" link that forwards to the file) are followed. The actor checks that the file really is a PDF before reading it.
How to convert a scanned PDF to text with OCR
- Turn on Read scanned pages with OCR.
- Pick the Language of the scanned text: English, German, French, Spanish, Italian, Portuguese, Dutch, Swedish, Danish, Norwegian, Finnish or Polish.
- Optional: set Most pages to read with OCR in one PDF to cap the cost of long scans (default 50).
- Press Start.
Every page without stored text is drawn at 300 dots per inch and read with Tesseract, an open-source OCR engine. Pages that already have text are left alone and never charged for OCR. In the pages list, each page says whether its text came from the file (text) or from OCR (ocr).
What to expect from OCR: clean printed text is read reliably. In our own test page, ordinary typefaces were read without error, while an old-style typeface whose digits vary in height had a 9 misread as 0. If figures matter, check them, and treat a low ocrConfidence as a warning. Handwriting and photos of pages taken at an angle or in poor light are not suitable.
How to split a PDF into pages for an AI or RAG pipeline
Turn on Also return the text of each page separately. Each row then holds a pages list with the page number and that page's text, so you can:
- cite page numbers in answers,
- split long documents into chunks along page boundaries before embedding,
- skip cover pages and appendices.
The full text field is still there for simple use. For very long documents (over 4 million characters) the text is cut, truncated is set, and the page list is left out so the result stays within Apify's item size.
How to check a batch of PDFs for empty or scanned files
Run the batch with OCR off; it costs $0.005 per readable PDF. Then filter the results:
looksScanned: truemeans the PDF is mostly pictures of text. Run only those again with OCR on.wordCountnear zero on a non-scanned PDF often means the text is stored as outlines or in an unusual encoding.status: unreadablewithpassword-protectedmeans the file is locked.
This avoids paying for OCR on documents that do not need it.
Input example
{"pdfUrls": ["https://arxiv.org/pdf/1706.03762"],"includePages": true,"ocrScanned": true,"ocrLanguage": "eng","maxOcrPages": 50}
| Field | Default | What it does |
|---|---|---|
pdfUrls | (required) | Links to PDF files, up to 40 MB each |
includePages | false | Adds the pages list |
ocrScanned | false | Reads pages without stored text with OCR |
ocrLanguage | eng | OCR language (Tesseract code) |
maxOcrPages | 50 | Most pages read with OCR per PDF (1 to 500) |
Output example
A real result for the prefilled example, with the text shortened:
{"url": "https://arxiv.org/pdf/1706.03762","status": "ok","pageCount": 15,"characterCount": 39589,"wordCount": 6462,"looksScanned": false,"ocrPageCount": 0,"ocrConfidence": null,"ocrIncomplete": false,"truncated": false,"title": null,"author": null,"subject": null,"creator": "LaTeX with hyperref","producer": "pdfTeX-1.40.25","createdAt": "2024-04-10T21:11:43Z","modifiedAt": "2024-04-10T21:11:43Z","text": "Provided proper attribution is provided, Google hereby grants permission to\nreproduce the tables and figures in this paper ...\nAttention Is All You Need\n..."}
A link that is not a PDF comes back like this, free:
{ "url": "https://example.com/", "status": "not-a-pdf", "error": "not-a-pdf" }
Pricing
Pay per event, nothing monthly. These are the actor's current prices:
| Event | Apify Free plan | Starter | Scale | Business |
|---|---|---|---|---|
| PDF extracted (per PDF with text) | $0.0050 | $0.0045 | $0.0040 | $0.0035 |
| Scanned page read with OCR (only when OCR is on) | $0.0080 | $0.0072 | $0.0064 | $0.0056 |
| Actor start (per run) | $0.00005 | $0.00005 | $0.00005 | $0.00005 |
- 200 ordinary PDFs: $1.00
- A 30-page scanned contract with OCR: $0.245 ($0.005 for the PDF and $0.24 for its pages)
- 10,000 ordinary PDFs: $50 on the free plan, $35 on Business
One charge per PDF, whatever its length. There is no separate charge for compute time. The free plan's $5 monthly credit covers 1,000 ordinary PDFs or about 600 scanned pages. Set Apify's maximum charge per run to cap a run; OCR stops cleanly when the limit is reached and marks the document ocrIncomplete.
Use it from an AI agent (MCP)
Apify's MCP server lets Claude, ChatGPT, Cursor, VS Code and other MCP clients call this actor as a tool:
https://mcp.apify.com/?tools=spellzcode/pdf-to-text-extractor
Sign in with your Apify account when asked (OAuth), or send your Apify API token as a Bearer token in the Authorization header.
{"mcpServers": {"pdf-text": {"url": "https://mcp.apify.com/?tools=spellzcode/pdf-to-text-extractor"}}}
Then ask, for example: "Read this PDF and summarise the main findings, with page numbers." The agent passes the link in pdfUrls, turns on includePages, and gets the text back. From code, call POST https://api.apify.com/v2/acts/spellzcode~pdf-to-text-extractor/run-sync-get-dataset-items with the input JSON.
FAQ
Why is the text empty for my PDF?
The PDF is most likely scanned: each page is a picture, with no stored text. looksScanned will be true. Run it again with OCR on.
Does it keep tables?
Table text comes out line by line in reading order, not as structured rows and columns. For figures inside tables, check the result.
Can it read password-protected PDFs?
No. They come back with status unreadable and error password-protected, free of charge.
Can I upload a PDF from my computer?
The actor reads links. Upload the file to any public storage (an Apify key-value store, cloud storage or your website) and use its link.
Are there size limits?
Files up to 40 MB, and text up to 4 million characters per document. Larger files come back as download-failed with file-too-large.
Does it read handwriting?
No. OCR is for printed text.
Can it fetch PDFs from my internal network?
No. Links to private and local addresses are refused, on purpose.
Related actors
- Bulk File Downloader: download PDFs, documents and media from a list of links.
- Audio & Video Transcriber: audio, video and podcast feeds to text and subtitles.
- Sitemap URL Extractor: every page of a site from its sitemaps, a quick way to find a site's PDFs.
- Website Contact Extractor: public emails, phones and social links from websites.
- SEO Audit Tool: on-page scores and issues for a list of pages.
Guide: detecting scanned PDFs and when OCR is worth it.
Questions and problems
Open an issue on the Issues tab with the input you used. Built and maintained by SpellzCode (glyphcall.com).