PDF Text Extractor - PDF to Text for AI, RAG & Search avatar

PDF Text Extractor - PDF to Text for AI, RAG & Search

Pricing

from $3.00 / 1,000 pdfs

Go to Apify Store
PDF Text Extractor - PDF to Text for AI, RAG & Search

PDF Text Extractor - PDF to Text for AI, RAG & Search

Turn PDF files into clean text. Give it PDF URLs and get the full text, optional per-page text, page count, word count and document metadata (title, author, dates). Flags scanned PDFs that contain no text layer. Built for feeding documents to LLMs, RAG pipelines and search indexes.

Pricing

from $3.00 / 1,000 pdfs

Rating

0.0

(0)

Developer

Ivan Honer

Ivan Honer

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 days ago

Last modified

Categories

Share

πŸ“„ PDF Text Extractor: PDF to Text for AI, RAG & Search

Turn PDF files into clean text. Give it PDF links and get back the full text, page-by-page text if you want it, the page and word count, and the document's metadata. Built for feeding documents to LLMs, RAG pipelines and search indexes.

  • βœ… Reading order preserved: lines and paragraphs are rebuilt from the page layout, not dumped as fragments
  • βœ… Page-by-page text for citations and chunking, or page markers inside the full text
  • βœ… Metadata: title, author, subject, keywords, producer, created and modified dates
  • βœ… Flags scanned PDFs that have no text layer, so you know which ones need OCR
  • βœ… Opens password-protected PDFs when you give the password
  • βœ… Failed downloads and non-PDF links are free

What does PDF Text Extractor do?

For every URL in your list it:

  1. Downloads the file, following redirects, and checks it really is a PDF.
  2. Reads the text layer of every page (or up to your page limit) with Mozilla's PDF.js engine.
  3. Rebuilds lines and paragraph breaks from the positions of the text on the page.
  4. Returns the full text, optional per-page text, counts and metadata as one row per PDF.

Use cases

  • πŸ€– RAG and AI assistants. Get clean text, with page numbers, from reports, manuals and filings to embed and search.
  • πŸ“š Search indexes. Index the content of PDF libraries, product sheets or regulations.
  • 🧾 Document processing. Pull the text out of forms, contracts and invoices for downstream parsing.
  • πŸ”¬ Research. Batch-extract text from papers and reports for analysis.
  • πŸ—‚οΈ Archive triage. Find out which files in a collection are scanned images that need OCR.

What data can you get?

FieldWhat it is
url, finalUrlThe link you gave, and where it ended up after redirects
textThe full extracted text
pages[{ page, text }] for every page (switch on Also return text page by page)
pageCount, pagesExtracted, truncatedPages in the file, pages read, and whether the page limit cut it short
wordCount, characterCount, fileSizeBytesSize measures
likelyScannedtrue when there is little or no text layer, which usually means a scan
metadata.title, .author, .subject, .keywords, .creator, .producerDocument properties
metadata.createdDate, .modifiedDate, .pdfVersionDates in ISO 8601, and the PDF version
status, errorSee Statuses and errors

How to use it

  1. Click Try for free (or Start) at the top of this page.
  2. Paste direct links to PDF files into PDF URLs, one per line.
  3. Switch on Also return text page by page if you need page numbers for citations or chunking.
  4. Press Start.
  5. Download the results from the Output tab, or pass them to your embedding or indexing step.

Input examples

A few public PDFs.

{
"urls": ["https://www.irs.gov/pub/irs-pdf/fw9.pdf", "https://arxiv.org/pdf/1706.03762"]
}

For RAG: per-page text, with long documents capped.

{
"urls": ["https://example.com/annual-report-2026.pdf"],
"includePages": true,
"maxPagesPerPdf": 200
}

A password-protected file.

{
"urls": ["https://example.com/protected.pdf"],
"password": "the-file-password"
}

Output example

{
"url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf",
"status": "ok",
"finalUrl": "https://www.irs.gov/pub/irs-pdf/fw9.pdf",
"fileSizeBytes": 140815,
"pageCount": 6,
"pagesExtracted": 6,
"truncated": false,
"likelyScanned": false,
"characterCount": 37974,
"wordCount": 6284,
"metadata": {
"title": "Form W-9 (Rev. March 2024)",
"author": "SE:W:CAR:MP",
"subject": "Request for Taxpayer Identification Number and Certification",
"keywords": "Fillable",
"creator": "Designer 6.5",
"producer": "Designer 6.5",
"createdDate": "2024-03-06T08:18:13Z",
"modifiedDate": "2024-03-06T08:18:13Z",
"pdfVersion": "1.7"
},
"text": "Form W-9\n(Rev. March 2024)\n\nRequest for Taxpayer\nIdentification Number and Certification\n\nDepartment of the Treasury ..."
}

Statuses and errors

Every URL gets a row.

status / errorMeaningCharged?
okText extracted. If likelyScanned is true, the PDF is probably a scan and has little textYes
error: The URL did not return a PDF fileThe link points at a web page or another file typeNo
error: HTTP 404, HTTP 403...The server refused the downloadNo
error: File is larger than the 50 MB limitRaise Maximum file size (up to 100 MB)No
error: The PDF is password protectedGive the password in PasswordNo
error: The file is not a readable PDFThe file is damagedNo
error: Download timed outThe server was too slow; raise Download timeoutNo
invalid_inputNot a URLNo

How much does it cost?

You pay per PDF extracted. Failed downloads, non-PDF links and oversized files are free, and platform usage is included.

PDFsPrice on the Free and Bronze tiers
100$0.40
1,000$4.00
10,000$40.00

Larger Apify plans pay less per PDF: 15% less on Silver, and 25% less on Gold and above.

FAQ

Can I use it through the API?

Yes. For a few files, the synchronous endpoint returns the text in one request:

curl -X POST "https://api.apify.com/v2/acts/optimistical_lectern~pdf-text-extractor/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"urls": ["https://www.irs.gov/pub/irs-pdf/fw9.pdf"]}'

JavaScript:

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('optimistical_lectern/pdf-text-extractor').call({ urls: ['https://www.irs.gov/pub/irs-pdf/fw9.pdf'], includePages: true });
const { items } = await client.dataset(run.defaultDatasetId).listItems();

Python:

from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("optimistical_lectern/pdf-text-extractor").call(run_input={"urls": ["https://www.irs.gov/pub/irs-pdf/fw9.pdf"], "includePages": True})
items = client.dataset(run["defaultDatasetId"]).list_items().items

Can AI agents use it?

Yes. It runs with limited permissions, so it needs no approval step. Add it to Claude, Cursor or any other MCP client through Apify's MCP server at mcp.apify.com, using the Actor name optimistical_lectern/pdf-text-extractor. It is a good fit for an agent that needs to read a PDF linked from a web page.

Does it do OCR?

No. It reads the text layer that most digitally created PDFs have. For scanned PDFs it returns little or no text and sets likelyScanned: true, so you can route those files to an OCR tool.

How are tables handled?

Tables come out as lines of text in reading order, not as structured rows and columns.

What about multi-column layouts?

Text is read in the order the PDF stores it, which is the reading order for almost all documents. Unusual layouts can occasionally interleave columns.

Can I upload files instead of giving URLs?

Upload the files anywhere that gives a direct link (for example an Apify key-value store, S3 or a public cloud folder) and pass those links.

Something looks wrong?

Open an issue on the Issues tab with a link to the PDF. Every report is read.