PDF Text Extractor avatar

PDF Text Extractor

Pricing

from $1.40 / 1,000 pdfs

Go to Apify Store
PDF Text Extractor

PDF Text Extractor

Extract the text of PDF files from their web addresses. For each PDF you get the full text, optional text per page, page count, document data (title, author, dates), word count and a flag for scanned PDFs. Paste a list or link a text file.

Pricing

from $1.40 / 1,000 pdfs

Rating

0.0

(0)

Developer

Sanira Botheju

Sanira Botheju

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

16 hours ago

Last modified

Share

What does PDF Text Extractor do?

PDF Text Extractor downloads PDF files from their web addresses and gives you what is inside them: the full text, the text of each page (if you want it), the page count and the document data (title, author, subject, keywords, program, dates). Paste the addresses or link a file that lists them, and export the results to Excel, CSV, JSON or XML, or send them straight into your own pipeline.

  • One result per PDF, thousands of PDFs in one run
  • Full text, with one line per line of the page and a blank line between pages
  • Optional text per page, with page number and character count, so you can say where something was found
  • Title, author, subject, keywords, creator, producer and creation and modification dates (dates in ISO 8601, UTC)
  • Character and word counts and the file size
  • Flags PDFs that are probably scanned pictures with no text in them, so you know they need OCR
  • Reads password-protected PDFs when you give the password
  • Clear error codes for addresses that are not PDFs, files that are too big, missing pages, broken files and servers that do not answer

The tool reads the text that is stored in the PDF. It does not do OCR, so a PDF that only holds pictures of pages comes back with empty text and a note that says so.

What data do you get?

FieldExample
PDF addresshttps://www.irs.gov/pub/irs-pdf/f1040.pdf
Final addresswhere the address ended up after redirects
Pages2 (and how many were read)
Title, author, subject, keywords2025 Form 1040, C:DC:TS:CAR:MP, ...
Creator, producerDesigner 6.5
Created, modified2026-01-02T13:24:31.000Z
Textthe text of all pages read
Pages (optional)[{ "page": 1, "text": "...", "characters": 1234 }, ...]
Characters, words10152, 2225
File size220237 bytes
Probably scannedfalse
Notewhy a result is cut short, or what went wrong
Errorempty, or a code and a message

How to extract text from PDFs

  1. Under PDF web addresses, paste your list with Bulk edit, add addresses one by one, or link a text file (a Google Sheet published as CSV works too).
  2. Choose whether you want the text of each page, and how many pages to read of each PDF.
  3. Press Start.
  4. Open the PDFs table to see the overview, or export the full results.

The addresses must point to the PDF file itself. An address of a web page that links to a PDF returns the error NOT_A_PDF.

How much does it cost to extract text from PDFs?

You pay for results, not for time: $2.00 per 1,000 PDFs. Apify subscribers on the Silver plan pay $1.70 and on the Gold plan $1.40 per 1,000 PDFs. Each run also has a start fee of $0.00005. Duplicates in your list are read, and paid, once.

PDFsCost
100$0.20
1,000$2.00
10,000$20.00
100,000$200.00

Every address in your list gives one result, also when the PDF could not be read: that result holds the error, and it counts like any other. Apify's free plan includes $5 of credit each month, which covers about 2,500 PDFs. Set a maximum cost for the run in Apify Console and the tool stops there and keeps what it has read.

Input

The only required field is PDF web addresses. The other options:

  • Text of each page: adds the text of every page as its own entry. Makes the results about twice as large.
  • Maximum pages per PDF: by default the first 100 pages of each PDF are read, up to 500. Reading a page takes the same effort in every PDF, so this limit keeps the price per PDF fair. A longer PDF comes back with the pages it has read and a note that says how many it skipped.
  • Maximum file size: 50 MB by default. A larger file is not downloaded fully and comes back with FILE_TOO_LARGE. With the default memory a run reads files up to about 70 MB.
  • Maximum number of PDFs: reads only the first part of a long list.
  • Password for protected PDFs: one password, tried on every PDF of the run. It is stored encrypted and is not saved in the results.
  • Time limit per download: how long one PDF may take to download.

Output example

{
"url": "https://www.irs.gov/pub/irs-pdf/f1040.pdf",
"finalUrl": null,
"position": 1,
"httpStatus": 200,
"pageCount": 2,
"pagesRead": 2,
"truncated": false,
"title": "2025 Form 1040",
"author": "C:DC:TS:CAR:MP",
"subject": "U.S. Individual Income Tax Return",
"keywords": "Fillable",
"creator": "Designer 6.5",
"producer": "Designer 6.5",
"creationDate": "2026-01-02T13:24:31.000Z",
"modificationDate": "2026-01-02T13:24:31.000Z",
"pdfVersion": "1.7",
"text": "Form\n1040 2025U.S. Individual Income Tax Return\nDepartment of the Treasury—Internal Revenue Service\n...",
"characters": 10152,
"words": 2225,
"fileSizeBytes": 220237,
"probablyScanned": false,
"message": null,
"extractedAt": "2026-10-16T06:41:21.606Z",
"error": null
}

The text is shortened here. With Text of each page on, the result also has a pages list. An address that fails gives a result with the same fields, empty, and the reason in error and message:

{
"url": "https://www.example.org/old/report.pdf",
"httpStatus": 404,
"text": null,
"message": "The server answered with HTTP 404.",
"error": { "code": "HTTP_ERROR", "message": "The server answered with HTTP 404." }
}

What the error codes mean

CodeMeaning
INVALID_INPUTthe entry is not a web address
HTTP_ERRORthe server answered with an error such as 404, 403 or 500
NOT_A_PDFthe address returned a web page or another kind of file
FILE_TOO_LARGEthe file is above Maximum file size
PASSWORD_REQUIRED, PASSWORD_INCORRECTthe PDF needs a password, or the one you gave does not open it
TEXT_COPY_NOT_ALLOWEDthe owner of the PDF switched off copying its text; the tool respects that
PDF_CORRUPT, PDF_UNREADABLEthe file is damaged or cannot be read
PARSE_TIMEOUT, PARSE_OUT_OF_MEMORYthe file took too long or needed too much memory and was stopped; the rest of the run carries on
DNS_NOT_FOUND, TIMEOUT, CONNECTION_REFUSED, BLOCKED_ADDRESS and similarthe server could not be reached, or the address is a private network address, which the tool never fetches

What can you use it for?

  • Feed PDF text into a search index, a database or an AI pipeline, with the page number of every passage
  • Collect the title, author and dates of a folder full of reports, papers or manuals
  • Check which PDFs on your list are scanned and need OCR, and which have text
  • Count the pages and words of the documents you publish
  • Monitor a list of PDFs on a schedule in Apify Console

Use it from the API

curl -X POST "https://api.apify.com/v2/acts/cyber1nj3ct0r~pdf-text-extractor/run-sync-get-dataset-items?token=YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"pdfUrls": [{"url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"}], "includePages": true}'

The same works from Python, JavaScript, Make, Zapier and n8n through Apify's integrations.

FAQ

Does it read scanned PDFs?

No. It reads the text that is stored in the PDF. A PDF that is only a set of scanned pictures has no text to read: the result has empty text, probablyScanned is true and the note suggests running the file through an OCR tool first. A PDF counts as probably scanned when most of its pages have almost no text.

Why is the text not laid out like the page?

The text comes out line by line, in the order the PDF stores it. Columns, tables and text boxes become lines of text, and words that were split at the end of a line stay split. This is fine for search and for feeding text to other tools, but it does not rebuild tables.

Which languages does it handle?

The text is returned as the PDF stores it, in Unicode. It was tested with English text, accented Latin letters and a Japanese document. The word count splits on spaces, so it is not meaningful for Chinese and Japanese, which are written without them.

Why were only some pages read?

By default only the first 100 pages of each PDF are read, and 500 is the most you can ask for. The result says how many pages the PDF has and how many were read. Reading is also stopped after about 40 seconds for one PDF, and when the text would make the saved result too large (about 7.5 MB); the note says so.

Can it read a PDF that asks for a password?

Yes, if you give the password under Password for protected PDFs. Without it, or with a wrong one, the result has the error PASSWORD_REQUIRED or PASSWORD_INCORRECT. The tool does not try to guess passwords. PDFs that open without a password but have copying switched off return TEXT_COPY_NOT_ALLOWED.

Does it read robots.txt?

It requests only the addresses you give it, once each, and follows no links, so it does not crawl and does not read robots.txt.

Does it keep my files?

No. A PDF is held in memory while it is read and then dropped. Only the results go to your dataset.

A server blocks the tool. What can I do?

The tool identifies itself honestly in its User-Agent and does not try to get round blocks, logins or CAPTCHAs. If the PDF is yours, allow the tool in your firewall, or download the file yourself and host it where the tool can reach it.

Is it allowed to extract text from PDFs?

The tool downloads each address once, like a visitor opening the file, and reads the text. You are responsible for using only files you are allowed to read and for how you use the text and the document data in the results, including copyright and personal data in the documents.

Something does not work

Open an issue on the Issues tab with an address that shows the problem. Every report is read and answered.