PDF Text Extractor & PDF to Markdown: Tables, OCR, RAG
Pricing
Pay per event
PDF Text Extractor & PDF to Markdown: Tables, OCR, RAG
PDF text extractor and PDF to Markdown converter for LLMs: clean Markdown, tables as CSV, RAG chunks with page numbers, and OCR for scanned pages. Also Word, PowerPoint, Excel, HTML, EPUB and images. A 10-page text PDF costs about $0.008. Failed files are not charged.
Pricing
Pay per event
Rating
0.0
(0)
Developer
Kerm Labs
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
3 days ago
Last modified
Categories
Features
Share
PDF text extractor and PDF to Markdown converter built for LLMs and RAG. Paste a link (public Google Drive, Dropbox and arXiv links work) or upload a file and get clean Markdown, tables as CSV, and RAG chunks with page numbers. Scanned pages are read with OCR automatically. One dataset record per document, plus full Markdown, text, CSV and JSON Lines files in the key-value store.
Quick start: 1) Paste a document link or upload a file. 2) Click Start. 3) Read the Markdown in the dataset, or download the .md, CSV and JSON Lines files from the key-value store.
Typical cost: 10-page text PDF: $0.008. 10-page scan: $0.043. Plus a $0.0001 run start fee. Lower prices on paid Apify plans. Failed downloads and unsupported files are not charged.
| In one run | |
|---|---|
| Clean Markdown with headings, lists and paragraphs | Yes |
| Tables as rows, Markdown and CSV (scanned tables come out as text) | Yes |
| RAG chunks with heading path and page numbers | Yes |
| OCR for scanned pages in 7 languages | Yes |
| Running headers and footers removed (documents of 3+ pages) | Yes |
| Word, PowerPoint, Excel, HTML, EPUB and images too | Yes |
What you get from one run
- Clean Markdown with real structure: a title, section headings and sub-headings (numbered sections like "3.2.1" nest correctly), lists, and paragraphs split where the document splits them (first-line indents, 1.5 and double spacing included). Hyphenated words and paragraphs cut by a page break are joined again. Running headers, footers and page numbers are removed, also when left and right pages differ.
- Sideways pages (a landscape table on a portrait sheet) are turned and read as text, not sent to OCR.
- Real tables: ruled and borderless tables in PDFs, plus DOCX, PPTX, XLSX, HTML and CSV tables, as rows, as a GitHub Markdown table in place inside the text, and as a CSV file each.
- RAG chunks: token-sized chunks that break at paragraphs, lists and tables, carry a heading path and page numbers, and overlap. Also saved as one JSON Lines file per document, ready to import.
- Automatic OCR (Tesseract) only for scanned pages. Blank pages and pages with just a few words are not sent to OCR, and a scan lying on its side or upside down is turned upright first. English, Spanish, French, German, Portuguese, Italian, Dutch.
- Share links work: public Google Drive, Google Docs, Sheets and Slides, Dropbox, GitHub and arXiv links are turned into direct downloads.
- Per-page Markdown, metadata (title, author, created, modified, producer), word counts and warnings.
- Honest billing: failed downloads, unsupported files, too-large files, encrypted files without a password, blank pages and pages you skip are never charged. A link that returns a web page (login, error or viewer page) where a document was expected fails with a clear message and is not charged.
Who it is for
AI agents (it works through the Apify MCP server), RAG and search pipelines, and data teams that need tables out of reports, filings, invoices and manuals without flattening them to text.
Supported files
PDF, DOCX, PPTX, XLSX, XLS, HTML, CSV, JSON, EPUB, TXT, Markdown, and images (PNG, JPG, TIFF, always read with OCR). The type is detected from the content, not the file name. Legacy .doc and .ppt files and other formats come back as status unsupported (not charged): save them as .docx, .xlsx or .pptx first.
Input
| Field | What it does |
|---|---|
urls | Links to documents. Redirects are followed (up to 10). Public Google Drive, Google Docs/Sheets/Slides, Dropbox, GitHub and arXiv share links are turned into direct downloads. |
files | Upload files in the input form instead of using a public link. |
outputs | Any of markdown, text, tables, pages, chunks. Default markdown, tables, chunks. |
ocr | auto (scanned pages only, default), off, force. |
ocrLanguages | Default ["eng"]. Fewer languages is faster and more accurate. |
pageRange | For example 1-5, 8, 12-. Applies to PDF pages, slides and sheets. |
maxPagesPerDocument | Default 300, max 2000. Documents cut by it are partial. |
maxFileSizeMb | Default 100, max 200. |
maxOcrPagesPerDocument | Default 100. Scanned pages past the limit are left out (the document is partial); pages with a text layer still convert. |
chunkSize, chunkOverlap | Tokens, default 800 and 100. |
password | For encrypted PDFs (stored encrypted). |
maxConcurrency | Default 3. |
timeoutPerDocumentSecs | Default 300. Download plus conversion. |
{"urls": ["https://arxiv.org/pdf/1706.03762"],"outputs": ["markdown", "tables", "chunks"],"pageRange": "1-6"}
Output
Each dataset item (trimmed from a real run on an arXiv paper, 15 pages):
{"type": "document","url": "https://arxiv.org/pdf/1706.03762","fileName": "1706.03762","fileType": "pdf","status": "ok","error": null,"pageCount": 15,"pagesProcessed": 15,"ocrPages": 0,"tableCount": 2,"wordCount": 6294,"metadata": {"title": null, "author": null, "created": "2024-04-10T21:11:43", "modified": "2024-04-10T21:11:43", "producer": "pdfTeX-1.40.25"},"tables": [{"page": 6, "index": 1, "csvKey": "TABLE-1-p6-1.csv","rows": [["Self-Attention", "O ( n 2 · d )", "O (1)", "O (1)"], ["Recurrent", "O ( n · d 2 )", "O ( n )", "O ( n )"]],"markdown": "| Self-Attention | O ( n 2 · d ) | O (1) | O (1) |\n| --- | --- | --- | --- |\n| Recurrent | ..."}],"chunks": [{"id": "DOC-1-0", "index": 0, "pageStart": 1, "pageEnd": 2, "heading": null, "text": "...", "tokens": 715}],"files": {"markdownKey": "DOC-1-1706.03762.md", "textKey": null, "chunksKey": "CHUNKS-1.jsonl", "tablesCsvKeys": ["TABLE-1-p6-1.csv"]}}
Other fields: markdown, text, pages (page, markdown, ocr), warnings. Fields you did not ask for in outputs are left out.
markdownandtextare cut at 1 MB inside the item. The full.mdfile is always in the key-value store, whateveroutputssays (DOC-<n>-<name>.md), and.txtwhen you ask fortext. If a whole item would pass 5 MB,pages, thenchunks, then table rows are left out of the item (a warning says so) and stay in the key-value store files.- The
OUTPUTrecord lists every document with links to its files and which documents were skipped. - Tokens are estimated as characters divided by 4, not counted with a model tokenizer. Treat chunk sizes as close, not exact.
Use it from an AI agent
Call the Actor through the Apify MCP server with urls and the outputs you need. Use outputs: ["markdown"] for reading, add "chunks" for indexing and "tables" for data. Check status and warnings in each record: partial explains why in error.
MCP clients (Claude Desktop, Cursor, VS Code): connect https://mcp.apify.com?tools=bigkerm/document-to-markdown-tables-ocr, or run the server locally:
{"mcpServers": {"apify": {"command": "npx","args": ["-y", "@apify/actors-mcp-server", "--tools", "bigkerm/document-to-markdown-tables-ocr"],"env": { "APIFY_TOKEN": "YOUR_APIFY_TOKEN" }}}}
Use it from code: Python, JavaScript, LangChain, HTTP API
Python (pip install apify-client): convert a PDF to Markdown and RAG chunks.
from apify_client import ApifyClientclient = ApifyClient("YOUR_APIFY_TOKEN")run = client.actor("bigkerm/document-to-markdown-tables-ocr").call(run_input={"urls": ["https://arxiv.org/pdf/1706.03762"], "outputs": ["markdown", "chunks"]})for doc in client.dataset(run["defaultDatasetId"]).iterate_items():print(doc["status"], doc["url"], doc.get("wordCount"))print((doc.get("markdown") or "")[:500])for chunk in doc.get("chunks") or []:print(chunk["pageStart"], chunk["heading"], chunk["tokens"])
LangChain (pip install langchain-apify, token in APIFY_TOKEN): load each document as a LangChain Document.
from langchain_apify import ApifyWrapperfrom langchain_core.documents import Documentapify = ApifyWrapper()loader = apify.call_actor(actor_id="bigkerm/document-to-markdown-tables-ocr",run_input={"urls": ["https://arxiv.org/pdf/1706.03762"], "outputs": ["markdown"]},dataset_mapping_function=lambda item: Document(page_content=item.get("markdown") or "", metadata={"source": item["url"]}),)docs = loader.load()
JavaScript (npm install apify-client):
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: process.env.APIFY_TOKEN });const run = await client.actor('bigkerm/document-to-markdown-tables-ocr').call({urls: ['https://arxiv.org/pdf/1706.03762'],outputs: ['markdown', 'tables'],});const { items } = await client.dataset(run.defaultDatasetId).listItems();console.log(items[0].markdown.slice(0, 500));
HTTP API: one request that waits for the run (up to 5 minutes) and returns the dataset items.
curl -X POST "https://api.apify.com/v2/acts/bigkerm~document-to-markdown-tables-ocr/run-sync-get-dataset-items" \-H "Authorization: Bearer $APIFY_TOKEN" -H "Content-Type: application/json" \-d '{"urls": ["https://arxiv.org/pdf/1706.03762"], "outputs": ["markdown"]}'
No code (n8n, Make, Zapier): add the Apify app, choose "Run Actor", enter bigkerm/document-to-markdown-tables-ocr and the input JSON, then read the dataset items. A common flow: new file in Google Drive or an email attachment, its public link to this Actor, the Markdown to Notion, a database or a vector store.
Pricing
Pay per event:
- Run start: $0.00005 per GB of memory, so $0.0001 per run at the default 2 GB.
- Document converted: $0.003, once per document with status
okorpartial. - Page converted: $0.0005 per page with a text layer. Slides and sheets count as pages. Documents without fixed pages (DOCX, HTML, TXT, CSV, JSON, EPUB) are split into sections of about 500 words and each section counts as a page.
- OCR page: $0.004 per page that was read with OCR and produced text. An OCR page is not also charged as a converted page.
Never charged: download failures, HTTP errors, unsupported files, too-large files, encrypted files without the password, documents where no text was found, pages skipped by pageRange or by the limits, OCR pages that produced no text. Your maximum charge per run is respected: the run checks it before every document, stops cleanly, still saves what was converted (partial) and lists skipped documents in OUTPUT.
Example: a 10 page text PDF costs $0.003 + 10 x $0.0005 = $0.008, and a 10 page scan $0.003 + 10 x $0.004 = $0.043, plus the run start fee.
Volume discounts by Apify plan (per event, as listed in the Actor's pricing tab):
| Plan | Document converted | Page converted | OCR page |
|---|---|---|---|
| Free | $0.003 | $0.0005 | $0.004 |
| Starter (Bronze) | $0.0027 | $0.00045 | $0.0036 |
| Scale (Silver) | $0.0024 | $0.0004 | $0.0032 |
| Business (Gold) | $0.0021 | $0.00035 | $0.0028 |
| Enterprise (Platinum, Diamond) | $0.0021 | $0.00035 | $0.0028 |
FAQ
How do I convert a PDF to Markdown? Paste the PDF link in "Document links" (or upload the file) and run. The dataset item has markdown, and the full .md file is in the key-value store.
How do I extract tables from a PDF to CSV? Keep tables in "What to return". Each table is saved as its own CSV file and as rows in the item. Ruled tables work best; scanned tables come out as text.
How do I prepare PDFs for RAG? Ask for chunks. You get token-sized chunks (default 800 tokens, 100 overlap) that break at paragraphs, carry a heading path and page numbers, plus one JSON Lines file per document ready to import.
Does it handle scanned PDFs? Yes. In auto mode a page that is an image with no text layer (or only a stamp or page number in the margin) is OCRed. A scan with an existing hidden text layer is read from that layer. Blank pages, title pages with a few words and covers with real text over a picture are read from the text layer, which is faster, cheaper and more accurate. A scan that is sideways or upside down is turned upright before reading.
Headings? PDFs carry no heading marks, so headings are worked out from font size, bold fonts and numbering: the biggest text at the top of page 1 is the title, numbered sections ("3", "3.2", "3.2.1") nest by their number, and bold run-in phrases, table of contents lines and page stamps are not headings. Unusual designs can still be misread.
My link is a Google Drive or Dropbox share link. Public share links from Google Drive, Google Docs, Sheets and Slides, Dropbox, GitHub and arXiv are rewritten to direct downloads. Private files need to be uploaded instead. If a link returns a web page where a document was expected (a login or error page), the document fails with a message and is not charged.
Two-column papers? Two-column pages are read left column first, then right. Full-width titles and captions split the page into bands. Complicated layouts (sidebars, text around figures) can come out in the wrong order.
How good are the tables? Ruled tables are usually good. Borderless tables are found by column gaps and can merge two close columns or split a wrapped header into extra rows. Cells with several lines of text are joined into one line. Scanned tables are read as text, not as tables.
Is OCR accurate? Tesseract is good on clean 300 dpi scans and weak on handwriting, stamps and faded typewriter text. Expect some misread words on old documents.
Passwords? Set password for PDFs that need one. It is stored encrypted and used for all documents in the run. Without it the document is encrypted and free.
Is my file kept? Files are downloaded to the run's temporary disk and deleted after conversion. Nothing is sent anywhere except the download itself. Office macros and scripts are never run.
Can it convert web pages (HTML to Markdown)? Yes. Paste the page link. The page's main content is converted (one <main> element when the page has it); navigation, headers, footers, sidebars, hidden elements and language menus are left out. JavaScript is not run, so pages built in the browser can come out empty.
Can it read text from images (image to text)? Yes. PNG, JPG and TIFF are always read with OCR and billed as OCR pages. An image where no text was found is not charged.
How do I extract plain text from a PDF? Set "What to return" to text. The dataset item has text and a .txt file is saved per document.
Limits
- Max 2000 pages and 200 MB per document (defaults 300 and 100). Zip-based files that unpack to more than 400 MB or look like decompression bombs are refused. Images over 100 million pixels are refused.
- Private, loopback and cloud metadata addresses are blocked on every redirect.
- Documents run in a separate process killed at
timeoutPerDocumentSecs. Pages finished before that are kept (partial). - Memory: the default is 2048 MB. Each document that needs OCR can use about 500 MB, so lower
maxConcurrencyfor large scanned jobs. - Pictures and charts inside documents are not described. Headers and footers of DOCX files, footnotes and comments are not included.
- Page headers, footers and page numbers are removed only when 3 or more pages are converted (after
pageRange). - Pages that cannot be read are skipped with a warning and the document is
partial; you are charged only for pages that produced text. - A
pageRangethat starts after the last page (for example12-on 10 pages) selects no pages: the document isfailedand not charged. - Compressed downloads are unpacked only up to
maxFileSizeMb.
Ready-made examples
Open one, change the link, and click Start: PDF to Markdown, PDF to text, PDF table extractor (CSV), OCR scanned PDF to text, image to text OCR, PDF to RAG chunks, HTML to Markdown, Word DOCX to Markdown, Excel XLSX to Markdown and CSV, PowerPoint PPTX to Markdown.
More from Kerm Labs
SEO Audit & Broken Link Checker with llms.txt Generator: a 0-100 SEO score with fixes, verified broken links, an llms.txt draft and which AI crawlers your robots.txt blocks, for any website.