PDF to Markdown & Text Extractor with OCR avatar

PDF to Markdown & Text Extractor with OCR

Pricing

from $2.10 / 1,000 document processeds

Go to Apify Store
PDF to Markdown & Text Extractor with OCR

PDF to Markdown & Text Extractor with OCR

PDF to Markdown and text extractor with OCR. Convert PDF, Word, Excel, PowerPoint, HTML and scanned documents to clean Markdown with metadata and RAG ready chunks for LLMs and AI agents.

Pricing

from $2.10 / 1,000 document processeds

Rating

0.0

(0)

Developer

Rod Services

Rod Services

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

13 days ago

Last modified

Share

PDF to Markdown and text extractor with OCR: also Word, Excel, PowerPoint, HTML and scanned images. Paste a file link, get clean Markdown, page-aware RAG chunks and metadata for LLMs. $3 per 1,000 documents, failed files are free.

What you get

For every document:

  • Clean Markdown that keeps headings, lists and tables, without running headers and page numbers.
  • OCR on scanned pages, automatic, Tesseract in 35 languages. Only pages without a text layer are OCRed.
  • RAG ready chunks with page numbers and section headings, sized for your embedding model.
  • Metadata: title, author, dates, page count, PDF version, HTML meta tags.
  • Optional page range for PDFs, for example 1-5, 10, 20-, and optional extracted images.

Supported formats: PDF, DOCX, XLSX, XLS, PPTX, HTML, EPUB, CSV, JSON, XML, TXT, Markdown, Outlook MSG, PNG, JPG, TIFF, WEBP, BMP and GIF. Google Drive, Google Docs, Sheets and Slides, Dropbox and GitHub share links are turned into direct downloads. Everything runs inside your Apify run. No third party AI service sees your files.

Typical uses:

  • LLM ingestion and RAG. Turn PDF libraries into chunks for pgvector, Pinecone, Qdrant, Weaviate or Chroma.
  • AI agents and MCP tools. One call that reads any PDF, Word file or web page as Markdown.
  • Scanned PDFs and images. Contracts, invoices and old reports become searchable text.
  • Tables. PDF tables with ruled lines, Word tables and Excel sheets become Markdown tables.

Quick start

  1. Open the Input tab.
  2. Add links in File URLs, or upload a file with Upload a file.
  3. Keep OCR on auto unless the files are all scans.
  4. Click Start. The example PDF converts in about 5 seconds. Results are in the Output tab.

From code, one HTTP call runs the Actor and returns the rows:

curl -X POST "https://api.apify.com/v2/acts/rod_analytics~doc-to-markdown/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"fileUrls": ["https://www.govinfo.gov/content/pkg/USCODE-2011-title17/pdf/USCODE-2011-title17-chap1-sec107.pdf"], "chunkSize": 800}'

With LangChain, load the chunks as documents:

from apify_client import ApifyClient
from langchain_core.documents import Document
client = ApifyClient("APIFY_TOKEN")
run = client.actor("rod_analytics/doc-to-markdown").call(
run_input={"fileUrls": ["https://example.com/report.pdf"], "chunkSize": 800}
)
docs = [
Document(page_content=c["text"], metadata={"source": item["sourceUrl"], "page": c["page"]})
for item in client.dataset(run["defaultDatasetId"]).iterate_items()
for c in item["chunks"]
]

Input example

{
"fileUrls": [
"https://www.govinfo.gov/content/pkg/USCODE-2011-title17/pdf/USCODE-2011-title17-chap1-sec107.pdf",
"https://example.com/report.docx"
],
"ocr": "auto",
"languages": ["eng", "deu"],
"chunkSize": 800,
"chunkOverlap": 80,
"pages": "1-3"
}
FieldDefaultWhat it does
fileUrlsDirect links to documents. Apify key-value store record URLs work too.
uploadedFileOne file uploaded from your computer in Console.
keyValueStoreRecords[]Record keys in this run's key-value store, or storeId/key. Useful when another Actor calls it.
ocrautoauto OCRs only scanned pages. force OCRs every page. off never OCRs.
languages["eng"]Tesseract codes, for example eng, deu, fra, spa, lit, pol, rus, jpn, chi_sim.
chunkSize1000Approximate tokens per chunk. 0 turns chunking off.
chunkOverlap100Approximate tokens repeated between chunks.
includeImagesfalseSave embedded images to the key-value store and link them in the Markdown.
maxPages0Only the first N pages or slides. 0 is all, but text PDFs stop at 300 pages.
pagesemptyPDF page range such as 1-5, 10, 20-. Empty means all pages.
saveMarkdownFilesfalseAlso save each document as a .md file.
maxFileSizeMb100Skip bigger downloads.
maxConcurrency2Documents converted in parallel.

Output sample

Real result of the prefilled example, shortened. Download the dataset as JSON, CSV, Excel or HTML.

{
"sourceUrl": "https://www.govinfo.gov/content/pkg/USCODE-2011-title17/pdf/USCODE-2011-title17-chap1-sec107.pdf",
"fileName": "USCODE-2011-title17-chap1-sec107.pdf",
"mimeType": "application/pdf",
"pages": 5,
"pagesProcessed": 5,
"title": "§ 107. Limitations on exclusive rights: Fair use",
"markdown": "by two or more authors, a waiver of rights under this paragraph made by one such author waives such rights for all such authors.\n\n(2) Ownership of the rights conferred by subsection (a)...",
"markdownLength": 36292,
"chunks": [
{
"index": 0,
"text": "by two or more authors, a waiver of rights under this paragraph...",
"tokensApprox": 845,
"page": 1,
"heading": null
}
],
"chunksCount": 13,
"metadata": {
"creator": "Federal Digital System, U. S. Government Publishing Office",
"createdAt": "2019-10-14T08:51:38+00:00",
"pdfVersion": "1.5"
},
"ocrPagesCount": 0,
"warnings": [],
"error": null
}
FieldDescription
fileName, mimeTypeFile name from the URL or headers, type checked against the content
pages, pagesProcessedPages for PDF, slides for PPTX, frames for images, and how many were read
titleDocument title from metadata or the first heading
markdown, markdownUrlClean Markdown, and the full .md file for documents over 200,000 characters
chunksindex, text, tokensApprox, page, heading
metadataAuthor, subject, keywords, created and modified dates, word count, HTML meta
ocrPagesCountPages that went through OCR
warnings, errorNotes such as skipped pages, and why a document failed. Failures are free

The Output tab has three views: Overview, Markdown and RAG chunks with one row per chunk.

Pricing

Pay per event. You pay only for converted documents and OCR pages. Failed downloads, broken files and password protected PDFs are free.

EventFree tierBronzeSilverGold
Document converted$0.003$0.0027$0.0024$0.0021
OCR page, only scanned pages$0.01$0.009$0.008$0.007
Run start, per GB of memory$0.001$0.001$0.001$0.001
  • 1,000 text PDFs cost $3 on the free tier and $2.10 on Gold.
  • A 100 page scanned book costs about $1.
  • Your discount tier follows your Apify subscription plan.
  • Set Maximum cost per run in Run options. The Actor never goes over it. Documents that do not fit are skipped, and scanned pages that do not fit are left out with a warning.

FAQ

Does it work with scanned PDFs? Yes. Pages without a text layer are rendered and read with Tesseract OCR. Handwriting and very low quality scans give weak results.

Can I convert only some pages? Yes. Set PDF page range, for example 1-5, 10, 20-. Only those pages are read and OCRed. For slides and TIFF frames use Max pages.

Are password protected PDFs supported? No. They return an error and are not charged. PDFs that only restrict printing or copying open normally.

What if a link opens a login or error page? The document fails with a clear error and is not charged. This happens with private Drive or Dropbox files and expired links. Share files with "Anyone with the link".

Is there a page limit? Text PDFs over 300 pages stop at page 300 when maxPages is 0, with a warning. Set maxPages to the page count you need, for example 1000. Scanned PDFs have no such limit, since you pay per OCR page.

How accurate are headings and tables? Headings come from font sizes, tables from ruled lines. Complex forms and borderless tables can come out as plain text.

Tips. Keep OCR on auto. List only the OCR languages you need. For big OCR jobs give the run more memory: 4 GB is about 2.7 times faster, 1 GB is the cheapest per page.

Is it legal? You must have the right to process the documents you submit.

Found a bug or need a feature? Open an issue in the Issues tab.

ActorWhat it does
Website Content Crawler to Markdown for RAG & LLMsCrawl a site and get clean Markdown for RAG and LLMs
SEO Audit Tool: Site Crawler, Broken Links & ScoreCrawl a site for broken links and SEO issues
PageSpeed Insights & Lighthouse Bulk CheckerCore Web Vitals and Lighthouse scores for many URLs
Tech Stack Detector: Wappalyzer & BuiltWith AlternativeSee which CMS, analytics and frameworks a site uses
Bulk Domain Lookup: DNS, WHOIS, SPF, DMARC & SSLDNS, mail security and SSL checks for domain lists
Speech to Text: Audio, Video & Podcast TranscriberTranscribe audio, video and podcasts
Email Validator & Verifier: Bulk MX & Disposable CheckClean email lists before you send
Website Contact Scraper: Emails, Phones & Social LinksEmails, phones and social links from company websites
VIES VAT Checker & EU Company Registry LookupValidate EU VAT numbers and look up companies
Companies House Scraper: UK Company Search & OfficersUK company profiles, officers and filings
EU TED Tenders Scraper & Alerts: Public ProcurementEU public tenders with daily alerts
Greenhouse, Lever & Ashby Job Scraper: 7 ATS in One FeedJobs from 7 ATS platforms in one feed
GitHub Scraper: Repo Stats, Stars, Trending & SearchStars, activity and trending GitHub repos