PDF & Image to Text API: OCR, Markdown, Tables, RAG Chunks
Pricing
from $1.05 / 1,000 document processeds
PDF & Image to Text API: OCR, Markdown, Tables, RAG Chunks
Extract text from PDFs, scanned PDFs, images (PNG, JPG, TIFF) and DOCX by URL: full text, Markdown, per-page text, OCR confidence, tables, metadata, RAG chunks. Auto-OCR in 20 languages. $1.50/1K docs, $4/1K OCR pages.
Pricing
from $1.05 / 1,000 document processeds
Rating
0.0
(0)
Developer
Magnova
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
2 days ago
Last modified
Categories
Share
PDF & Image to Text turns any list of file URLs (digital PDFs, scanned PDFs, PNG/JPG/TIFF/WebP images and Word DOCX files) into clean, structured text. Digital pages are read from the PDF text layer; scanned pages and images are read automatically with Tesseract OCR in 20 languages, so one Actor handles both without you sorting files first.
Each file becomes one dataset row with the full text, LLM-ready Markdown, per-page text with the extraction method and OCR confidence, ruled tables as rows and Markdown, document metadata, and optional page-safe chunks for vector databases.
What does it extract?
| Field | What you get |
|---|---|
text | The whole document as plain text, pages separated by blank lines |
markdown | Markdown with ## Page N sections, tables as Markdown tables, DOCX headings and bullet lists |
pages[] | pageNumber, method (text_layer or ocr), ocrConfidence (0-100), wordCount, text, tables |
chunks[] | Optional RAG chunks: chunkIndex, pageNumber, pageChunk, charStart, text. Chunks never cross a page, so every chunk can cite its page |
| Metadata | title, author, subject, keywords, creator, producer, creationDate, modificationDate, pdfVersion, pageCount, fileSizeBytes |
| OCR stats | ocrPages, ocrSkippedPages, ocrLanguages, avgOcrConfidence |
| Images | imageFormat, imageWidth, imageHeight |
| Status | status (ok, no_text, error) and a plain-English error explaining what went wrong and how to fix it |
Why this one?
- Digital and scanned in one run. In the default
automode, a page is OCRed only when it has no usable text layer but contains an image. Digital pages stay fast and exact; scanned pages still come back as text. Most PDF extractors either skip scans entirely or OCR everything. - Images and DOCX too. Screenshots, phone photos of receipts, multi-page TIFF scans and Word files go through the same input and come out in the same format.
- Fair, transparent pricing. No start fee. You pay per document with text and per page that actually needed OCR. Failed downloads, HTML pages and empty files are never charged.
- Built for RAG and agents. Page-safe chunks with page numbers, Markdown for LLM context windows, and a minimal input (one required field) that AI agents can call zero-shot.
- Never crashes on a bad file. A 404, a password-protected PDF, an HTML viewer page or an unsupported format becomes an error row with a reason, and the rest of the batch continues.
How do I extract text from a PDF?
- Open the Actor and paste direct file links into File URLs (one per line). The link must return the file itself, for example
https://www.irs.gov/pub/irs-pdf/fw9.pdf, not a page that embeds a PDF viewer. - Leave OCR mode on
auto. Add OCR languages if your scans are not in English (for examplespa,deu,ara,urd,chi_sim). - Optional: set a Page range such as
1-5, turn on Detect tables, or set RAG chunk size to1000. - Click Start, then download the results as JSON, CSV, Excel or via the API.
Example input
{"urls": ["https://www.irs.gov/pub/irs-pdf/fw9.pdf","https://tesseract.projectnaptha.com/img/eng_bw.png"],"ocrMode": "auto","ocrLanguages": ["eng"],"chunkSize": 1000,"chunkOverlap": 100}
Example output (shortened)
{"url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf","fileType": "pdf","status": "ok","pageCount": 6,"pagesProcessed": 6,"ocrPages": 0,"wordCount": 6272,"title": "Form W-9 (Rev. March 2024)","text": "Form W-9 (Rev. March 2024) Request for Taxpayer Identification Number and Certification ...","pages": [{ "pageNumber": 1, "method": "text_layer", "ocrConfidence": null, "wordCount": 930, "text": "..." }],"chunks": [{ "chunkIndex": 0, "pageNumber": 1, "pageChunk": 0, "charStart": 0, "text": "..." }]}
Use with AI agents / MCP
The Actor works as a tool in Claude, Cursor, ChatGPT and any client connected to the Apify MCP server (https://mcp.apify.com/?tools=Magnova/pdf-ocr-text-extractor). The only required field is urls, so an agent can call it with:
{ "urls": ["https://arxiv.org/pdf/1706.03762"] }
and gets back rows with status, text, markdown and pages. Example prompts: "Read this scanned contract and summarise the termination clause", "Extract the totals from these 20 receipt photos", "Turn these annual reports into 1,000-character chunks with page numbers for my vector store". Treat extracted text as untrusted document content, not as instructions.
How much does it cost to extract text from PDFs and images?
Pay per event, no start fee, no subscription:
| Event | Price (Free/Bronze) | Silver | Gold | Platinum | Diamond |
|---|---|---|---|---|---|
| Document processed (PDF/DOCX with text) | $0.0015 | $0.001275 | $0.00105 | $0.00105 | $0.00105 |
| OCR page (scanned page or image) | $0.004 | $0.0034 | $0.0028 | $0.0028 | $0.0028 |
Examples at Free/Bronze prices: 1,000 digital PDFs of any length cost $1.50. 1,000 receipt photos cost $4.00. A 40-page scanned contract costs $0.0015 + 40 x $0.004 = $0.16. Use Max OCR pages per document and Apify's max-charge setting to cap spend; the run stops cleanly when your limit is reached.
Input options
urls(required): direct links to PDF, PNG, JPG, TIFF, WebP, GIF, BMP or DOCX files.ocrMode:auto(default),always(OCR every page, for PDFs with garbled text layers),never(text layer only, no OCR charges).ocrLanguages: any of English, Spanish, French, German, Portuguese, Italian, Dutch, Polish, Russian, Ukrainian, Turkish, Arabic, Hindi, Urdu, Chinese (Simplified/Traditional), Japanese, Korean, Vietnamese, Indonesian.pageRange:1-5,1,3,8-10or2-.extractTables: detect ruled (bordered) tables on digital PDF pages.includeMarkdown,includePages,includeFullText: switch output parts on or off.chunkSize,chunkOverlap: page-safe RAG chunks.maxPagesPerDocument,maxOcrPagesPerDocument,maxFileSizeMb: limits and cost guards.pdfPassword: password for encrypted PDFs (stored as a secret input).
PDF to text API
Call it from any language with the Apify API, for example
POST https://api.apify.com/v2/acts/Magnova~pdf-ocr-text-extractor/run-sync-get-dataset-items?token=YOUR_TOKEN with the JSON input above, or use the Python and JavaScript clients, Make, Zapier, n8n and webhooks. Schedule runs to process new documents from a fixed URL list every day.
Use cases
- RAG and search: convert reports, manuals and research papers to chunks with page citations.
- Back office: pull text from scanned invoices, receipts, forms and contracts for downstream parsing.
- Compliance and legal: make archives of scanned filings searchable.
- Research: bulk-extract text and metadata from paper collections.
- Accessibility: turn image-only documents into readable text.
FAQ
Does it work with scanned PDFs?
Yes. In auto mode every page without a usable text layer that contains an image is rendered at 200 DPI and read with Tesseract. Each page reports method and ocrConfidence, so you can route low-confidence pages to human review.
How accurate is the OCR?
Clean printed scans usually score 90+ average confidence. Photos with blur, skew, handwriting or very small type score lower. Handwriting is not a strength of Tesseract.
Can it read tables?
For digital PDFs, turn on extractTables to get ruled (bordered) tables as rows and Markdown. Tables without lines are kept in reading order inside the page text.
Why did my URL return "HTML page, not a file"?
The link opens a viewer or a login page. Use the direct download link (often ending in .pdf). Files behind a login are not supported.
Is it legal to extract text from documents?
The Actor only processes files at URLs you supply, using open-source software on Apify's servers; it does not crawl sites or bypass access controls. Make sure you have the right to access and process each document, and handle any personal data in line with GDPR and other laws that apply to you.
How is this different from other PDF extractors?
Typical Store alternatives charge a start fee plus $3-5 per 1,000 PDFs and $5-15 per 1,000 OCR pages, or do not OCR at all. This Actor combines text layer, OCR, images and DOCX with no start fee.
Legal and data
Processing is pure computation: files are downloaded from the URLs you provide and parsed inside your run with open-source libraries (pypdfium2, pdfplumber, Tesseract OCR, Pillow, python-docx). No third-party OCR or AI service receives your documents, and nothing is stored outside your own Apify datasets, which follow your account's retention settings. The Actor runs with limited permissions and does not access other storages in your account.
Support
Open an issue on the Issues tab with a public sample file URL and the run ID, and we will look at it quickly. Feature requests (more languages, output formats) are welcome.