PDF to Markdown & Text Extractor with OCR
Pricing
from $2.10 / 1,000 document processeds
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
Maintained by CommunityActor stats
0
Bookmarked
1
Total users
0
Monthly active users
13 days ago
Last modified
Categories
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
- Open the Input tab.
- Add links in File URLs, or upload a file with Upload a file.
- Keep OCR on
autounless the files are all scans. - 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 ApifyClientfrom langchain_core.documents import Documentclient = 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"}
| Field | Default | What it does |
|---|---|---|
fileUrls | Direct links to documents. Apify key-value store record URLs work too. | |
uploadedFile | One 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. |
ocr | auto | auto 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. |
chunkSize | 1000 | Approximate tokens per chunk. 0 turns chunking off. |
chunkOverlap | 100 | Approximate tokens repeated between chunks. |
includeImages | false | Save embedded images to the key-value store and link them in the Markdown. |
maxPages | 0 | Only the first N pages or slides. 0 is all, but text PDFs stop at 300 pages. |
pages | empty | PDF page range such as 1-5, 10, 20-. Empty means all pages. |
saveMarkdownFiles | false | Also save each document as a .md file. |
maxFileSizeMb | 100 | Skip bigger downloads. |
maxConcurrency | 2 | Documents 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}
| Field | Description |
|---|---|
fileName, mimeType | File name from the URL or headers, type checked against the content |
pages, pagesProcessed | Pages for PDF, slides for PPTX, frames for images, and how many were read |
title | Document title from metadata or the first heading |
markdown, markdownUrl | Clean Markdown, and the full .md file for documents over 200,000 characters |
chunks | index, text, tokensApprox, page, heading |
metadata | Author, subject, keywords, created and modified dates, word count, HTML meta |
ocrPagesCount | Pages that went through OCR |
warnings, error | Notes 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.
| Event | Free tier | Bronze | Silver | Gold |
|---|---|---|---|---|
| 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.