PDF to Markdown & Clean Text Extractor (RAG Ready + MCP) avatar

PDF to Markdown & Clean Text Extractor (RAG Ready + MCP)

Pricing

from $2.80 / 1,000 pdfs parsed successfully

Go to Apify Store
PDF to Markdown & Clean Text Extractor (RAG Ready + MCP)

PDF to Markdown & Clean Text Extractor (RAG Ready + MCP)

Extract clean structured Markdown, two-column reading order, clickable hyperlinks, TOC bookmarks, metadata, and RAG chunks from PDFs with cloud-link auto-rewriting and Standby MCP.

Pricing

from $2.80 / 1,000 pdfs parsed successfully

Rating

0.0

(0)

Developer

James Edmans

James Edmans

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

15 hours ago

Last modified

Categories

Features

Limited permissionsSingle-tenantServer interface

Share

PDF-to-Markdown, Clean Text & Metadata Extractor (LLM & RAG Ready + MCP)

Apify Store Actor: forgekit/pdf-to-markdown-text-extractor | Runtime: Node.js 22 (pdfjs-dist + pdf-lib + optional local tesseract.js OCR) | Billing: Pay-Per-Event (PPE) + Standby MCP Server

Overview

PDF-to-Markdown, Clean Text & Metadata Extractor converts PDF files from public URLs, Google Drive / Dropbox / OneDrive share links, inline Base64 payloads, Apify Key-Value Stores, or upstream Apify Datasets into clean, structured Markdown, plain text, normalized metadata, clickable hyperlink inventories, Table-of-Contents bookmarks, and overlapping RAG chunks.

Because all parsing runs locally inside a deterministic Node.js container using pdfjs-dist with zero third-party scraping or external CAPTCHA-gated services, it operates with near-100% reliability at a fraction of the cost of cloud document APIs. It is designed specifically for LLM ingestion pipelines, vector databases, enterprise knowledge bases, and AI agents connecting over Apify's native Standby Model Context Protocol (MCP) server.

Feature Comparison vs. Top Competitors

  • Automatic Cloud-Share Link Rewriting (normalizeCloudPdfUrl): Automatically rewrites public Google Drive (/file/d/<ID>/view), Dropbox (?dl=0 -> ?dl=1), and OneDrive share URLs into direct binary downloads instead of failing on HTML viewer pages.
  • %PDF- Magic-Byte Guard & Zero-Charge Error Reporting: Inspects file signatures before parsing; HTML login walls or viewer pages emit an actionable errorCode: "HTML_INSTEAD_OF_PDF" without crashing the batch and with zero pdf-processed or page-extracted charges.
  • Font-Size & Two-Column Reading-Order Reconstruction: Computes document body font size and X-axis gutter occupancy to reconstruct # H1 / ## H2 / ### H3 headings, bulleted/numbered lists, left-before-right two-column reading order, and clickable [anchor](https://...) Markdown hyperlinks.
  • Boilerplate & Page-Number Stripping: Detects and removes repeated running headers/footers appearing across >= 60% of pages plus standalone "Page X of Y" counters.
  • Scanned Page & CID Glyph Corruption Detection: Flags low-text pages (isLikelyScanned: true), missing font ToUnicode/CID mappings (hasCidGlyphIssues: true), and supports optional local tesseract.js OCR fallback.
  • Native Standby MCP Server: Exposes extract_pdf_markdown and extract_pdf_metadata over JSON-RPC 2.0 / SSE for Claude Desktop, Cursor, and autonomous agents.
CapabilityPDF-to-Markdown Extractor (Ours)memo23/pdf-text-extractorautomation-lab/pdf-text-extractorgochujang/pdf-text-extractor
Structured Markdown + Headings + LinksYes (# H1, lists, [text](url))Partial (no link preservation)Plain text onlyPartial
Two-Column Reading-Order DetectionYes (X-gutter histogram)NoNoNo
Cloud Link Rewriter (Drive/Dropbox/OneDrive)Yes (normalizeCloudPdfUrl)NoNoNo
%PDF- HTML Guard & CID DetectionYes (HTML_INSTEAD_OF_PDF, hasCidGlyphIssues)NoNoNo
TOC Outline Bookmarks & RAG ChunkerYes (native outline + overlapping chunks)NoNoNo
Standby MCP ServerNative (/mcp — 2 tools)NoNoNo
Per-PDF / Per-Page Pricing (FREE)$0.002 start + $0.004/pdf + $0.0005/page$0.005 start + $0.005/pdf$0.005 start + $0.003/pdf$0.001 start + $0.005/pdf + $0.001/page

Input Configuration

FieldTypeRequiredDefaultDescription
urlsstring[]No*[]Public PDF URLs (SSRF-protected, up to 500).
normalizeCloudPdfUrlbooleanNotrueAuto-rewrite Google Drive, Dropbox, and OneDrive share links to direct PDF downloads.
base64Pdfsobject[]No*[]Inline PDF payloads [{ "filename": "doc.pdf", "dataBase64": "..." }] (up to 50).
kvsKeysstring[]No*[]Key-Value Store record keys containing binary PDFs (up to 200).
sourceKeyValueStoreIdstringNo""Optional external Apify KVS ID for kvsKeys.
inputDatasetIdstringNo*""Upstream Apify Dataset ID to pull PDF URLs from.
datasetUrlFieldstringNo"url"URL field name in inputDatasetId.
passwordstringNo""Optional secret password for encrypted PDFs (isSecret: true).
pageRangestringNo""1-indexed page selection (e.g. "1-5,8,10-12"). Empty = all pages up to maxPages.
maxPagesintegerNo250Safety cap on extracted pages per PDF (1–2000).
includeMarkdownbooleanNotrueInclude reconstructed Markdown output.
includeFullTextbooleanNotrueInclude plain full-text concatenation.
includePerPageTextbooleanNotrueInclude pages[] array with per-page metrics.
extractLinksAndOutlinebooleanNotrueExtract PDF outline bookmarks and embedded URL annotations.
removeHeadersFootersbooleanNotrueStrip repeated top/bottom margin lines matching >= 60% of pages.
removePageNumbersbooleanNotrueStrip standalone margin page counters.
preserveColumnOrderbooleanNotrueDetect two-column vertical gutters and read left column before right column.
minTextCharsPerPageintegerNo25Minimum non-whitespace characters below which a page is flagged isLikelyScanned.
ocrScannedPagesbooleanNofalseOptionally run local tesseract.js OCR on embedded images of scanned pages.
chunkForRagbooleanNofalseEmit overlapping chunks[] ready for vector embeddings.
chunkSizeCharsintegerNo1500Maximum characters per RAG chunk (200–16000).
chunkOverlapCharsintegerNo200Overlap characters between adjacent chunks (0–4000, < chunkSizeChars).
maxConcurrencyintegerNo5Concurrent PDF workers (1–20).
maxPdfSizeMbnumberNo30Maximum download/base64 size per PDF in MB (1–150).
timeoutSecsintegerNo30Download and parse timeout per PDF in seconds (5–180).

*At least one input source (urls, base64Pdfs, kvsKeys, or inputDatasetId) is required.

Output Example

Below is an exact output record captured from a local run of this Actor:

{
"source": "https://example.com/annual-report-2026.pdf",
"filename": "annual-report-2026.pdf",
"status": "ok",
"pageCount": 1,
"pagesExtracted": 1,
"isLikelyScanned": false,
"hasCidGlyphIssues": false,
"scannedPageNumbers": [],
"wordCount": 27,
"charCount": 202,
"metadata": {
"title": "Annual Engineering Report 2026",
"author": "Acme Analytics Ltd",
"subject": null,
"keywords": null,
"creator": "LaTeX / PDF Builder",
"producer": "pdf-lib (https://github.com/Hopding/pdf-lib)",
"creationDate": "2026-12-01T20:44:14.000Z",
"modificationDate": "2026-12-01T20:44:14.000Z",
"pdfVersion": "1.7",
"pageCount": 1,
"isEncrypted": false,
"isLikelyScanned": false
},
"outline": [],
"links": [
{
"pageNumber": 1,
"url": "https://docs.acme.example/benchmarks",
"anchorText": "See benchmarks at docs.acme.example"
}
],
"markdown": "# Annual Engineering Report 2026\n\n## Executive Summary\n\nDistributed processing achieved 99.98% uptime across all clusters in 2026.\n\n- Reduced cold-start latency by 44 percent\n\n[See benchmarks at docs.acme.example](https://docs.acme.example/benchmarks)",
"fullText": "Annual Engineering Report 2026\nExecutive Summary\nDistributed processing achieved 99.98% uptime across all clusters in 2026.\n• Reduced cold-start latency by 44 percent\nSee benchmarks at docs.acme.example",
"pages": [
{
"pageNumber": 1,
"text": "Annual Engineering Report 2026\nExecutive Summary\nDistributed processing achieved 99.98% uptime across all clusters in 2026.\n• Reduced cold-start latency by 44 percent\nSee benchmarks at docs.acme.example",
"markdown": "# Annual Engineering Report 2026\n\n## Executive Summary\n\nDistributed processing achieved 99.98% uptime across all clusters in 2026.\n\n- Reduced cold-start latency by 44 percent\n\n[See benchmarks at docs.acme.example](https://docs.acme.example/benchmarks)",
"wordCount": 27,
"charCount": 202,
"isLikelyScanned": false,
"hasCidGlyphIssues": false
}
],
"chunks": [
{
"index": 0,
"text": "# Annual Engineering Report 2026\n\n## Executive Summary\n\nDistributed processing achieved 99.98% uptime across all clusters in 2026.\n\n- Reduced cold-start latency by 44 percent\n\n[See benchmarks at docs.acme.example](https://docs.acme.example/benchmarks)",
"charCount": 251,
"pageStart": 1,
"pageEnd": 1
}
],
"errorCode": null,
"error": null
}

Pay-Per-Event (PPE) Pricing

Event KeyEvent TitlePrice (USD)Billing Trigger
actor-startActor run start$0.002Charged once per batch run that extracts at least one valid PDF (never charged on zero-success runs).
pdf-processedPDF parsed successfully$0.004Charged once per valid PDF successfully extracted (never charged on HTML pages, 404s, or corrupt files).
page-extractedPDF page extracted$0.0005Charged per page extracted from a valid PDF.
mcp-tool-callStandby MCP tool execution$0.004Charged per successful Standby MCP tool call.

Illustrative Cost Example: Extracting 100 five-page PDFs (500 pages total) costs $0.002 + (100 * $0.004) + (500 * $0.0005) = $0.652 USD.

Standby MCP Server & AI Agent Integration

Enable Apify Standby Mode (APIFY_META_ORIGIN=STANDBY) to connect forgekit/pdf-to-markdown-text-extractor directly to Claude Desktop, Cursor, or any Model Context Protocol (MCP) client over Streamable HTTP / SSE:

  • Health endpoint: GET /health
  • MCP JSON-RPC 2.0 & SSE endpoint: POST /mcp and GET /mcp
  • Exposed MCP tools:
    • extract_pdf_markdown — Full Markdown, plain text, per-page breakdown, outline, links, metadata, and optional RAG chunks from a PDF URL or base64 payload.
    • extract_pdf_metadata — Fast low-cost metadata, TOC bookmarks, page count, encryption status, and scanned-page detection.
{
"mcpServers": {
"pdf-to-markdown-text-extractor": {
"url": "https://forgekit--pdf-to-markdown-text-extractor.apify.actor/mcp",
"headers": {
"Authorization": "Bearer YOUR_APIFY_TOKEN"
}
}
}
}

Error Handling, Rate Limits & Limitations

  • SSRF Protection: All URL downloads enforce strict http:/https: scheme rules and block private, loopback, RFC1918, and cloud metadata IPs across redirects.
  • Partial Batch Resilience: Failed downloads, HTML viewer links (HTML_INSTEAD_OF_PDF), invalid headers (INVALID_PDF_HEADER), and corrupt PDFs emit structured status: "error" records without aborting sibling PDFs or incurring billable per-PDF charges.
  • Progress Visibility & Summary: Every PDF logs [PDF i/N] filename: extracted P pages (W words) and persists SUMMARY, RUN_SUMMARY, and PPE_LEDGER records in the default Key-Value Store.
  • Scanned PDFs: For heavy multi-page image-only PDFs requiring deep multi-language OCR and word bounding boxes, pair with our dedicated Bulk Image & Scanned-PDF OCR Engine Actor.

Quick Start & Example Input

1. Run in Apify Console (No Code)

  1. Open forgekit/pdf-to-markdown-text-extractor in Apify Console and click Try for free.
  2. Paste or adjust the ready-to-run input JSON below (safe defaults are pre-filled).
  3. Click Start and export results as JSON, CSV, Excel, or NDJSON from the Output tab.
{
"urls": [],
"normalizeCloudPdfUrl": true,
"base64Pdfs": [],
"kvsKeys": []
}

2. Run via API (apify-client — Node.js & Python)

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('forgekit/pdf-to-markdown-text-extractor').call({"urls":[],"normalizeCloudPdfUrl":true,"base64Pdfs":[],"kvsKeys":[]});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
from apify_client import ApifyClient
import os
client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("forgekit/pdf-to-markdown-text-extractor").call(run_input={"urls":[],"normalizeCloudPdfUrl":True,"base64Pdfs":[],"kvsKeys":[]})
items = list(client.dataset(run["defaultDatasetId"]).iterate_items())
print(items)

3. Connect to n8n, Make, Zapier & Webhooks

  • n8n / Make / Zapier: Add the official Apify module, choose Run Actor, select forgekit/pdf-to-markdown-text-extractor, and pass the JSON payload above.
  • Schedules & Webhooks: Attach an Apify Schedule for recurring runs and trigger downstream webhooks automatically on ACTOR.RUN.SUCCEEDED.

Use Cases — What Can You Do With This Data?

  • Document & Invoice Ingestion Pipelines: Automate PDF, OCR, table, or media extraction with PDF-to-Markdown, Clean Text & Metadata Extractor (LLM & RAG Ready + MCP) to feed accounting systems, ERPs, legal archives, and AI knowledge bases.
  • E-Commerce & Content Operations: Process product images, generate pixel-perfect PDFs/screenshots, transcode media, or create/decode barcodes at scale via API without managing local FFmpeg or Chromium servers.
  • AI Vision & Multimodal Agent Workflows: Convert raw PDFs, videos, podcasts, or webpages into clean Markdown, keyframes, transcripts, or optimized thumbnails ready for multimodal LLMs.
  • Automated QA & Visual Monitoring: Schedule recurring captures or document checks and export structured metadata + KV Store artifacts directly into Slack, S3, Make, or n8n.

Frequently Asked Questions (FAQ)

How much does PDF-to-Markdown, Clean Text & Metadata Extractor (LLM & RAG Ready + MCP) cost to run?

You only pay for actual output via transparent Pay-Per-Event billing (starting at $0.004 per pdf-processed (PDF parsed successfully); see the PPE Pricing table above). Runs that produce zero billable results or fail upstream incur $0.00 — including zero actor-start fee — and Apify's built-in Max total charge (ACTOR_MAX_TOTAL_CHARGE_USD) hard-caps spend automatically.

Does this Actor require proxies, logins, or CAPTCHA solving?

No. This Actor executes deterministic document/media processing locally inside the Apify container (Node.js 22, Sharp, PDF engines, FFmpeg, or Chromium where required) on files and URLs you supply, with strict SSRF protection blocking private/metadata IP ranges.

What export formats and integrations are supported?

Every run stores structured results in an Apify Dataset downloadable as JSON, CSV, Excel (XLSX), NDJSON, XML, or HTML Table via Console or REST API, plus native connectors for n8n, Make, Zapier, Google Sheets, Airtable, Slack, and webhooks.

Can AI agents (Claude Desktop, Cursor, ChatGPT, LangChain) call this Actor directly via MCP?

Yes! PDF-to-Markdown, Clean Text & Metadata Extractor (LLM & RAG Ready + MCP) includes a built-in Standby MCP Server at https://forgekit--pdf-to-markdown-text-extractor.apify.actor/mcp supporting JSON-RPC 2.0 (initialize, ping, tools/list, tools/call) with Claude-compliant ^[a-zA-Z0-9_.-]{1,64}$ tool schemas.

Do I need to provide an API key (password)?

All sensitive key fields (password) are optional BYOK upgrades marked isSecret: true — they are encrypted at rest by Apify and never echoed into datasets, KV summaries, or logs.

How fast and lightweight is it compared to browser scrapers?

It runs on lightweight Node.js 22 (256–512 MB RAM, zero headless browser) so typical runs finish in seconds with high reliability and low platform compute cost.

Explore companion Actors in Media, Document & PDF Processing and core ETL utilities to chain end-to-end pipelines:

ActorStore SlugMode
PDF Structured Table & Invoice/Statement Extractor (JSON, CSV, XLSX + MCP)forgekit/pdf-table-invoice-extractor✅ Standby MCP
PDF Toolkit: Bulk Merge, Split, Compress, Watermark, Rotate & Form Readerforgekit/pdf-toolkit-merge-split-watermarkBatch REST API
Bulk Image & Scanned-PDF OCR Engine (Multi-Language + Word Bounding Boxes + MCP)forgekit/bulk-image-pdf-ocr-engine✅ Standby MCP
HTML, Markdown & URL to Pixel-Perfect PDF & Invoice Rendererforgekit/html-markdown-url-to-pdf-rendererBatch REST API
Multi-Device Website Screenshot API (Desktop/Tablet/Mobile Matrix, Dark Mode, Visual Diff + MCP)forgekit/multi-device-website-screenshot-api✅ Standby MCP
Dataset Merge, Fuzzy Dedupe & Cross-Join Proforgekit/dataset-merge-dedupe-pro✅ Standby MCP
Dataset Diff & Change Detector (Added / Removed / Modified)forgekit/dataset-diff-change-detector✅ Standby MCP