PDF to Markdown & Text Extractor for RAG (DOCX, HTML, TXT) avatar

PDF to Markdown & Text Extractor for RAG (DOCX, HTML, TXT)

Pricing

Pay per event

Go to Apify Store
PDF to Markdown & Text Extractor for RAG (DOCX, HTML, TXT)

PDF to Markdown & Text Extractor for RAG (DOCX, HTML, TXT)

Input: URLs of PDF, DOCX, HTML or TXT files. Output: PDF to Markdown or plain text per document, per page, or as RAG-ready chunks with token counts. $2 per 1,000 documents plus $0.30 per 1,000 pages. No OCR.

Pricing

Pay per event

Rating

0.0

(0)

Developer

Winters Works

Winters Works

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

a day ago

Last modified

Share

Convert PDF to text, PDF to Markdown-ready text, DOCX, HTML and TXT files from URLs into clean, structured data for RAG pipelines, LLM ingestion, search indexing and document parsing. Get one row per document, per page, or per ready-to-embed chunk (with overlap and approximate token counts). Pure HTTP and pure JavaScript: no browser, no OCR, fast and cheap.

Use cases

  • Feed PDFs (papers, reports, manuals, filings, contracts you are allowed to process) into a vector database or an LLM context window.
  • Build a RAG index: choose chunk mode and get chunks with chunkIndex, word counts and approxTokens.
  • Pull metadata (title, author, page count) from large batches of PDFs.
  • Convert Word (.docx) documents to Markdown with headings preserved.
  • Quickly check how long a document is in tokens before sending it to a model.

Input

FieldDescription
urlsPublic URLs of PDF, DOCX, HTML or TXT files (up to 50 MB each).
outputModedocument (default), page or chunk.
maxPagesExtract only the first N pages of each PDF (default 3, 0 = all). Controls cost.
chunkSize, chunkOverlapApproximate tokens (chars / 4) per chunk and overlap, used in chunk mode.
includeMarkdownAdd a best-effort markdown field (default on).
maxFileSizeMbSkip files larger than this (max 50).

Running with empty input processes two small example PDFs (a tiny test file and the first 3 pages of the "Attention Is All You Need" paper).

{ "urls": ["https://arxiv.org/pdf/1706.03762"], "outputMode": "chunk", "maxPages": 0, "chunkSize": 500, "chunkOverlap": 50 }

Output

Document mode row (abridged):

{
"url": "https://arxiv.org/pdf/1706.03762", "fileName": "1706.03762", "mimeType": "application/pdf",
"pageCount": 15, "pagesExtracted": 3, "title": null, "author": null, "metadata": {"producer": "..."},
"likelyScanned": false, "charCount": 5412, "wordCount": 1353, "approxTokens": 1353,
"text": "...", "markdown": "...", "pages": [{ "page": 1, "text": "..." }]
}

Page mode adds page; chunk mode adds chunkIndex and chunkCount. Failed URLs produce a row with error and are not charged.

Pricing (pay per event)

  • $0.002 per document processed successfully (document-processed)
  • $0.0003 per page extracted (page-extracted). For DOCX/HTML/TXT, a "page" is a block of about 3,000 characters.

Example: a 20-page PDF costs $0.002 + 20 x $0.0003 = $0.008. Failed downloads, unsupported files and oversize files are free. Use maxPages to cap spend per document, and the run's max-cost setting to cap the whole run.

Limitations

  • Supported: PDF, DOCX, HTML, and TXT/MD/CSV. Legacy .doc, PPTX, XLSX and password-protected PDFs are not supported and return an error (not charged).
  • No OCR. Scanned or image-only PDFs return little or no text with likelyScanned: true, and are still charged as a processed document.
  • Maximum file size 50 MB (lower via maxFileSizeMb); each download times out after 60 s. Only public URLs, no logins or cookies.
  • Processes maxPages pages per PDF (default 3; 0 means all). Pages for DOCX, HTML and text are logical blocks of about 3,000 characters, not print pages.
  • PDF text keeps reading order but loses layout and tables, and PDF markdown is plain text. Token counts are approximate (characters / 4). Documents are fetched one after another, with no site-specific rate limiting beyond that.

FAQ

Does it do OCR? No. Scanned or image-only PDFs return empty or near-empty text and the row has likelyScanned: true. You are still charged the normal event price for a document that parsed, so check likelyScanned if you process scans. Is the Markdown accurate? DOCX headings, lists and tables and HTML structure convert to Markdown. PDFs have no reliable structure, so their markdown is plain extracted text. Which formats? PDF, DOCX, HTML, TXT/MD/CSV. Legacy .doc, .pptx and .xlsx are not supported. Password-protected PDFs? Not supported; they return an error and are not charged. Token counts? Approximate (characters / 4), good for planning, not exact for any specific model. Is this legal? The Actor only downloads files from URLs you supply and converts them to text. That is lawful only for documents you have the right to access and process. Copyright, confidentiality and privacy rules still apply to the content, and scraping a site's documents can violate its terms. You are responsible for what you process and how you use the output.

Built by Winters Works. Questions or feature requests: use the Issues tab.

Use from code and AI agents

Call it from any language with the Apify API, or let an AI agent find and run it through the Apify MCP server.

from apify_client import ApifyClient
run = ApifyClient("<YOUR_APIFY_TOKEN>").actor("wintersworks/document-to-text").call(run_input={"urls": ["https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf", "https://arxiv.org/pdf/1706.03762"], "outputMode": "document", "maxPages": 3})
items = ApifyClient("<YOUR_APIFY_TOKEN>").dataset(run["defaultDatasetId"]).list_items().items

Results land in the run's dataset (JSON, CSV, Excel). Set a maximum charge per run in the run options to cap spend.