PDF to Markdown Extractor - RAG Chunks avatar

PDF to Markdown Extractor - RAG Chunks

Under maintenance

Pricing

Pay per event

Go to Apify Store
PDF to Markdown Extractor - RAG Chunks

PDF to Markdown Extractor - RAG Chunks

Under maintenance

Extract clean Markdown text from PDF files. Preserves tables, removes running headers and footers, keeps correct reading order, and splits into RAG-ready chunks that never cut mid-sentence. Built for LLM ingestion, vector databases and AI knowledge bases.

Pricing

Pay per event

Rating

0.0

(0)

Developer

Peter Grillo

Peter Grillo

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

3 days ago

Last modified

Share

Document to RAG-Ready Markdown

Turn PDFs into clean markdown and retrieval-ready chunks. Built for people feeding institutional documents into RAG pipelines and LLMs.

Why this instead of a plain text extractor

Naive PDF text extraction produces text that looks fine and then quietly poisons a RAG index: running headers repeat on every chunk, tables collapse into unreadable word soup, and chunks get cut in the middle of sentences.

Measured against naive extraction (PyMuPDF get_text) on the same documents:

DocumentMetricNaiveThis actor
IRS Form 1040 instructions (126 pp)chunks cut mid-sentence468 / 73337 / 740
IRS Form 1040 instructionstables recovered as markdown089
IRS Form 1040 instructionsfragmented lines20.5%14.7%
NIST AI RMF (48 pp)fragmented lines14.0%6.2%
ResNet paper, 2-column (12 pp)fragmented lines42.5%18.7%
ResNet papertables recovered021
YOLO paper, 2-column (10 pp)fragmented lines37.9%20.5%
BERT paper, 2-column (16 pp)fragmented lines50.4%31.8%
IRS Form 1040 instructionstoken recall vs source-99.2%

Sentence integrity (a stricter check: share of sentences that read as complete and unbroken) is at parity with naive extraction on two-column papers — 96.5% vs 96.6% (ResNet), 92.1% vs 92.2% (YOLO), 85.5% vs 89.0% (BERT). We do not claim to improve reading order; we claim cleaner structure at no cost to it.

Where it does not help: clean single-column academic papers. On one arXiv paper our fragmentation was 8.2% vs naive 5.0% — if your corpus is single-column preprints, a simple extractor is fine and you should save your money.

What it does

  • Reading order - detects two-column layouts and reads columns in order.
  • Boilerplate removal - drops headers/footers that repeat across pages.
  • Tables as markdown - table regions are excluded from body text, so tabular numbers don't contaminate prose.
  • Headings - inferred from font size (not bold, which is used for emphasis).
  • De-hyphenation - rejoins words and sentences broken across lines.
  • Chunking - breaks on headings, never mid-sentence, with section, page_start, page_end metadata and configurable overlap.

Limitations (please read before paying)

  • No OCR. Scanned PDFs without a text layer produce little or no text. The run reports this in its status message.
  • Complex multi-column tables and heavy visual layouts extract imperfectly.
  • Verify output against the source before relying on it for anything consequential. See TERMS.md.

Input

FieldTypeDefaultNotes
pdfUrlsarray-Direct PDF links you have the right to process
chunkSizeint1800Target characters per chunk
chunkOverlapint150Character overlap between chunks
extractTablesbooltrueEmit tables as markdown
removeBoilerplatebooltrueStrip repeating headers/footers
emitChunksbooltrueChunks (true) or whole pages (false)
maxPagesint00 = all pages

Output

Chunk mode: {source, section, page_start, page_end, chars, text} Page mode: {source, page, columns, markdown, tables[]} Failures push {source, error} and are not charged.

Pricing

Pay per event: $0.02 per document + $0.001 per page. You are charged only for documents that extract successfully; failed URLs cost nothing.

Licence

AGPL-3.0. This is a network service, so you are entitled to the Corresponding Source: the complete source is at https://github.com/petergrillo/doc-to-rag-markdown — see also LICENSE and NOTICE. Uses PyMuPDF (AGPL-3.0 / Artifex commercial); not affiliated with Artifex.