PDF to Markdown & JSON for RAG (OCR, DOCX, PPTX, XLSX) avatar

PDF to Markdown & JSON for RAG (OCR, DOCX, PPTX, XLSX)

Pricing

from $3.00 / 1,000 converted pages

Go to Apify Store
PDF to Markdown & JSON for RAG (OCR, DOCX, PPTX, XLSX)

PDF to Markdown & JSON for RAG (OCR, DOCX, PPTX, XLSX)

Convert PDF, DOCX, PPTX, XLSX and HTML into clean Markdown and JSON for AI and RAG pipelines. Fast mode is cheap and near-instant; accurate mode adds full layout and table analysis. OCR for scanned PDFs, tables as Markdown/HTML/JSON, page or token chunking with token counts.

Pricing

from $3.00 / 1,000 converted pages

Rating

0.0

(0)

Developer

Maximillian Ruddy

Maximillian Ruddy

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

20 hours ago

Last modified

Categories

Share

docmd: documents to Markdown and JSON for RAG

Convert PDF (text or scanned), DOCX, PPTX, XLSX and HTML documents at URLs into clean Markdown and structured JSON, ready to feed into an LLM, a vector database or a RAG pipeline.

  • Fast by default: a normal text PDF page converts in about half a second.
  • Accurate mode when you need it: full layout analysis and table-structure recognition for dense forms and complex tables.
  • OCR built in: scanned pages are detected and read automatically.
  • Tables two ways: inline in the Markdown, and as a separate structured array (Markdown, HTML or JSON cells).
  • Chunking included: split by page or by token count, with token counts on every chunk.
  • Fair billing: pay per page. Failed documents are never charged, and runs stop cleanly at your spending limit.

Modes

fast (default)accurate
Best forMost RAG and LLM ingestionDense forms, multi-column layouts, tables you need exact
How it worksReads the PDF's own text layer and extracts tables with a line-based detector; OCR only on pages with no textFull layout model plus a table-structure recognition model
Speed on Apify (text page)~0.5 s~15–20 s (tables: up to ~2 min per dense page)
Price$0.003 per page$0.012 per page + $0.05 per table
MemoryDefault is fineNeeds 4096 MB. If the run has less, it stops before charging anything

DOCX, PPTX, XLSX and HTML are converted with native parsers in both modes. They're fast, and billed as normal pages.

Pricing

Pay per event. Platform usage is included, so you only pay the prices below.

EventPrice
Page (fast mode PDF page, or any DOCX/PPTX/XLSX/HTML page)$3.00 per 1,000
OCR page (a scanned page that needed OCR, either mode)$10.00 per 1,000
Accurate-mode page$12.00 per 1,000
Accurate-mode table$50.00 per 1,000
Actor start$0.001 per GB of run memory (e.g. $0.002 at 2 GB)

Examples:

JobCost
A 100-page text PDF, fast mode$0.30 plus start
10 scanned pages$0.10 plus start
A 20-page PDF with 5 tables, accurate mode$0.24 + $0.25 = $0.49 plus start
A document that fails to download or convert$0.00

Set a maximum cost per run in the run options, and docmd stops cleanly before going over it.

Input

FieldDefaultNotes
sources(required)URLs of the documents (PDF, DOCX, PPTX, XLSX, HTML). The type is detected from the file contents, so URLs without an extension work too.
modefastfast or accurate. See above.
outputFormatbothmarkdown, json or both.
chunkingnonenone, page or tokens.
chunkTokens800Target chunk size when chunking is tokens (50–8000).
ocrautoauto (only pages with no text layer), off or force.
tableFormatmarkdownHow each entry in tables is encoded: markdown, html or json. The Markdown body always uses Markdown tables.
maxPagesPerDocument50Spend guard: pages beyond this are skipped and not charged (1–2000).
{
"sources": [
{ "url": "https://www.irs.gov/pub/irs-pdf/f1040.pdf" },
{ "url": "https://example.com/report.docx" }
],
"mode": "fast",
"chunking": "tokens",
"chunkTokens": 800
}

Output

One dataset item per document:

{
"url": "https://www.irs.gov/pub/irs-pdf/f1040.pdf",
"fileName": "f1040.pdf",
"fileType": "pdf",
"mode": "fast",
"pageCount": 2,
"markdown": "# Form 1040 ...",
"tables": [
{ "index": 0, "page": 1, "rows": 3, "columns": 3, "content": "| ... |" }
],
"chunks": [
{ "text": "...", "page": 1, "tokens": 412 }
],
"totalTokens": 1748,
"ocrPages": 0,
"status": "ok",
"error": null
}

If a document can't be processed (unreachable URL, non-2xx response, a file over 100 MB, a corrupt file or an unsupported format), its item has "status": "failed" and a short error, and it isn't charged.

How pages are counted:

  • PDF: pages.
  • PPTX: slides.
  • XLSX: sheets.
  • DOCX and HTML: these have no real pages, so a page is counted per ~3,000 characters of output.

Limitations

  • This is machine extraction. Check important numbers, especially from tables and scans.
  • Fast-mode tables are found from ruling lines. Tables drawn only with shading can be missed, and form boxes are sometimes detected as small tables. Use accurate mode if tables matter.
  • Fast-mode text keeps the PDF's own line order. It doesn't detect columns or headings, and paragraphs may run together. Accurate mode rebuilds reading order and structure.
  • OCR text is plain lines in reading order, with no layout.
  • Scanned-page detection: in auto mode, a page counts as scanned when it has almost no text layer. A full-page image with a short real caption may not get OCR, so use ocr: force for those.
  • maxPagesPerDocument is applied while parsing PDFs. DOCX, PPTX, XLSX and HTML files are parsed in full.

Data handling

  • Each document is downloaded to a temporary file (up to 100 MB), converted, then deleted, even when an error occurs.
  • Output goes only to your own dataset for the run.
  • Logs contain URLs, counts and timings only, never document content.

Licences

Built only on permissively licensed components: docling (MIT), docling models (CDLA-Permissive-2.0 / Apache-2.0), RapidOCR (Apache-2.0), pypdfium2 (Apache-2.0 / BSD-3-Clause), pdfplumber and pdfminer.six (MIT), tiktoken (MIT), Apify SDK (Apache-2.0) and requests (Apache-2.0). There are no GPL or AGPL dependencies, so the output is safe to use in commercial products.

Support

Found a problem or need a format? Open an issue on this Actor's Issues tab. We reply within 3 business days.