PDF to Text and JSON
Pricing
$5.00 / 1,000 converted pdfs
PDF to Text and JSON
Give it PDF links, get the text of every page plus title, author, dates and page count as JSON. No OCR. $0.005 per PDF.
Pricing
$5.00 / 1,000 converted pdfs
Rating
0.0
(0)
Developer
Comrade Coding
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
3 hours ago
Last modified
Categories
Share
Give it a list of PDF links. For each PDF you get back the text of every page, the whole text in one field, and the document's metadata: title, author, subject, keywords, the software that made it, creation and modification dates, PDF version, page count, and file size.
Use it to feed reports, papers, forms, or manuals into a search index or a language model, to check what a batch of PDFs contains without opening them, or to pull dates and authors out of a document archive.
What it does to each URL
- Checks the site's
robots.txt. If the file is disallowed, it is skipped and never downloaded. Ifrobots.txtsets aCrawl-delay, the actor waits that long between requests to that site. - Downloads the file, up to the size limit you set (50 MB by default). If the first bytes show it is not a PDF (an HTML page, an image, a login screen), the download stops there.
- Reads the PDF's text layer page by page with pdf.js, the PDF engine used in Firefox. Text items on the same line are joined, and each new line in the PDF starts a new line in the output.
- Reads the document info and XMP metadata.
Input
| Field | Type | Default | What it does |
|---|---|---|---|
startUrls | array | required, no default | PDF links. Plain strings or { "url": "..." } objects. Duplicates are dropped. |
maxItems | integer | 100 | Stop after this many PDFs. Caps what a run costs you. |
maxPagesPerPdf | integer | 0 | Read only the first N pages of each PDF. 0 reads all pages. |
maxFileSizeMb | integer | 50 | Skip files larger than this (up to 100). |
includePages | boolean | true | Add the pages array, one entry per page. |
includeFullText | boolean | true | Add the text field with all pages joined by a blank line. |
Example input:
{"startUrls": [{ "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf" },{ "url": "https://arxiv.org/pdf/1706.03762" }],"maxItems": 20,"maxPagesPerPdf": 0,"includePages": true,"includeFullText": true}
Output
One dataset item per PDF. This is a real result from a test run. The text fields are cut short here with ..., and only the first two of the six pages are shown.
{"source_url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf","final_url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf","fetched_at": "2026-10-28T06:23:38.789Z","status_code": 200,"file_size_bytes": 140815,"pdf_version": "1.7","page_count": 6,"pages_extracted": 6,"truncated": false,"truncated_reason": null,"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","created_at": "2024-03-06T13:18:13.000Z","modified_at": "2024-03-06T13:18:13.000Z","word_count": 6279,"char_count": 37686,"pages_without_text": 0,"pages_failed": 0,"has_text": true,"text": "Form W-9(Rev. March 2024)\nRequest for Taxpayer\nIdentification Number and Certification\n...","pages": [{"page_number": 1,"text": "Form W-9(Rev. March 2024)\nRequest for Taxpayer\nIdentification Number and Certification\nDepartment of the Treasury\n...","word_count": 932,"char_count": 5660},{"page_number": 2,"text": "Form W-9 (Rev. 3-2024) Page 2\nmust obtain your correct taxpayer identification number (TIN), which\n...","word_count": 1349,"char_count": 8168}]}
Fields:
source_url: the URL you gave.final_url: where it ended up after redirects.fetched_at: ISO 8601 time of the download.status_code: HTTP status.file_size_bytes: size of the PDF.pdf_version: the version in the file header, such as1.7.page_count: pages in the document.pages_extracted: pages read in this run.truncated:truewhen not every page was read.truncated_reasonsays why:maxPagesPerPdf,size limit(the text passed about 3.5 million characters, see Limits), ortime limit(reading took over 3 minutes).title,author,subject,keywords,creator,producer: from the document info, falling back to XMP metadata.nullwhen the PDF does not set them. Many PDFs made with LaTeX or scanners leave them empty.created_at,modified_at: converted to ISO 8601 UTC.nullwhen missing or unreadable.word_count,char_count: totals over the pages read.pages_without_text: pages that had no text layer.pages_failed: pages pdf.js could not read (the rest of the document still comes back).has_text:falsewhen no page had any text, which usually means a scanned document.text: all page text joined with a blank line between pages. Only whenincludeFullTextis on.pages:{ page_number, text, word_count, char_count }for each page read. Only whenincludePagesis on.
URLs that fail are not added to the dataset and are not charged. They are listed in the FAILED_URLS record in the run's key-value store, each with a reason, for example HTTP 404, Not a PDF (server sent text/html), Disallowed by robots.txt, File is 120 MB, over the 50 MB limit, or PDF is password protected. A SUMMARY record in the same store gives the counts for the run.
Limits
- No OCR. Scanned PDFs, and pages that are only images, return empty text. You can spot them with
has_text: falseorpages_without_text. They still count as a result because the page count and metadata are returned. - Public files only. It does not log in, send cookies, or open password-protected PDFs. PDFs that are encrypted but open without a password (common for "no copying" settings) are read normally.
- The link has to point at the PDF file itself. A web page that embeds or links to a PDF is reported as
Not a PDF. - Text comes back in the order it is stored in the file. For most single-column documents that is reading order. Multi-column layouts, tables, and forms can come out with columns interleaved or cells on separate lines. There is no table detection.
- Sometimes a space between two words is lost when the PDF places them as separate pieces very close together (
Form W-9(Rev. March 2024)above). - Files over 100 MB are always skipped. Text past about 3.5 million characters in one PDF (several thousand dense pages) is cut off to keep each result under Apify's 9 MB item limit, and
truncatedis set. - Files are fetched one at a time with a 300 to 800 ms pause between requests to the same site, or the site's
Crawl-delayif it is longer. arXiv, for example, asks for 15 seconds, so a list of 40 arXiv papers takes about 10 minutes. Sites that ask for more than 120 seconds are skipped. - If a site's
robots.txtcannot be reached (server error or timeout), that site's files are skipped rather than guessed at. - The output contains whatever text is in the PDF, including any names or contact details printed in it. Check that you have the right to use the documents you process.
Pricing
Pay per result: $0.005 for each PDF that ends up in the dataset, whatever its page count. Failed and skipped URLs are free.
What a run costs:
- 20 PDFs: $0.10
- 100 PDFs (the default
maxItems): $0.50 - 1,000 PDFs: $5.00
Set maxItems to cap the cost of a run.
This actor is not affiliated with any of the sites used in the examples.
Use it from an AI agent
Add this actor as a tool through Apify's MCP server: https://mcp.apify.com?tools=comradecoding/pdf-to-text. The agent gets one JSON row per PDF with the text of every page plus title, author, dates and page count.
Integrations
Anything that can call the Apify API can run this actor: the Apify API and client libraries, and Apify's integrations for Make, n8n, Zapier and LangChain. Results come back as a dataset you can download as JSON, CSV or Excel.
What it costs
| Run size | Cost |
|---|---|
| 100 PDFs | about $0.50 |
| 1,000 PDFs | about $5 |
| 10,000 PDFs | about $50 |
Platform usage is included in the price.
FAQ
Does it read scanned PDFs?
No, there is no OCR. Scanned pages return empty text and are flagged with has_text: false.
Can I give it a web page that links to a PDF?
No, the link has to point at the PDF file itself. Other links are reported as Not a PDF.
Are tables kept?
Text comes out in the order stored in the file. Tables and multi-column layouts can come out interleaved; there is no table detection.
How big can a file be?
Up to 100 MB. Very long text is cut at about 3.5 million characters and truncated is set.