PDF to Text Extractor: Pages, Metadata & RAG Chunks avatar

PDF to Text Extractor: Pages, Metadata & RAG Chunks

Pricing

from $2.00 / 1,000 pdf processeds

Go to Apify Store
PDF to Text Extractor: Pages, Metadata & RAG Chunks

PDF to Text Extractor: Pages, Metadata & RAG Chunks

Extract text from PDF files by URL: full text, per-page text, metadata and RAG-ready chunks, with scanned-page detection. Pay only for PDFs that succeed. Export CSV/JSON or connect n8n, Make, Zapier and LangChain.

Pricing

from $2.00 / 1,000 pdf processeds

Rating

0.0

(0)

Developer

RavenSource

RavenSource

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

a day ago

Last modified

Features

Limited permissions

Share

PDF to Text Extractor turns PDF files into clean text. Give it PDF URLs and get, for each file, the full text, text per page, document metadata and, if you want them, overlapping chunks that remember their page numbers for RAG. It is a simple PDF to text API for bulk PDF text extraction: no browser, no API key, no setup.

Scanned pages are detected and flagged instead of silently coming back empty, and you pay only for PDFs that succeed: a flat price per extracted PDF, whatever its length. Failed downloads, non-PDF links, encrypted files and scans without text cost nothing.

  • Full text and per-page text, so every sentence can be traced to its page.
  • Metadata: title, author, subject, keywords, creator, producer, creation and modification dates in ISO 8601.
  • RAG-ready chunks with pageStart and pageEnd, cut at word boundaries, with the overlap you choose.
  • Scanned-page detection: likelyScanned per page, scannedPageCount per PDF, and a clear status for PDFs with no text at all.
  • One row per URL, always: each input gets a dataset item with a status, so nothing disappears from a batch.
  • Export to JSON, CSV, Excel or HTML, or use it from n8n, Make, Zapier, LangChain and LlamaIndex.

What does PDF to Text Extractor do?

It downloads each PDF, reads its text layer with PDFium (the open-source PDF engine of Chromium) and writes one dataset item per URL. It extracts text from PDF files that contain text: reports, papers, contracts, statements, manuals, forms, filings.

It does not run OCR. A scanned PDF is an image of text; this Actor tells you which pages and which files are scans, so you can send only those to an OCR tool. It also does not convert tables to structured data or produce Markdown: the output is plain text, in reading order as stored in the file.

Who is PDF to Text Extractor for?

  • RAG and LLM pipelines. Load reports and manuals into a vector database with chunks that carry their page range, so answers can cite the page.
  • Search indexing. Make the PDFs of a site, an intranet export or a document archive searchable.
  • Compliance and document review. Pull the text of contracts, policies, filings and disclosures, with a SHA-256 of each file and its metadata dates.
  • Research and lead lists. Turn a list of annual reports, tenders, studies or whitepapers into text you can filter and analyse.

How to extract text from PDF files

  1. Open the Actor and paste your PDF links into PDF URLs, or link a text file with one URL per line.
  2. Optional: set Chunk size (for example 1500) if you want chunks, and Maximum pages per PDF if you only need the beginning of long files.
  3. Click Start. Small PDFs take about a second each, and several are processed in parallel.
  4. Open the Output tab. Overview has one row per PDF; Pages and Chunks have one row per page or chunk.
  5. Download the dataset as JSON, CSV or Excel, or fetch it through the API. Schedule the Actor or call it from your workflow tool to run it regularly.

Input

The Input tab describes every field. The ones you are most likely to use:

FieldWhat it doesDefault
pdfUrlsRequired. Direct http(s) links to PDF files, as [{"url": "..."}]. Also accepts Apify key-value store record URLs and a remote text file with one URL per line. Up to 20,000 per run.one sample PDF
maxFileSizeMbLargest PDF to download. Bigger files get status TOO_LARGE.50
maxPagesMaximum pages extracted per PDF.500
pageLimitBehaviortruncate: extract the first maxPages pages and flag the item. skip: report TOO_MANY_PAGES instead.truncate
pageRangeExtract only some pages of every PDF, for example 1-5,8,12-.all pages
includePageTextsAdd the pages array. Turn off to halve the item size.true
chunkSize / chunkOverlapChunk length and overlap in characters. 0 turns chunking off.0 / 200
passwordPassword for encrypted PDFs (stored encrypted).none
maxConcurrencyPDFs processed in parallel; lowered automatically to fit the run's memory.2
requestTimeoutSecs / perDocumentTimeoutSecsTime limits for downloading and for extracting one PDF.60 / 120
proxyConfigurationOptional proxy for downloads.no proxy

Example input:

{
"pdfUrls": [
{ "url": "https://www.govinfo.gov/content/pkg/BILLS-118hr82enr/pdf/BILLS-118hr82enr.pdf" },
{ "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf" }
],
"maxPages": 200,
"chunkSize": 1500,
"chunkOverlap": 200
}

Link to the PDF file itself, not to a viewer page around it: a page that only shows the PDF comes back as NOT_PDF.

Output: PDF to JSON, one row per file

You can download the dataset in various formats such as JSON, HTML, CSV or Excel. Every URL that is processed produces exactly one item. A real item from the example input above, with the long text fields shortened (...):

{
"url": "https://www.govinfo.gov/content/pkg/BILLS-118hr82enr/pdf/BILLS-118hr82enr.pdf",
"finalUrl": "https://www.govinfo.gov/content/pkg/BILLS-118hr82enr/pdf/BILLS-118hr82enr.pdf",
"status": "OK",
"charged": true,
"fileName": "BILLS-118hr82enr.pdf",
"fileSizeBytes": 110369,
"sha256": "877be157d555c02e4e5db6d8e5eb81f11001035e2b9348a7c4b8990e45040c5d",
"pageCount": 2,
"pagesExtracted": 2,
"truncated": false,
"scannedPageCount": 0,
"charCount": 2435,
"wordCount": 377,
"metadata": {
"title": null,
"author": null,
"subject": null,
"keywords": null,
"creator": "ACOMP.exe WinVer 2.2a Sep 11 2014",
"producer": "Acrobat Distiller 24.0 (Windows); modified using iText® Core 7.2.3 (production version) ©2000-2022 iText Group NV, Government Publishing Office",
"creationDate": "2024-12-23T10:53:24-05:00",
"modDate": "2024-12-27T06:17:55Z"
},
"pdfVersion": "1.5",
"text": "H. R. 82\nOne Hundred Eighteenth Congress\nof the\nUnited States of America\nAT THE SECOND SESSION\n...",
"pages": [
{ "pageNumber": 1, "text": "H. R. 82\nOne Hundred Eighteenth Congress\n...", "charCount": 2254, "likelyScanned": false },
{ "pageNumber": 2, "text": "H. R. 82—2\nnecessary to take into account the amendments made by section\n3.\n...", "charCount": 181, "likelyScanned": false }
],
"chunks": [
{ "chunkIndex": 0, "text": "H. R. 82\nOne Hundred Eighteenth Congress\n...", "charCount": 1497, "pageStart": 1, "pageEnd": 1 },
{ "chunkIndex": 1, "text": "(k)(5), subsection (q)’’ and\ninserting ‘‘subsection (q)’’.\nSEC. 3. ...", "charCount": 1139, "pageStart": 1, "pageEnd": 2 }
],
"textTruncatedInDataset": false,
"fullTextUrl": null,
"skippedPages": [],
"warnings": [],
"error": null,
"processedAt": "2026-11-22T01:24:58Z"
}

What the fields mean:

FieldMeaning
status, errorOutcome of this URL (table below). error is null for OK, otherwise {code, message} with a plain explanation.
chargedtrue when this item was billed. Only OK items are.
textThe full text. Pages are separated by a form feed character (\f), so text.split("\f") gives the pages.
pages[{pageNumber, text, charCount, likelyScanned}]. pageNumber is the position in the file, starting at 1.
chunks[{chunkIndex, text, charCount, pageStart, pageEnd}] when chunkSize is above 0, otherwise null.
pageCount, pagesExtracted, truncatedPages in the file, pages extracted, and whether the page cap or the output size limit cut the extraction short.
scannedPageCountExtracted pages that look scanned.
charCount, wordCountSize of the extracted text.
metadata, pdfVersionThe PDF's document information; dates are ISO 8601 and keep the time zone when the PDF recorded one.
finalUrl, fileName, fileSizeBytes, sha256Where the file really came from after redirects, and what was downloaded.
textTruncatedInDataset, fullTextUrlSee "Very large PDFs" below.
skippedPages, warningsPages that could not be processed in this run's memory, and notes about truncation.

The text is cleaned lightly: Unix line breaks, no control characters, no trailing spaces, and words hyphenated across a line break are joined again. Only text inside the visible page area is returned.

Statuses: what happened to each URL

statusMeaningCharged
OKText was extracted.Yes
NO_TEXT_LIKELY_SCANNEDThe PDF has no extractable text. Usually a scan: it needs OCR.No
TOO_LARGEThe file is bigger than maxFileSizeMb, or needs more memory than the run has.No
TOO_MANY_PAGESMore pages than maxPages, with pageLimitBehavior set to skip.No
NO_PAGES_IN_RANGEpageRange selects no page that exists in this PDF.No
NOT_PDFThe URL returned something else, for example an HTML page.No
DOWNLOAD_FAILEDHTTP error, DNS or connection problem, too many redirects, or the download timed out.No
BLOCKED_URLThe URL points to a private or internal address, uses a port that is not allowed, or contains credentials.No
ENCRYPTEDThe PDF needs a password and none, or a wrong one, was given.No
PARSE_FAILEDThe file is damaged or not a valid PDF.No
TIMEOUTExtraction took longer than perDocumentTimeoutSecs.No
INVALID_URLNot a valid http(s) URL.No

A run finishes successfully even when some URLs fail: read status per item. The OUTPUT record of the run's key-value store holds the totals: counts by status, PDFs charged, pages, bytes, whether the spending limit has been reached, and URLs that were not processed.

With maxConcurrency above 1, rows are written as PDFs finish, which is not always the input order. Match rows to your input by url.

How much does it cost to extract text from PDFs?

PDF to Text Extractor uses pay-per-event pricing. There are two events and no per-page fee:

EventPrice
Actor start, charged by Apify once per run and per GB of memory (so once at the default 256 MB)$0.005
PDF processed: one PDF extracted with status OK$0.0025
You runYou pay
1 PDF$0.0075
100 PDFs in one run$0.255
1,000 PDFs in one run$2.505
1,000 URLs of which 200 fail or are scans$2.005

A 2-page letter and a 500-page report cost the same. Platform usage is included, so there is no separate compute bill. Put your URLs into one run rather than one run per PDF, so the start fee is paid once. You can set a maximum cost per run in Apify: the Actor checks the remaining budget before each PDF, stops cleanly when it is used up and lists the URLs it did not get to.

Limits, and how to raise them with memory

The defaults are chosen so that a run with the default 256 MB of memory cannot run out of memory: files are streamed to disk, each PDF is parsed page by page in its own memory-limited process, and the number of parallel PDFs follows the memory of the run.

Run memoryPDFs in parallel (at most)Memory per PDF when 2 run in parallelLargest output per PDF
128 MB143 MB8 MB
256 MB (default)272 MB16 MB
512 MB5190 MB32 MB
1024 MB8426 MB64 MB
2048 MB10898 MB128 MB
4096 MB161,922 MB128 MB

What that means in practice at 256 MB: PDFs of a few hundred to a few thousand pages work (extracting a 1,039-page bill takes about 1.3 s of CPU and 28 MB of memory), and files up to the default 50 MB are downloaded and parsed without trouble. Give the run more memory (Run options → Memory) when:

  • an item has skippedPages: a page with a very complex drawing needed more memory than one PDF gets. In our tests such a page needed about 430 MB; it is extracted with 2048 MB, or with 1024 MB and maxConcurrency set to 1;
  • an item is truncated with a warning about the output size: the text of that PDF is larger than the limit in the last column;
  • you get TIMEOUT on very long PDFs: CPU share grows with memory, so more memory is also faster;
  • you want to process more PDFs in parallel, or files well above the default 50 MB. maxFileSizeMb can be raised to 200, but disk space is twice the memory, so at 256 MB such files are processed one at a time.

128 MB is enough for small PDFs only.

Very large PDFs: fullTextUrl

A dataset row can hold about 9 MB. When the text, pages and chunks of one PDF add up to more than 5 MB, the complete item is saved as a JSON record in the run's key-value store instead. The dataset row then has textTruncatedInDataset: true, the first 100,000 characters in text, pages and chunks set to null, and fullTextUrl pointing to the record. The record has the same fields as a normal item, but its charged field is null because it is saved before billing; use the dataset row for the charge status. It is kept as long as the run's storage is kept. The PDF is still charged once.

Scanned PDFs and OCR: scans are flagged, not OCRed

A page is marked likelyScanned when it has fewer than 20 characters of text and images cover part of it. That is how scanners, photocopiers and "print to image" tools produce pages.

  • A PDF with some real text is OK; scannedPageCount and pages[].likelyScanned show which pages have no text.
  • A PDF whose only "text" is a few characters on image pages (a page number or a stamp on a scan), or no text at all, is NO_TEXT_LIKELY_SCANNED and is not charged.

This Actor does not run OCR, by design: OCR is slow and priced per page. Filter the rows with NO_TEXT_LIKELY_SCANNED or scannedPageCount > 0 and pass only those URLs to an OCR Actor from Apify Store. Scans that already carry a text layer from earlier OCR are extracted like any other PDF.

Integrations and API

  • API. Start the Actor and get the items in one call:

    curl -X POST "https://api.apify.com/v2/acts/ravensource~pdf-text-extractor/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"pdfUrls": [{"url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf"}], "chunkSize": 1500}'

    For large batches start the run asynchronously and read the dataset when it finishes. ?view=pages and ?view=chunks on the dataset items endpoint return one row per page or per chunk.

  • n8n, Make, Zapier. Use the Apify app in each tool: "Run an Actor", then "Get dataset items". A typical flow: new file link in a sheet or a webhook → PDF to Text Extractor → rows with status = OK to your database or vector store, the rest to a review list.

  • LangChain.

    from langchain_apify import ApifyWrapper
    from langchain_core.documents import Document
    loader = ApifyWrapper().call_actor(
    actor_id="ravensource/pdf-text-extractor",
    run_input={"pdfUrls": [{"url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf"}], "chunkSize": 1500},
    dataset_mapping_function=lambda item: Document(
    page_content=item["text"] or "",
    metadata={"source": item["url"], "status": item["status"], "pages": item["pageCount"]},
    ),
    )
    documents = loader.load()

    To index chunk by chunk, map item["chunks"] instead and keep pageStart and pageEnd in the metadata.

  • LlamaIndex. The ApifyActor reader from llama-index-readers-apify runs the Actor the same way; map each item, or each chunk, to a Document.

  • AI agents. The Actor can be added as a tool through the Apify MCP server. Its input fields are documented with costs and limits so an agent can fill them correctly.

  • Scheduling and webhooks. Run it on a schedule, or let a webhook notify your system when a run finishes.

Which URLs are fetched, and what is refused

The Actor fetches exactly the URLs you give it and follows up to five redirects. Redirects from HTTPS to HTTP are blocked. It does not crawl.

To protect internal services, downloads only connect to public internet addresses over http or https on ports 80, 443, 8080 and 8443. Private, loopback, link-local and cloud metadata addresses are refused, also when a public-looking name resolves to one or a redirect points to one, and so are URLs with user:password@. Such URLs get status BLOCKED_URL. A proxy must support CONNECT and honor the validated destination address.

Direct downloads support uncompressed, gzip and deflate responses. Private record downloads must be served without content encoding.

Apify key-value store record URLs (https://api.apify.com/v2/key-value-stores/<storeId>/records/<key>) are read with your own run's access, so PDFs in your private stores work without a token in the URL. That is the way to process files that are not on the public web: upload them to a key-value store and pass the record URLs.

Only process PDFs you have the right to use. You choose the URLs; the Actor downloads those files, extracts their text and stores the result in your own Apify dataset and key-value store, under your account's retention settings. Downloaded files are deleted when each PDF is done, and nothing is sent to any other service. The extracted text can contain personal data if the documents do: handle it according to the rules that apply to you, such as the GDPR. The Actor identifies itself in its User-Agent and does not try to get around access controls, logins or paywalls.

FAQ

Can it read scanned PDFs? It detects them and does not charge for PDFs without text, but it does not run OCR. See "Scanned PDFs" above.

Can it read password-protected PDFs? Yes, when you put the password into password. The same password is tried for every PDF in the run that needs one. PDFs that only restrict printing or copying open without a password.

Does one row mean one PDF or one page? One row is one PDF. Use the Pages or Chunks view of the dataset, or ?view=pages in the API, for one row per page or per chunk.

Why is text different from what I see in my PDF viewer? The Actor returns the text stored in the file, in the order it is stored. Multi-column layouts, tables and footnotes come out as lines of text, not as a layout. Text that is drawn as shapes or is part of an image has no text layer to extract.

Why did I get NOT_PDF? The link returned a web page or another file type. Open the link in a browser: if you see a viewer with a download button, copy the address of the download instead.

A host returns 403 or times out. What can I do? Some hosts refuse data-centre addresses. Set proxyConfiguration to Apify Proxy and try again; failed attempts are free. If the host needs a login, download the files yourself and pass key-value store record URLs.

How do I process files from my computer? Upload them to an Apify key-value store and pass the record URLs in pdfUrls.

What happens when my spending limit is reached? The Actor stops before starting a PDF it could not bill, finishes the ones in progress, and writes the URLs it did not process to the OUTPUT record under notProcessedUrls. Nothing is charged beyond your limit.

If a result write is interrupted, its outcome can be uncertain. The run stops and lists affected URLs under deliveryUncertainUrls; inspect the dataset and charges before retrying them. The saved progress prevents an automatic retry during migration or resurrection, but an interrupted URL may need manual attention.

Is the order of pages and chunks reliable? Yes. pageNumber, pageStart and pageEnd are positions in the file, starting at 1, including covers and front matter. They are not the page labels printed on the pages.

For questions or problems, use the Issues tab and include the status and error.message of an affected row.

Other RavenSource Actors

Changelog

  • 1.0: Text, per-page text, metadata and chunks from PDF URLs; scanned-page detection; size, page and time limits that follow the run's memory; pay only for PDFs that succeed.