PDF to Markdown, Tables & RAG Chunks (with OCR)
Pricing
from $0.50 / 1,000 page processed (text layer)s
PDF to Markdown, Tables & RAG Chunks (with OCR)
Convert PDF, DOCX and image files to clean Markdown, tables as CSV and RAG-ready chunks with page numbers. Scanned pages are read with OCR. No API keys, pay per page, built for AI agents and LLM pipelines.
Pricing
from $0.50 / 1,000 page processed (text layer)s
Rating
0.0
(0)
Developer
Killis Haraway
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
3 hours ago
Last modified
Categories
Share
Turn PDF, Word (DOCX) and image files into clean Markdown, tables (rows + CSV) and RAG-ready chunks with page numbers. Scanned pages are read automatically with OCR. No API keys, no LLM calls, nothing to configure. You pay a fraction of a cent per page.
Built for AI agents and LLM pipelines: give it links (or upload a file), get back text your model can actually use.
What you get for each document
| Field | What it is |
|---|---|
markdown | The whole document as Markdown: headings (#, ##), paragraphs, bullet lists, tables, and <!-- page N --> markers |
tables | Every detected table with its page, rows (list of lists) and csv |
chunks | Text split for embeddings: text, page_start, page_end, nearest heading, char_count |
metadata | Title, author, subject, dates from the file properties |
page_count, pages_text, pages_ocr, pages_empty | What was read and how |
warnings, error | Plain-language notes and stable error codes (see below) |
Each document's Markdown is also saved as a .md file in the run's key-value store.
Quick start
In the Console: paste one or more links into Document URLs (or upload a file) and click Start.
API (Python):
from apify_client import ApifyClientclient = ApifyClient("<YOUR_APIFY_TOKEN>")run = client.actor("errandkit/pdf-to-markdown-tables").call(run_input={"documentUrls": ["https://www.irs.gov/pub/irs-pdf/fw9.pdf"],"outputMode": "documents",})for item in client.dataset(run["defaultDatasetId"]).iterate_items():print(item["document_name"], item["page_count"], len(item["tables"]))print(item["markdown"][:500])
RAG ingestion (one dataset item per chunk, ready for a vector database):
{"documentUrls": ["https://example.com/handbook.pdf", "https://example.com/policy.docx"],"outputMode": "chunks","chunkMaxChars": 1200,"chunkOverlapChars": 150,"includeMarkdown": false}
Base64 input (for agents and back ends that already hold the file):
{"documents": [{"name": "invoice.pdf", "content_base64": "JVBERi0xLjcK..."}]}
Use it from an AI agent (MCP)
This Actor works as a tool in Claude, Cursor, ChatGPT connectors and other MCP clients through Apify's MCP server:
https://mcp.apify.com/?actors=errandkit/pdf-to-markdown-tables
The agent passes a link, the Actor returns Markdown, tables and chunks. Results are JSON with stable field names, so agents don't have to guess.
Input options
| Option | Default | Notes |
|---|---|---|
documentUrls | – | Direct links to PDF, DOCX, PNG, JPEG, TIFF, GIF, BMP or WEBP files |
uploadedFile | – | Upload one file in the Console |
documents | – | JSON list of {name, url} or {name, content_base64} |
outputMode | documents | documents = one item per file; chunks = one item per chunk |
pages | all | PDFs only, e.g. 1-3,7 |
ocr | auto | auto reads only pages without a text layer; force OCRs every page; off never |
ocrLanguage | eng | spa, fra, deu, por, ita, or combined like eng+spa |
tables | true | Detect ruled tables in PDFs; all DOCX tables are kept |
chunking, chunkMaxChars, chunkOverlapChars | true, 1500, 150 | Chunks keep the nearest heading and page range; tables are split by rows with the header repeated |
includeMarkdown | true | Turn off to keep items small |
saveMarkdownFiles | true | Save 001-name.md files to the key-value store |
maxPagesPerDocument | 500 | Pages after this are skipped and not charged |
failOnEmpty | true | Mark the run failed if no document has any text |
Pricing
Pay per event. You only pay for pages that produced text.
| Event | Price | Per 1,000 |
|---|---|---|
| Page processed (text layer; DOCX counts 1 page per 3,000 characters) | $0.0005 | $0.50 |
| Page or image read with OCR | $0.003 | $3.00 |
| Actor start (Apify standard) | $0.00005 | $0.05 |
Examples: a 10-page digital PDF costs $0.005; a 10-page scan costs $0.03. Blank pages, failed downloads, encrypted or broken files are not charged. Set Maximum cost per run and the Actor stops before going over it, keeping everything already finished.
Error codes
Every failed document gets an item with status: "error" and one of these codes. One bad file never stops the rest of the batch.
| Code | Meaning |
|---|---|
DOWNLOAD_FAILED | The link returned an error (the HTTP status is included) or timed out |
URL_NOT_ALLOWED | Not http(s), or points to a private network address |
UNSUPPORTED_FORMAT | Not a PDF, DOCX or image (for example an HTML page, a ZIP, legacy .doc, or an Excel file) |
FILE_TOO_LARGE | Over 100 MB |
PDF_ENCRYPTED | Password-protected PDF |
PDF_CORRUPT, DOCX_CORRUPT, IMAGE_CORRUPT | The file is damaged |
PAGE_RANGE_INVALID | pages could not be parsed |
OCR_LANGUAGE_UNAVAILABLE | Unknown OCR language code |
NO_TEXT_FOUND | No text on any page (and OCR off, or the scan is unreadable) |
MAX_COST_REACHED | Your maximum cost per run was reached |
The run summary (OUTPUT in the key-value store) lists totals, the codes seen and the exact pages charged.
Good to know
- Tables: PDF tables are found from their drawn cell borders. Tables made only of aligned text (no lines) come through as text paragraphs.
- Columns: two-column pages are read left column first, then right. Complex magazine layouts may still mix.
- OCR quality depends on the scan. 200 dpi Tesseract works well on typed documents, poorly on handwriting.
- Not supported: password-protected PDFs, legacy
.doc, PowerPoint, spreadsheets (use a spreadsheet tool), web pages. - Typical speed: about 4 digital pages per second; about 1 OCR page per second.
Privacy
Files are processed in memory inside your own Apify run. Nothing is sent to any third-party service or AI model, and nothing is kept by the developer. Output lives in your run's storage under your account and retention settings.
Feedback
Found a document that converts badly? Open an issue on the Actor's Issues tab with a public link to it.
Part of the Errandkit catalog of data tools, APIs and MCP servers for AI agents: https://errandkit.com