Building a chat-with-your-docs app usually starts with a headache: parsing PDFs. Native text extraction often breaks tables, and scanned pages return empty strings. You end up writing custom logic for every file type.
I needed a simple way to turn mixed document types into clean, LLM-ready Markdown. I tested the PDF & DOCX to Text, Markdown & Tables actor on a 15-page arXiv paper. It returned plain text, Markdown and the file metadata in one call. Scanned pages (no text layer) go through OCR automatically; this paper had a text layer, so no OCR was needed.
A real run
This is the input from one of my own test runs:
{ "urls": [ { "url": "https://arxiv.org/pdf/1706.03762" } ], "outputFormats": [ "text", "markdown" ], "ocr": "auto", "ocrLanguages": [ "eng" ], "extractTables": true, "maxPages": 0, "concurrency": 3 } It returned 1 item(s). Here is one of them (long fields trimmed, nothing else edited):
{ "status": "ok", "url": "https://arxiv.org/pdf/1706.03762", "fileType": "pdf", "fileName": "1706.03762", "sizeBytes": 2215244, "pageCount": 15, "processedPages": 15, "ocrPages": 0, "metadata": { "Author": "", "CreationDate": "D:20240410211143Z", "Creator": "LaTeX with hyperref", "Producer": "pdfTeX-1.40.25", "Subject": "", "Title": "" }, "charCount": 41099, "wordCount": 6343, "text": "Provided proper attribution is provided, Google hereby grants permission to\nreproduce the tables and figures in this paper solely for use in journalistic or\nsch...", "markdown": "Provided proper attribution is provided, Google hereby grants permission to reproduce the tables and figures in this paper solely for use in journalistic or sch...", "processingSeconds": 2.1 } Calling it from code
One HTTP call starts the run and waits for the results. Get your token in the Apify Console (Settings → API & Integrations).
curl -X POST "https://api.apify.com/v2/acts/michail-data-tools~document-to-text/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \ -H "Content-Type: application/json" \ -d '{"urls": [{"url": "https://arxiv.org/pdf/1706.03762"}], "outputFormats": ["text", "markdown"], "ocr": "auto", "ocrLanguages": ["eng"], "extractTables": true, "maxPages": 0, "concurrency": 3}' The same in Python:
import json, requests APIFY_TOKEN = "YOUR_APIFY_TOKEN" run_input = json.loads('''{ "urls": [ { "url": "https://arxiv.org/pdf/1706.03762" } ], "outputFormats": [ "text", "markdown" ], "ocr": "auto", "ocrLanguages": [ "eng" ], "extractTables": true, "maxPages": 0, "concurrency": 3 }''') items = requests.post( "https://api.apify.com/v2/acts/michail-data-tools~document-to-text/run-sync-get-dataset-items", params={"token": APIFY_TOKEN}, json=run_input, timeout=600, ).json() for item in items: print(item.get("title"), "->", str(item.get("text") or item.get("markdown") or item)[:200]) What it costs
There is no subscription. You pay only for successful results. Failed files are never charged.
- Document converted: $0.002 per document on the Free tier. This drops to $0.0014 on Gold, Platinum, and Diamond tiers.
- OCR page: $0.002 per page on the Free tier. This drops to $0.0014 on Gold, Platinum, and Diamond tiers. You only pay for pages that actually needed OCR (no text layer).
In my test run, the PDF had a text layer, so the OCR cost was $0.00. I only paid for the document conversion.
Where it helps
- RAG pipelines: Get clean Markdown chunks directly, without post-processing table artifacts.
- Scanned archives: Handles PDFs without text layers by applying OCR in 23 languages.
- Mixed file types: Processes PDF, DOCX, and TXT URLs in the same job.
- Metadata extraction: Returns file size, page count, and PDF metadata like Creator and CreationDate.
- Per-page output: Useful when you need to process or verify specific pages individually.
This removes the boilerplate code from your data ingestion step.
More examples (curl, Python, Node): podcast-transcript-api-examples. The tool: PDF & DOCX to Text, Markdown & Tables - OCR for Scanned PDFs.
Written with AI assistance; the run output above is real.

