Private Image to Text & PDF OCR: Files to Markdown, Excel
Pricing
from $4.00 / 1,000 documents converted
Private Image to Text & PDF OCR: Files to Markdown, Excel
Image to text and PDF OCR, files to Markdown, privately: no third-party AI API. Photos, scans, PDFs, DOCX, PPTX, XLSX and HTML become clean Markdown and text for LLMs and RAG; tables as Markdown tables, Tesseract in 24 languages. $0.002 per image or OCR page, $0.004 per document; failed files free.
Pricing
from $4.00 / 1,000 documents converted
Rating
0.0
(0)
Developer
Webstack Labs
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
4 days ago
Last modified
Categories
Features
Share
Image to text OCR for photos and screenshots, PDF OCR for scanned PDFs, and files to Markdown for PDFs, Word, PowerPoint, Excel and HTML: get clean Markdown and plain text that you can feed straight into an LLM, a RAG pipeline or a search index. Tables come out as Markdown tables, and pages without a text layer (scans, photos of documents) are read with Tesseract OCR in 24 languages. One row per file, failed files are free.
Quick start: image to text in one API call
Press Start with the empty input to convert a free 2-page sample PDF (one text page, one scanned page read
with OCR). From your own code, send an image or PDF as a link or as base64 and get the text back in the same call
(the token is your Apify API token). This call reads a small receipt image and returns
"Receipt 2026-11\nTotal: 42.50 EUR" in text:
curl -X POST "https://api.apify.com/v2/acts/webstack-labs~document-to-markdown/run-sync-get-dataset-items" \-H "Authorization: Bearer $APIFY_TOKEN" -H "Content-Type: application/json" \-d '{"files": [{"fileName": "receipt.png", "base64": "iVBORw0KGgoAAAANSUhEUgAAAaQAAABuAQAAAABAM1r+AAADNklEQVR42u2YMWvkRhiGnxmJ1QRsryApnBCyKq5IeaUDl6xSJV3+Qn6Cu7gweI4Ll3Tn8koX+QPpA1ZyhvVVMakNJ4PhbAg+ac9ws2KkL4U25opbKXYRAtFUI8HDO/N974xepITbj1JzlzFQAzVQt6SqW1EP03bq2nOaSCwhZUodE3ZonbRTA2I5uWiuq5rihGvqVVohjHfa6QgaiH7xVzhrTggs+Woqvve28uYHiygIMAlrcdCxwiK5eWogaTQh2T5Q4FdTMXUiRuJqfuS/B4oQSPpqWHB9UVXVtTOfL19apLfyMeWpq9yVebPzePfmorR9WuejjddhEGEeN8AcaNLioE8ryw0UoXP8BpyH4O2rooc6e4qEwI/v0QCZB0dse31oVM451indWgRFsqW6qfH2z1HCh+GOkQZkH/ijx70hxJ8uWh+6kW47ZY+hs/ghFB//KedEUiENVCnY/SIHOj0f4wCPe4MGbOxtTNLnqGJjeVJMk8IlDXVCftzrjY+q9Wq9xu2SoYkuSdnurDwiT1yhXOAoFzSBZMoHjmk2kQLPVN41Cg0xG6NRGAXGPVMW0GtA8i1m9VWk3ipwNbpLBnB3ug/Nnaj/vtbG8P0aqIEaqH+BurgVVauWzIE5Gh7GdUKtJum8NJ1a9TI5FbVYwF8AqiOeagLX3HxJX7CbMS4Wp7D3AtSrTq1wucLn6hHEzDfAKtDGdlF+ucJYk1MQAlagCTuzjTO/WoCnADG5AaswuqvydQXZQX6MRABnFgEruKaL8t+tuWmRAJ8BcADLfXVkAFf6HZHfX87EL6SZyuF45sTzxbQsnazMAG0NXb6FdzQpqTW0/dKuY4Vae86+TkBFeGDLAXuHUL/f2a8jDhzgFmBvEnOPewse8CTLYW64/DuVWwXqqoOKOSI2CaxHqQZOUW2XddRBNTwgcUABPwH3ELAqpwm7HNWEcJzDZJEZIE/a/WnddypzlwBO9pcpGwvFlc5Wd9lt+71Pxi9nIs5PZTIdl8/Ei/zw6HWzIukh4rzykf1qNhMpPZMJExeJZ5KNS5m8mwqBYBT4L7/ZzJeZKDsMNwHu3/9H+XD4RzRQAzVQ/2fqL9QGtRHqjOvBAAAAAElFTkSuQmCC"}]}'
import base64from apify_client import ApifyClientclient = ApifyClient("<APIFY_TOKEN>")with open("scan.png", "rb") as f:image = base64.b64encode(f.read()).decode()run = client.actor("webstack-labs/document-to-markdown").call(run_input={"files": [{"fileName": "scan.png", "base64": image}],"fileUrls": ["https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"],"ocrLanguages": ["eng"],})for row in client.dataset(run["defaultDatasetId"]).iterate_items():print(row["fileName"], row["status"], row["text"])
Each row has markdown, text, ocrConfidence and a markdownUrl to the saved .md file. Images cost
$0.002 each; failed files are free.
What it does
- PDF with a text layer: extracts the text page by page (pypdfium2) and detects tables (pdfplumber), which are returned as Markdown tables in reading order.
- Scanned PDF pages and images (PNG, JPEG, TIFF incl. multi-page, WebP, BMP, GIF): OCR with Tesseract,
with a confidence score per page. In
automode only the pages that need it are OCR'd, so you never pay OCR for a page that already has text. - Word (DOCX): headings (
#), lists (-), paragraphs and tables in document order. - PowerPoint (PPTX): one
## Slide N: titlesection per slide, bullet points, tables, speaker notes. - Excel (XLSX): one Markdown table per sheet (cell values, not formulas).
- HTML, CSV, TXT, Markdown: main content to Markdown (scripts, menus and forms removed), CSV to a table.
- Document metadata on every row (
metadata): author, subject, keywords, creating app and producer, created and modified dates (ISO 8601), language and PDF version; Word, PowerPoint and Excel core properties; HTML meta tags; image size and format (never GPS). Useful for PDF metadata extraction, sorting a document archive or citing sources in RAG. - Every result is also saved as a
.mdfile in the run's key-value store (markdownUrl).
Everything runs inside the Actor on Apify: your files are not sent to any third-party AI or OCR API.
Who uses it
- Developers building RAG / chatbots / AI agents that need documents as Markdown chunks.
- Teams digitising scans, invoices, receipts and forms (text only; no field extraction).
- Automations in Make, n8n, Zapier or LangChain that receive files as links.
Input
{"fileUrls": ["https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf","https://example.com/scanned-contract.pdf","https://example.com/slides.pptx"],"ocr": "auto","ocrLanguages": ["eng", "deu"],"pageRange": "1-20"}
| Field | Default | What it does |
|---|---|---|
fileUrls | – | Direct links to the files. Empty (and no files): a free 2-page sample PDF is converted. |
files | – | Files without a link, as base64: [{"fileName": "report.pdf", "base64": "JVBERi0..."}] or data URLs. Up to 50 files, 8 MB in total. For API calls, n8n/Make and AI agents. |
pdfPassword | – | Password for protected PDFs (secret input: stored encrypted, never logged or returned). |
ocr | auto | auto: OCR only pages without a text layer, and images. always: OCR every PDF page. never: no OCR. |
ocrLanguages | ["eng"] | 1–4 languages: eng, deu, fra, spa, ita, por, nld, pol, rus, ukr, tur, jpn, chi_sim, chi_tra, kor, ara, hin, vie, ind, swe, dan, nor, fin, ces (ISO codes like de, ja work too). |
pageRange | all | Pages or slides, e.g. 1-5, 8, 12-. |
maxPagesPerFile | 200 | Stop after this many pages of one file (row marked truncated). |
extractTables | true | Tables on PDF text pages as Markdown tables. |
includePages | true | Per-page text, OCR flag and confidence in pages. |
includePlainText | true | Plain text in text (Markdown is always returned). |
ocrDpi | 200 | Render resolution for scanned pages (100–400). |
maxFileSizeMb | 100 | Larger files are skipped for free. |
respectRobotsTxt | true | Check the site's robots.txt before downloading. |
Output
One row per file (every row has the same fields; unknown values are null):
{"url": "sample","fileName": "sample.pdf","fileType": "pdf","status": "ok","title": "Sample document","pageCount": 2,"metadata": {"author": "Finance team", "subject": null, "keywords": null, "creatorTool": "Writer","producer": "LibreOffice 24.2", "createdAt": "2026-11-01T08:24:40Z", "modifiedAt": null,"language": null, "pdfVersion": "1.7", "category": null, "description": null,"imageWidth": null, "imageHeight": null, "imageFormat": null},"pagesConverted": 2,"ocrPages": 1,"ocrLanguages": "eng","ocrConfidence": 95.8,"tables": 1,"markdown": "# Sample document\n\n<!-- page 1 -->\n\nQuarterly report (sample)\n...\n\n| Region | Revenue | Growth |\n| --- | --- | --- |\n| Europe | 120 | 8% |\n| Asia | 95 | 12% |\n\n<!-- page 2 -->\n\nScanned page (sample)\n\nThis page is a picture of text, like a scan or a photo.\n...","text": "Quarterly report (sample)\n...","pages": [{"page": 1, "text": "Quarterly report (sample)...", "ocr": false, "ocrConfidence": null, "tables": 1, "charCount": 254},{"page": 2, "text": "Scanned page (sample)...", "ocr": true, "ocrConfidence": 95.8, "tables": 0, "charCount": 190}],"markdownUrl": "https://api.apify.com/v2/key-value-stores/<id>/records/doc-00001-sample.md","billedDocument": 0,"billedOcrPages": 0,"error": null}
Failed files get a row with status: "failed", an error code (blocked_by_robots_txt, http_error,
file_too_large, unsupported_file_type, password_protected, unreadable_pdf, no_text_found, ...)
and a plain errorMessage. They are not charged. A run summary is saved as SUMMARY in the key-value store.
Pricing
Pay per event, no subscription:
- $0.004 per document: a PDF, Word, PowerPoint, Excel, HTML, CSV or text file converted, with all its text-layer pages ($4 per 1,000 documents).
- $0.002 per OCR page: an image, or a scanned PDF page without a text layer ($2 per 1,000 pages).
- Plus Apify's small run start fee. Failed files and the built-in sample are free.
Examples: a 30-page digital PDF = $0.004. A single photo or screenshot = $0.002. A 10-page scanned PDF = $0.004 + 10 × $0.002 = $0.024. You can cap the cost of a run with Apify's "maximum cost per run" setting; the Actor stops when it is reached.
Use it from AI agents (MCP)
The Actor is available to AI agents (Claude, ChatGPT, Cursor and others) through Apify's MCP server
(mcp.apify.com) and the API. Minimal input:
{"fileUrls": ["https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"]}
First rows of the output:
{"fileType": "pdf", "status": "ok", "pagesConverted": 1, "ocrPages": 0, "markdown": "<!-- page 1 -->\n\nDummy PDF file", ...}markdown (or markdownUrl for long documents); check status and error on every row.
An agent that has the file itself but no public link sends it as base64 (url is then
inline:<fileName> in the row):
{"files": [{"fileName": "hello.txt", "base64": "SGVsbG8gd29ybGQ="}]}
How it compares
Image to text OCR, PDF text extraction and Office conversion usually need two or three different Actors. This one does all three with one row shape. Other popular Actors, as described on their Store pages on 2026-11-05 (check their pages for changes):
| This Actor | Image-OCR Actors (e.g. steadydata/image-ocr-text, zenomastro/image-ocr-text-extractor) | PDF extractors (e.g. memo23/pdf-text-extractor) | |
|---|---|---|---|
| Images (PNG, JPEG, TIFF, WebP …) | yes, OCR | yes | no |
| Scanned PDFs | yes, OCR only on pages without text | yes | yes, OCR only where needed |
| PDFs with a text layer | yes, one fee per document | OCR'd page by page | yes |
| Word, PowerPoint, Excel, HTML, CSV | yes | not mentioned | no |
| Tables | Markdown tables | text, line or word boxes | text lines |
| Markdown output | always, plus a .md file | optional or not mentioned | yes |
| Document metadata (author, dates, PDF version …) | yes, every file type | not mentioned | yes, PDF |
| Price | $0.004 per document, $0.002 per OCR page or image | $0.00195–0.005 per image or page | from $0.005 per PDF plus OCR pages |
Choose an image-OCR Actor if you need word or line bounding boxes or more than 24 languages; choose this one when the input is a mix of PDFs, scans and Office files and the output goes to an LLM or RAG pipeline.
How it works
- Downloads each link (robots.txt respected by default, honest User-Agent, size and time limits), or
decodes the base64 files sent in
files. - Detects the real file type from its content, not only the extension.
- Converts it: text layer first, OCR only where needed, tables kept as tables.
- Saves one dataset row and one
.mdfile per document.
FAQ
Does it keep headings in PDFs? Word, PowerPoint and HTML headings are kept. PDFs carry no reliable heading information, so PDF text is returned as paragraphs and tables, with page markers.
Handwriting? Tesseract reads printed text well; handwriting poorly.
Password-protected PDFs? Give the password in pdfPassword (a secret input: Apify stores it
encrypted, and it is never written to the log or the dataset). Without it, or with a wrong one, the row
fails with password_protected, free.
Can I send files instead of links? Yes: put them in files as base64 (up to 50 files, 8 MB in total),
charged like linked files. Larger files: any direct link works (a file in your own storage, an Apify
key-value store record, or a signed URL). Dropbox and Google Drive share links of a file (shared with anyone
who has the link) are turned into download links; other file-sharing viewer pages are not supported.
Related tools
Other Actors by the same developer, with the same pay-per-result pricing and free failed items:
- Audio & Video Transcription: transcribe audio and video files or podcast RSS feeds to text, SRT and VTT with Whisper, with optional speaker labels.
- Video Frame Extractor with Transcript: keyframes of a video with the words spoken at each frame, ready for GPT, Claude or Gemini.
- Bulk Website Screenshot & HTML to Image: full-page or mobile screenshots and PDFs of many URLs or raw HTML, without cookie banners.
- Bulk Image Downloader & Compressor: download every image of many web pages at full size, compress, convert to WebP/JPEG/PNG and get one ZIP.
- BuiltWith Alternative: Tech Stack & Company Info: find the technologies, analytics tags and company profile (name, logo, social pages) of many websites by domain.
- Career Site Jobs Scraper: open jobs from company career sites (Greenhouse, Lever, Ashby, Workable, Recruitee and more) by company domain.
Limitations
- Layout-heavy PDFs (multi-column magazines) can come out in a mixed reading order.
- Table detection on PDFs is heuristic; tables without ruling lines may stay as text.
- Images inside PDFs that also have a text layer are not OCR'd in
automode (useocr: "always"). - Excel formulas are returned as their last saved values.
Credits
Tesseract OCR (Apache-2.0), pypdfium2 / PDFium (Apache-2.0, BSD-3-Clause), pdfplumber and pdfminer.six (MIT), python-docx, python-pptx, openpyxl, BeautifulSoup, markdownify (MIT), Pillow (HPND).