PDF to Text Extractor - PDF Parser, PDF to Markdown & OCR
Pricing
from $5.00 / 1,000 pdf extracteds
PDF to Text Extractor - PDF Parser, PDF to Markdown & OCR
Extract text from PDF URLs, uploads or base64 with this PDF extractor: Markdown, tables, OCR in 126 languages, page-cited RAG chunks for LLMs and proxy fallback. Follows article and landing pages to PDFs via citation metadata or arXiv patterns; unresolved HTML has no extraction charge.
Pricing
from $5.00 / 1,000 pdf extracteds
Rating
0.0
(0)
Developer
Hojun Lee
Maintained by CommunityActor stats
0
Bookmarked
309
Total users
32
Monthly active users
20 hours
Issues response
8 hours ago
Last modified
Categories
Features
Share
PDF to Text Extractor — PDF Parser, PDF to Markdown, RAG Chunks
Extract text from PDF URLs or base64 files with a PDF extractor that returns page text, PDF to Markdown, or RAG chunks. Enable OCR for scanned pages; native-text PDFs work without it.
Downloads go direct first and fall back to Apify Proxy on their own when a host blocks them (no extra charge). Five PDFs run in parallel by default, files up to 100 MB are accepted, very long output is split into parts under the 9 MB dataset item limit, and a run that reaches its time limit still delivers the pages it has read (status: "partial", billed only for those pages).
Quick start
This public one-page PDF finishes in a few seconds:
{"urls":["https://pdfobject.com/pdf/sample.pdf"],"outputFormat":"per_page","maxPages":1}
One dataset item from this input (text truncated here; a summary row per PDF follows the page rows):
{"_type": "page", "url": "https://pdfobject.com/pdf/sample.pdf", "url_index": 0, "page": 1, "page_count": 1, "char_count": 2878, "word_count": 416, "text": "Sample PDF\nThis is a simple PDF file. Fun fun fun.\nLorem ipsum dolor sit amet, ...", "table_count": 0, "ocr_applied": false}
_type identifies the record as a page. page and page_count locate it in the PDF. text is extracted text; char_count and word_count describe it. table_count counts detected tables, and ocr_applied reports whether OCR was used. Text layout and counts can vary slightly by parser version.
Bank & card statement ledger (beta)
Set statementLedger: true to add a ledger object to extracted PDF rows. The actor first reads detected tables, then tries text lines when no table rows are recognized. Rows include date, description, debit, credit, signed amount, and balance; balance_check counts consecutive balance mismatches, and confidence is high, medium, or low. Missing or ambiguous fields remain null or raw. This is a bank-agnostic beta, not a claim of support for any particular bank or card format. The flag is off by default and adds no billing event.
Limits
The URL must return a readable PDF. Password-protected files need the password input; wrong passwords, corrupt files, oversized files, and blocked downloads produce errors. Scanned pages need enableOcr: true for text recognition. maxPages defaults to 100 and maxPdfMb to 100.
Text is read with PDFium (pypdfium2, Apache-2.0/BSD-3) in content-stream order, and tables with pdfplumber (MIT). Since v1.15 the actor contains no AGPL code; on our reference PDFs the per-page text matches earlier versions at ≥ 0.999 similarity, with the same fields.
Page-cited RAG chunks (v1.17)
Every rag_chunks row now carries page_start, page_end (physical, one-based), citation_url (...pdf#page=N), heading, heading_path and token_estimate, so retrieved passages cite their source page without rebuilding chunks from the page rows. New input chunkStrategy: chars (default, chunk texts unchanged) or headings (never crosses an H1/H2). Details in RAG-Ready Chunking.
Reliability on hard PDFs (v1.13)
- Automatic proxy fallback. Each PDF is downloaded directly first. If the host answers HTTP 401, 403, 407 or 429, or the connection fails, the download is retried once through Apify Proxy. The retry adds no charge event. The summary row's
fetched_viasaysdirect,proxy_fallback,proxy(your ownproxyConfiguration) orbase64. SetproxyFallback: falseto turn it off. A 404 or other error is not retried. - Oversize split. Apify rejects dataset items over 9 MB. A
document,markdownorpagerow that would exceed about 8 MB is split into several rows that share adocumentIdand carrypartandpartCount(1-based) pluspart_char_count. Join thetext(ormarkdown) of the parts inpartorder to get the whole document. Document totals such aschar_countare kept on every part;tablesandledgerare on part 1. Rows that fit carrypart: 1, partCount: 1. Splitting does not change billing. - Partial results on the run deadline. When the run is close to its time limit, the actor stops reading pages and delivers what it has read. Those rows and the summary have
status: "partial"(otherwise"complete"), the summary haspages_not_reached, and only the delivered pages are charged; the per-PDFpdf-extractedfee is waived. A partial PDF does not update thechangeDetectionbaseline (changedisnull) and sends no webhook. PDFs that have not started are skipped with an uncharged error row, as before. TheSUMMARYrecord counts partial PDFs inpdfs_partial. - Parallel PDFs within memory.
maxConcurrencydefaults to 5. The actor lowers it when that many PDFs ofmaxPdfMbwould not fit in the run's memory (about 256 MB plus 3 ×maxPdfMbper PDF; at the default 2 GB and 100 MB, 5 fit).
Pricing
Pay-per-event — you pay only for what is extracted:
| Event | Price |
|---|---|
| Actor start (charged by Apify, one per GB of run memory) | $0.001 |
| PDF successfully extracted | $0.02 |
| Page extracted | $0.001 |
Not charged: failed PDFs (download error, wrong/missing password, corrupt file — you get an ok: false row), pages that fail or time out, pages dropped by skipEmptyPages, the proxy-fallback retry, and the per-PDF fee of a PDF cut short by the run time limit (status: "partial"). OCR and output format add no fee: each physical page is billed once in per_page, combined, both, markdown or rag_chunks.
Example: one 80-page native-text PDF at 1 GB = $0.001 + $0.02 + 80 × $0.001 = $0.101.
Use from AI agents (MCP)
Connect your agent to Apify's official MCP server with an Apify token. Select the Actor tool gochujang/pdf-text-extractor, pass the Quick start JSON as input, then retrieve its dataset items through the MCP server. No separate gateway is needed.
Runs started through the MCP server (or Apify AI chat) get Markdown in parts of at most 45 KB, so limit/offset paging works on long PDFs. Each part has part, partCount, documentId, markdown_preview (the first 2,000 characters of the document) and markdown_truncated. Join the markdown of all parts with the same documentId in part order to get the full document. Runs from the API, Console or schedules keep one Markdown item per PDF, as before. The dataset declares every output field with a description, the run's status message says how many PDFs and pages were read, and a run with no usable result leaves a TIP record that says what to change.
⭐ If this saves you time, a quick review on the Store page helps others find it.
⚡ Run in 30 seconds
Paste any PDF URL — direct links, Google Drive, or Dropbox — and click Start:
# Direct PDF URLhttps://www.irs.gov/pub/irs-pdf/f1040.pdf# Google Drive share link (auto-resolved)https://drive.google.com/file/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms/view# Dropbox share link (auto-resolved)https://www.dropbox.com/s/abc123/report.pdf?dl=0# SharePoint / OneDrive share link (auto-resolved)https://company.sharepoint.com/:b:/s/team/EaBcD...view.aspx
Default output is rich Markdown — headings, lists, tables, code blocks auto-detected. Switch to rag_chunks mode to get overlapping text windows ready to embed into Pinecone, Weaviate, Chroma, Qdrant, or any vector DB — every chunk cites its pages (page_start, page_end, citation_url ending in #page=N) and its heading chain (heading_path).
Why this PDF scraper?
Free PDF extractors give you raw text dumps. This actor goes further:
| Feature | Free alternatives | This actor |
|---|---|---|
| RAG chunks (configurable overlap) | ❌ | ✅ |
Page-cited chunks (page_start, page_end, citation_url) | ❌ | ✅ |
Heading-aware chunks (heading_path, chunkStrategy: headings) | ❌ | ✅ |
| SharePoint / OneDrive URL resolution | ❌ | ✅ |
| Table extraction (2D arrays) | ❌ | ✅ |
| PDF type classification (text vs scanned) | ❌ | ✅ |
| Password-protected PDFs | ❌ | ✅ |
| Auto-OCR for scanned pages | Partial | ✅ Full |
| Skip empty pages option | ❌ | ✅ |
| Batch 50 PDFs in one run | Partial | ✅ |
Page range expressions (1-3,7,10-) | ❌ | ✅ |
| Upload a PDF file from your computer | ❌ | ✅ |
Parallel PDFs (maxConcurrency, 5 by default) | ❌ | ✅ |
| Automatic proxy fallback on 401/403/407/429 | ❌ | ✅ |
Oversize output split into parts (documentId, partCount) | ❌ | ✅ |
| Partial results when the run times out, billed per delivered page | ❌ | ✅ |
| Per-PDF timeout (one slow PDF fails alone) | ❌ | ✅ |
| OCR page cap per PDF (time/cost control) | ❌ | ✅ |
| Webhook / Telegram alerts | ❌ | ✅ |
Python API example
from apify_client import ApifyClientclient = ApifyClient("YOUR_APIFY_TOKEN")# Extract text from a single PDFrun = client.actor("gochujang/pdf-text-extractor").call(run_input={"url": "https://www.sec.gov/Archives/edgar/data/320193/aapl-10k.pdf","outputFormat": "markdown",})items = list(client.dataset(run["defaultDatasetId"]).iterate_items())markdown_doc = next(i for i in items if i["_type"] == "markdown")print(markdown_doc["markdown"][:500])
# Batch: extract tables from 10 SEC filings at oncerun = client.actor("gochujang/pdf-text-extractor").call(run_input={"urls": ["https://www.sec.gov/Archives/edgar/data/320193/aapl-10k.pdf","https://www.sec.gov/Archives/edgar/data/789019/msft-10k.pdf",],"extractTables": True,"outputFormat": "per_page","maxPages": 200,})pages = list(client.dataset(run["defaultDatasetId"]).iterate_items())
# RAG pipeline: extract + chunk + embedrun = client.actor("gochujang/pdf-text-extractor").call(run_input={"url": "https://example.com/whitepaper.pdf","outputFormat": "rag_chunks","chunkSize": 1000,"chunkOverlap": 200,})chunks = [i for i in client.dataset(run["defaultDatasetId"]).iterate_items()if i["_type"] == "chunk"]# chunks are ready to embed into Pinecone/Weaviate/Chroma
Use cases
- AI / LLM pipelines — Convert PDF to text for ChatGPT, Claude, Gemini, or RAG vector search. One call returns clean chunks ready for embedding.
- SEC filings — Pull text + tables from 10-K, 10-Q, 8-K in batch. Combine with our SEC EDGAR Tracker.
- Research aggregation — Build a searchable database of academic papers + abstracts from arXiv or PubMed PDFs.
- Financial reports — Auto-extract earnings tables from quarterly releases; pipe into spreadsheets or databases.
- Legal documents — Contracts, court filings, regulatory submissions — extract and index at scale.
- Invoice & receipt parsing — Extract line items and totals from PDF invoices without manual data entry.
- Government records — FOIA responses, regulatory filings, public data PDFs — download and parse in bulk.
- Scanned document digitization — Bank statements, old reports, image PDFs via OCR. Enable
enableOcrand get text even from image-only PDFs. - Compliance audit — Index every PDF in your corporate document store; feed into your search or compliance tools.
What you get
Summary row (one per PDF)
{"_type": "summary","url": "https://www.sec.gov/Archives/.../aapl-10k.pdf","ok": true,"page_count": 80,"pages_extracted": 80,"title": "Apple Inc. — Annual Report 2024","author": "Apple Inc.","created": "D:20240928081300Z","createdAt": "2024-09-28T08:13:00+00:00","modifiedAt": "2024-09-28T08:13:00+00:00","text_preview": "UNITED STATES SECURITIES AND EXCHANGE COMMISSION...","file_size_kb": 4820,"documentId": "3f9a1c0be2d47a65","status": "complete","extractedPageCount": 80,"fetched_via": "direct","ocr": {"enabled": false, "pagesOcred": 0, "language": "eng", "capped": false}}
extractedPageCount counts pages read without an error or timeout. ocr summarises OCR for the PDF: enabled (the enableOcr input, when OCR is installed), pagesOcred (pages whose text came from OCR, including automatic OCR of scanned pages), language and capped (ocrMaxPagesPerPdf stopped OCR). createdAt and modifiedAt are the PDF's dates in ISO 8601 (null when the PDF has none or they cannot be read); the raw created and modified values are kept.
Per-page row
{"_type": "page","url": "https://...","page": 12,"page_count": 80,"char_count": 3210,"word_count": 524,"text": "Item 1A. Risk Factors\n\nOur business...","tables": [[["Revenue", "Q1 2024", "Q4 2023"],["iPhone", "$45.96B", "$43.81B"],["Mac", "$9.66B", "$7.61B"]]],"table_count": 1,"ocr_applied": false}
Input Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
urls | array | — | List of PDF URLs to extract (batch mode) |
urlsText | string | — | Paste multiple PDF URLs, one per line — merged with urls |
url | string | — | Single PDF URL (used when urls is empty) |
pdfFile | string (file upload) | — | Upload a PDF in the Console; Apify passes the stored file's URL. Processed with any URLs above |
changeDetection | boolean | false | Hash each PDF's text and compare to the previous run — adds changed + content_hash to every record. Ideal for scheduled monitoring |
webhookUrl | string | — | POST a JSON alert to this URL when a PDF changes (requires changeDetection=true). Works with Slack, Discord, Make, Zapier, n8n |
changedOnly | boolean | false | Only output records for PDFs that changed (requires changeDetection=true). Scheduled runs produce zero records when nothing changed |
outputFormat | string | markdown | markdown (LLM-ready), per_page, combined, both, or rag_chunks |
chunkSize | integer | 2000 | rag_chunks only. Target characters per chunk (≈ 500 tokens at 4 chars/token), 200–10000 |
chunkOverlap | integer | 200 | rag_chunks only. Characters shared by consecutive chunks, 0–1000 |
chunkStrategy | string | chars | rag_chunks only. chars = fixed sliding window; headings = chunks never cross a detected H1/H2 heading (sections stay whole, still capped at chunkSize) |
extractTables | boolean | false | Detect and extract tables as 2D arrays |
statementLedger | boolean | false | Parse a bank or card statement into a best-effort transaction ledger (beta) |
extractImages | boolean | false | Add image_count field to each page |
skipEmptyPages | boolean | false | Skip pages with no extractable text (useful for scanned PDFs with mixed pages) |
enableOcr | boolean | false | Enable OCR for scanned pages (pages with < 50 chars auto-detected) |
ocrLanguage | string | eng | Any of the 126 tessdata_fast language codes (eng, deu, ara, rus, hin ...), or combined with +: eng+ara |
ocrMaxPagesPerPdf | integer | 0 | Stop OCR after this many pages per PDF (0 = no cap). The summary row gets ocr_capped, ocr_pages_skipped and ocr_note; capped page rows get ocr_skipped |
startPage | integer | 1 | First page to extract (1-indexed) |
endPage | integer | — | Last page to extract (inclusive) |
maxPages | integer | 100 | Max pages per PDF from startPage |
pageRange | string | — | Pages to extract, e.g. 1-3,7,10- (10- = page 10 to the end). Replaces startPage/endPage/maxPages/firstNPages/lastNPages when set. An invalid expression returns one error row and nothing is charged |
maxConcurrency | integer | 5 | PDFs processed at the same time (1–10), lowered automatically to fit the run's memory. 1 keeps input order |
maxPdfMb | integer | 100 | Reject PDFs larger than this (1–500 MB) |
timeoutPerPdfSecs | integer | 0 | Per-PDF time limit for download plus extraction (0 = none). A PDF that runs over gets an error row and the run continues. Rows already delivered for that PDF stay in the dataset |
password | string | — | Password for password-protected / encrypted PDFs |
userAgent | string | — | Custom User-Agent for the HTTP request |
proxyFallback | boolean | true | Retry a direct download once through Apify Proxy after HTTP 401/403/407/429 or a connection failure. No extra charge. Ignored when proxyConfiguration is set |
proxyConfiguration | object | — | Proxy for every download. Usually not needed thanks to proxyFallback; set it (residential recommended) for hosts that also block the fallback |
Input examples
Single PDF
{"url": "https://www.example.com/whitepaper.pdf"}
Batch of 10-K filings from SEC
{"urls": ["https://www.sec.gov/Archives/edgar/data/320193/aapl-10k.pdf","https://www.sec.gov/Archives/edgar/data/789019/msft-10k.pdf"],"extractTables": true,"maxPages": 200}
Text-only (skip tables for speed)
{"url": "https://...","extractTables": false}
Skip blank/empty pages
{"url": "https://example.com/mixed-scanned.pdf","skipEmptyPages": true,"enableOcr": true}
Monitor PDF Changes Automatically
Turn this actor into a zero-maintenance document monitor in three steps:
- Enable
changeDetection: true - Set
webhookUrlto your Slack / Make / Zapier / n8n webhook - Schedule to run daily at 8am
You get notified the moment your document updates — and zero records when nothing changed.
{"urls": ["https://example.com/policy.pdf"],"changeDetection": true,"changedOnly": true,"webhookUrl": "https://hooks.slack.com/services/T.../B.../..."}
Scheduling & change detection (monitor a PDF for updates)
Set changeDetection: true to turn this actor into a document monitor. On every run it hashes the extracted text of each PDF, stores the hash in the Actor's Key-Value Store, and compares it against the previous run. Every output record gains two fields:
changed—trueif the PDF's text differs from the last run,falseif identical,nullif detection is disabled or the fetch failed. The first run is alwayschanged: true(no prior hash to compare).content_hash— the MD5 of the extracted text, so you can diff or dedupe downstream.
This lets you schedule the actor (e.g. weekly) and only act when something actually changes — trigger a webhook, re-index a vector store, or send an alert.
Example: monitor a regulatory PDF weekly
{"urls": ["https://www.sec.gov/files/rules/final/2024/33-11275.pdf"],"changeDetection": true,"outputFormat": "markdown"}
Then schedule it with a weekly cron (0 9 * * 1). Downstream, only react to records where changed is true:
from apify_client import ApifyClientclient = ApifyClient("YOUR_APIFY_TOKEN")run = client.actor("gochujang/pdf-text-extractor").call(run_input={"urls": ["https://www.sec.gov/files/rules/final/2024/33-11275.pdf"],"changeDetection": True,})for item in client.dataset(run["defaultDatasetId"]).iterate_items():if item.get("_type") == "summary" and item.get("changed"):print(f"PDF changed! {item['url']} (hash {item['content_hash'][:8]})")# → fire your webhook / re-embed / notify here
Change detection persists hashes in the Actor's named Key-Value Store, keyed per URL. Runs of the same actor share that store, so scheduled runs compare against each other automatically — no extra setup.
Webhook alerts (Slack / Discord / Make / Zapier / n8n)
Add webhookUrl to get an instant HTTP notification whenever a PDF changes. Works with any service that accepts POST JSON.
{"urls": ["https://www.sec.gov/files/rules/final/2024/33-11275.pdf"],"changeDetection": true,"webhookUrl": "https://hooks.slack.com/services/T.../B.../...","changedOnly": true}
Webhook payload (POST, application/json):
{"event": "pdf_changed","url": "https://www.sec.gov/files/rules/final/2024/33-11275.pdf","content_hash": "a3f8c2...","page_count": 42,"word_count": 18340,"title": "Final Rule Release No. 33-11275","detected_at": "2024-10-15T09:00:12Z"}
changedOnly mode
Set changedOnly: true (requires changeDetection: true) to suppress all output for unchanged PDFs. Your scheduled dataset is empty when nothing changed — no downstream filtering needed.
{"urls": ["https://example.com/report-q3.pdf","https://example.com/policy-v2.pdf"],"changeDetection": true,"changedOnly": true,"outputFormat": "markdown"}
If neither PDF changed since the last run, the dataset is empty. Only the changed one produces records.
n8n workflow (copy and paste)
Every day at 07:00, extracts the PDF as Markdown and returns a row only when the file changed. Copy the JSON below, then paste it onto an empty n8n canvas (Ctrl+V). In the Run Actor node, create a Header Auth credential with name Authorization and value Bearer <your Apify token>. Each run returns the dataset rows as n8n items, ready for Google Sheets, Slack, Notion or a database node.
{"name": "Daily PDF text extraction","nodes": [{"parameters": {"rule": {"interval": [{"field": "cronExpression","expression": "0 7 * * *"}]}},"name": "Schedule","type": "n8n-nodes-base.scheduleTrigger","typeVersion": 1.2,"position": [0,0]},{"parameters": {"method": "POST","url": "https://api.apify.com/v2/acts/gochujang~pdf-text-extractor/run-sync-get-dataset-items","authentication": "genericCredentialType","genericAuthType": "httpHeaderAuth","sendBody": true,"specifyBody": "json","jsonBody": "{\"urls\": [\"https://www.sec.gov/files/rules/final/2024/33-11275.pdf\"], \"changeDetection\": true, \"changedOnly\": true, \"outputFormat\": \"markdown\"}","options": {"timeout": 300000}},"name": "Run Actor","type": "n8n-nodes-base.httpRequest","typeVersion": 4.2,"position": [240,0]}],"connections": {"Schedule": {"main": [[{"node": "Run Actor","type": "main","index": 0}]]}}}
Make and Zapier work the same way: an HTTP POST to the URL in the node, with the same header and JSON body.
RAG-Ready Chunking (LangChain / LlamaIndex / Vector DB)
Use outputFormat: "rag_chunks" to get overlapping text chunks ready to embed into Pinecone, Weaviate, Chroma, Qdrant, or any vector database:
{"url": "https://example.com/whitepaper.pdf","outputFormat": "rag_chunks","chunkSize": 1000,"chunkOverlap": 200,"chunkStrategy": "chars"}
Each chunk row includes the page citation and the heading chain for retrieval — no need to rebuild chunks from pages[] yourself:
{"_type": "chunk","chunk_index": 3,"total_chunks": 47,"text": "...overlapping window of text...","page_start": 2,"page_end": 3,"citation_url": "https://example.com/whitepaper.pdf#page=2","heading": "3.1 Encoder and Decoder Stacks","heading_path": ["3 Model Architecture", "3.1 Encoder and Decoder Stacks"],"char_count": 998,"token_estimate": 250,"chunk_strategy": "chars","doc_title": "Whitepaper Title","doc_author": "Author Name","doc_page_count": 24,"pdf_type": "text_based"}
Page citations
page_start/page_endare physical, one-based page numbers (the same numbers a PDF viewer shows), so a chunk that runs from the bottom of page 2 onto page 3 reportspage_start: 2, page_end: 3. WithpageRange: "2-3"the first chunk still sayspage_start: 2.citation_urlis the PDF URL plus the standard open-parameter fragment#page=N(N =page_start); Chrome, Firefox, Edge, Acrobat and Preview jump straight to that page. Base64 uploads use their filename label instead of a URL.token_estimateisceil(char_count / 4), the same rulechunkSizeis quoted in.
Headings and chunkStrategy
heading_path is the chain of headings active where the chunk starts (H1 → H2 → H3, up to three levels); heading is its last element, null before the first heading. Headings come from the Markdown structure when the whole document is rendered, otherwise from font-size classes (lines set larger than the body text), so scanned-only PDFs and documents without size contrast get an empty heading_path rather than a guess.
chunkStrategy: "chars"(default) is the fixed sliding window:chunkSizecharacters,chunkOverlapoverlap, end pulled back to a word boundary. Chunk texts match earlier versions, except that since v1.18 the next window never starts past the previous chunk's end: a long word near a chunk end used to drop the characters between the pulled-back end and the next window whenchunkOverlapwas smaller than the pull-back. Every character of the document is now in some chunk.chunkStrategy: "headings"cuts the document at heading boundaries first. A chunk never crosses an H1 or H2; an H3+ boundary is crossed only when the merged section still fits inchunkSize. Each section then goes through the same sliding window, so no chunk is longer thanchunkSize.
If heading detection fails on a document, the run still delivers every chunk with heading_path: [] (and the headings strategy degrades to chars); nothing is charged differently.
LangChain integration
from apify_client import ApifyClientfrom langchain.schema import Documentfrom langchain_openai import OpenAIEmbeddingsfrom langchain_community.vectorstores import Chromaclient = ApifyClient("YOUR_APIFY_TOKEN")run = client.actor("gochujang/pdf-text-extractor").call(run_input={"urls": ["https://example.com/report.pdf"],"outputFormat": "rag_chunks","chunkSize": 1000,"chunkOverlap": 200,"chunkStrategy": "headings",})chunks = list(client.dataset(run["defaultDatasetId"]).iterate_items())docs = [Document(page_content=c["text"],metadata={"title": c["doc_title"], "chunk": c["chunk_index"],"page": c["page_start"], "source": c["citation_url"],"section": " > ".join(c["heading_path"])})for c in chunks if c.get("_type") == "chunk"]vectorstore = Chroma.from_documents(docs, OpenAIEmbeddings())# retrieved docs now cite `metadata["source"]`, e.g. https://example.com/report.pdf#page=7
LlamaIndex integration
from apify_client import ApifyClientfrom llama_index.core import VectorStoreIndexfrom llama_index.core.schema import TextNodeclient = ApifyClient("YOUR_APIFY_TOKEN")run = client.actor("gochujang/pdf-text-extractor").call(run_input={"urls": ["https://example.com/report.pdf"],"outputFormat": "rag_chunks",})chunks = list(client.dataset(run["defaultDatasetId"]).iterate_items())nodes = [TextNode(text=c["text"],metadata={"title": c.get("doc_title", ""), "chunk_index": c.get("chunk_index", 0),"page_start": c["page_start"], "page_end": c["page_end"],"citation_url": c["citation_url"], "heading": c.get("heading") or ""})for c in chunks if c.get("_type") == "chunk"]index = VectorStoreIndex(nodes)query_engine = index.as_query_engine()
No post-processing needed — chunks are word-boundary aligned, non-empty, page-cited, and sized for typical embedding models (512–2048 tokens).
OCR for Scanned PDFs
Enable enableOcr: true to handle scanned or image-based PDFs (bank statements, legal filings, old reports). The actor automatically detects pages with little extractable text and falls back to Tesseract OCR.
{"url": "https://example.com/scanned-report.pdf","enableOcr": true,"ocrLanguage": "eng"}
Each page row includes "ocr_applied": true when OCR was used, so you can distinguish native-text pages from OCR-processed ones.
Supported languages: all 126 tessdata_fast language codes, e.g. eng (English), deu (German), ara (Arabic), rus (Russian), hin (Hindi), chi_tra (Chinese Traditional). Multi-language: "eng+ara".
eng, deu, fra, spa, kor, jpn and chi_sim are built into the image. Any other pack is downloaded once per run (a few seconds, bounded by a 60 s timeout and the run time limit). An unknown code or a failed download gives one free row (url: "language:<code>", ok: false); OCR continues with the remaining codes (or eng), and every PDF is still processed.
FAQ
Does it support password-protected PDFs?
Yes. Set the password input field to unlock them. Wrong password returns a clear error.
What is the maximum PDF file size?
100 MB by default. You can raise this up to 500 MB via the maxPdfMb input parameter. Output longer than about 8 MB is split into part rows that share a documentId.
Can it handle scanned PDFs (image-only)?
Yes — enable enableOcr: true. Tesseract OCR is built in, supporting 126 languages.
Does it extract tables?
Yes. Set extractTables: true to get tables as 2D arrays (rows × columns) per page. Tables are also rendered as Markdown tables in markdown output mode.
Can I extract only specific pages?
Yes — use startPage / endPage for a fixed range, or maxPages to cap the total. All are 1-indexed.
What PDF sources are supported? Direct PDF URLs, Google Drive share links, Dropbox links, SharePoint / OneDrive links — all auto-resolved. Any publicly accessible PDF URL works.
How do I skip pages with no text?
Set skipEmptyPages: true. Useful for mixed PDFs where some pages are blank or image-only.
Is it safe to use for confidential PDFs? Apify runs in isolated containers. PDFs are downloaded to memory, processed, and discarded after the run — they are not stored persistently.
The PDF fails to download with HTTP 403.
Since v1.11, a 403 from a bot-protected CDN is retried once with a browser TLS fingerprint. The run log says whether an Apify Proxy is in use without exposing proxy credentials. Since v1.13, a 401/403/407/429 or a connection failure is also retried once through Apify Proxy (proxyFallback, on by default, no extra charge). If the host blocks that too, set proxyConfiguration (residential group recommended), or use another public PDF host.
What happens if the run times out in the middle of a PDF?
Since v1.13 the pages read so far are delivered with status: "partial", and only those pages are charged (no per-PDF fee). Raise the run timeout or lower maxPages to get the rest.
A large PDF fails with no error message. Fixed in v1.10 — pdfplumber used to retain every parsed page's internal cache for the life of the run, so memory grew ~10MB/page and large or table-heavy PDFs (200+ pages) could exceed the Actor's memory limit and get killed before any error was logged. The Actor now re-opens its internal PDF handle periodically to keep memory flat regardless of page count.
Data engine
- pdf-inspector (Rust) — blazing fast (~150ms), smart layout detection, Markdown output
- pdfplumber v0.11+ — Pure-Python fallback for complex layouts, table extraction
- Tesseract OCR — built-in fallback for scanned/image PDFs, 126 languages supported
Run it on a schedule / from your pipeline
1. Apify Schedule. Apify Console → Schedules → + New schedule, pick PDF Text Extractor, set a cron such as 0 6 * * 1-5 (weekdays 06:00 UTC) and paste this input:
{"urls": ["https://example.com/reports/invoice-001.pdf","https://example.com/reports/invoice-002.pdf"],"outputFormat": "markdown","changeDetection": true,"changedOnly": true}
2. API call from your pipeline. Run the actor and get the dataset items back in a single request:
curl -X POST "https://api.apify.com/v2/acts/gochujang~pdf-text-extractor/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>" \-H "Content-Type: application/json" \-d @input.json
input.json holds the same JSON as above. Synchronous runs wait up to 300 seconds; for bigger batches call POST /v2/acts/gochujang~pdf-text-extractor/runs and read the dataset when the run finishes.
3. Webhooks. For new-file triggers, have your storage or automation tool (S3 event, Zapier, Make, n8n) call the API above whenever a file arrives, and add an Apify webhook on ACTOR.RUN.SUCCEEDED (Actor → Integrations) to push the results to your system as soon as the run finishes.
Works great with
Building a document pipeline? These actors work alongside this one:
- Excel & CSV Extractor — Extract data from Excel files in the same pipeline
- DOCX Text Extractor — For Word documents — same structured output format
Related actors (same author)
- SEC 13F Institutional Holdings Tracker — Get 13F filing PDF URLs + QoQ holdings changes
- Web Page → Markdown Converter — HTML version of the same idea
- Excel & CSV Extractor — Same idea for .xlsx/.csv files
- DOCX Text Extractor — Same idea for Word documents
- Image OCR Extractor — Same idea for image files (PNG/JPG)
Feedback
A short review helps researchers / analysts find it: Leave a review on Apify Store
Keywords: PDF extractor, PDF parser, PDF to text, PDF to markdown, RAG, table extraction, PDF scraper, document processing, OCR
Article and landing page URLs
Supply a PDF URL or a paper/article landing page. The actor follows HTTP redirects
(including DOI redirects), then resolves a PDF from citation_pdf_url metadata,
an alternate link with type="application/pdf", or an arXiv /abs/ → /pdf/
pattern, in that order. It follows at most one resolution hop, plus redirects.
Both responses use the PDF size cap and share the download time budget. HTML is
parsed only for link attributes; scripts and markup are never executed or emitted.
Output rows include sourceUrl (the input), resolvedPdfUrl (the final fetched
URL or attempted target on failure), and resolvedVia (citation_pdf_url,
link_alternate, pattern, or none for direct PDFs). If the page has no
supported link, is empty, or its resolved link returns HTML again, the actor emits
one error row with errorCode: "NOT_A_PDF" and a reason, with no pdf-extracted
or page-extracted charge. HTTP, size, and timeout failures also remain uncharged.
Discovered PDF links and every redirect in their HEAD/GET chain must resolve
entirely to public IP addresses. Requests connect to a validated IP while
preserving the original HTTP Host and TLS hostname, preventing DNS rebinding.
Unsafe destinations and failed DNS validation produce an uncharged
NOT_A_PDF error. Discovered-link downloads require a direct connection:
explicit proxy use is rejected, ambient proxies are disabled, and browser-TLS
fallback is disabled for discovered targets. Direct caller-supplied PDF URLs
retain their existing explicit proxy and browser-TLS support.