PDF to Markdown, Text & Tables (with OCR) avatar

PDF to Markdown, Text & Tables (with OCR)

Pricing

from $1.00 / 1,000 page converteds

Go to Apify Store
PDF to Markdown, Text & Tables (with OCR)

PDF to Markdown, Text & Tables (with OCR)

Convert PDFs from URLs into clean Markdown for LLMs and RAG: headings, paragraphs, lists, ruled tables as Markdown and JSON, two-column layouts, metadata, optional chunks. Scanned pages are OCR'd automatically.

Pricing

from $1.00 / 1,000 page converteds

Rating

0.0

(0)

Developer

Phuc Tiet

Phuc Tiet

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

8 days ago

Last modified

Share

Turn PDFs into clean Markdown that LLMs, RAG pipelines and humans can use: headings, paragraphs, bullet and numbered lists, ruled tables as Markdown tables and JSON, document metadata and page markers. Scanned pages are OCR'd automatically. Optional RAG chunks with heading and page range.

Paste PDF URLs, click Start, and download the results as JSON, CSV or Excel, or use them via API, MCP, Make, Zapier or n8n.

Why this one

  • Pay per page, not per file. A 1-page invoice costs a tenth of a cent, so you never overpay for small files. Long files are capped by maxPagesPerDocument.
  • Real Markdown structure. Headings are detected from font size and weight, lists are recognised, hyphenated line breaks are re-joined, two-column layouts are read column by column, and rotated margin stamps are dropped.
  • Tables you can use. Ruled tables are placed in the Markdown where they appear, and are also returned as tables[].rows (JSON arrays).
  • OCR only where needed. In auto mode only pages without a text layer (scans) are OCR'd with Tesseract, in English, German, French, Spanish, Italian, Portuguese or Dutch.
  • RAG-ready. chunkSize returns paragraph-aligned chunks with heading, pageStart and pageEnd, so answers can cite pages.
  • Robust. Retries with backoff, file-size limits, and clear error codes (HTTP_404, NOT_A_PDF, PASSWORD_REQUIRED, TOO_LARGE, TIMEOUT...). One bad file never stops the run, and failed files are not charged.

Input

FieldDefaultDescription
documentUrls–Direct PDF links (required). Up to 5,000 per run.
ocrModeautoauto (scanned pages only), off, force.
ocrLanguageengeng, deu, fra, spa, ita, por, nld, or combinations like eng+deu.
extractTablestrueMarkdown tables in place + JSON tables.
maxPagesPerDocument3000 = all pages.
chunkSize / chunkOverlap0 / 200RAG chunks in characters (0 = off).
includePlainTextfalseAdd a plain-text version.
pageMarkerstrue<!-- page N --> comments in the Markdown.
pdfPassword–For encrypted PDFs (stored as a secret).
maxFileSizeMb100Larger files are skipped (not charged).
{
"documentUrls": ["https://www.irs.gov/pub/irs-pdf/fw9.pdf"],
"chunkSize": 2000
}

Output

One dataset row per document:

{
"url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf",
"status": "ok",
"fileName": "fw9.pdf",
"pageCount": 6,
"pagesProcessed": 6,
"ocrPages": 0,
"title": "Form W-9 (Rev. March 2024)",
"author": "SE:W:CAR:MP",
"creationDate": "2024-03-06T08:18:13",
"wordCount": 6251,
"tableCount": 1,
"markdown": "<!-- page 1 -->\n\n# W-9 Request for Taxpayer ...",
"tables": [{ "page": 3, "index": 0, "rows": [["IF the entity/individual on line 1 is a(n) . . .", "THEN check the box for . . ."], ["• Corporation", "Corporation."]], "markdown": "| IF the entity ... |" }],
"chunks": [{ "index": 0, "text": "...", "heading": "W-9 Request for Taxpayer", "pageStart": 1, "pageEnd": 1, "chars": 1730 }],
"warnings": []
}

Failed documents get "status": "error" with errorCode and error. Very large results (over ~8 MB) are saved in full to the key-value store and linked from fullResultUrl. A run summary is saved as OUTPUT.

How much does it cost to convert PDF to Markdown?

Pay per event, plus a tiny Actor start fee ($0.00005 per GB of memory):

  • Page converted (text layer): $0.001 per page ($1.00 per 1,000 pages).
  • Page OCR'd (scanned page, or any page with ocrMode: force): $0.004 per page ($4.00 per 1,000 pages).

Platform usage is included in the price. Failed downloads, non-PDF files and pages beyond maxPagesPerDocument are not charged. If you set a maximum cost per run, the Actor processes only the pages that fit within it.

Limitations (honest)

  • It is a fast, rule-based converter (pdfplumber + Tesseract), not a vision-language model. It works best on born-digital PDFs such as reports, papers, forms, contracts, manuals and invoices.
  • Tables are detected when they have ruling lines. Borderless tables and booktabs-style tables (only horizontal rules) come out as text lines, not Markdown tables.
  • Math formulas, sub/superscripts and complex figure labels are kept as plain text and may be fragmented.
  • OCR quality depends on scan quality. Handwriting is not supported.
  • Only PDF input. The URL must return the file itself, not an HTML viewer page.
  • Process only documents you have the right to use. Files are processed inside your run and are not stored anywhere else.

FAQ

Can I upload a file instead of a URL? Upload it to an Apify key-value store, Dropbox (use a ?dl=1 link), S3 or similar, and pass the direct link.

Encrypted PDF? Set pdfPassword. Without it the document fails with PASSWORD_REQUIRED and is not charged.

How fast is it? Typically 0.05–0.3 s per text page and 2–4 s per OCR page.

Use it from AI agents (MCP), the API, Make, Zapier and n8n

  • AI agents and MCP clients (Claude, ChatGPT, Cursor, VS Code): add https://mcp.apify.com?tools=pinkish_armada/pdf-to-markdown as an MCP server, and your agent can convert PDFs to Markdown, text and tables as a tool call.
  • API: run it and get the results in one request:
curl -X POST "https://api.apify.com/v2/acts/pinkish_armada~pdf-to-markdown/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"documentUrls":["https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"]}'
  • No-code: use the official Apify apps for Make, Zapier and n8n ("Run an Actor"), then send results to Google Sheets, Slack, Airtable or your database. You can also schedule runs in Apify Console and add a webhook or email integration.