Guide
Digital versus scanned, the edge cases that ruin naive scripts, and the point where a library stops being worth the afternoon.
Before you pick a tool, work out which kind you have. It decides everything else.
A digital PDF was made by software. The text is in there as text, with positions and fonts. Pulling it out is a solved problem and costs almost nothing.
A scanned PDF is a photograph of paper wrapped in a PDF container. There is no text in it at all, only pixels. Getting words out means optical character recognition, which is slower, costs more and is never quite perfect.
Most collections are a mix, and the mix is what ruins naive scripts. A library that handles digital files beautifully returns empty strings for the scanned ones, silently, and you find out three weeks later when someone asks why a supplier is missing from the report.
For a handful of files, open them and copy the text. For a few hundred digital ones, a Python library does the job in twenty lines and costs nothing but the afternoon you spend on edge cases. Genuinely: if that is your situation, take it.
The edge cases, in the order you will meet them. Multi-column layouts come out interleaved, because reading order is a guess the library has to make. Tables lose their structure and become a soup of numbers. Headers and footers repeat on every page and pollute the text. Ligatures and hyphenation split words in half. And encrypted or password-protected files stop the run dead unless you catch that specifically.
Three situations flip the maths. When the volume goes past what you want to babysit, because a thousand files with a handful of failures is a triage job rather than a script. When the sources are mixed and you need OCR only for the files that need it, without paying for it on the ones that do not. And when the job has to run again next month on new files, which makes it software you maintain rather than a script you ran once.
If this is going into a retrieval pipeline, the PDF is usually only half the corpus. The rest is web pages, and those need the same treatment: the main content without menus, cookie bars and footers. Keeping both in the same row shape, with a source and a page reference on every row, is what makes the retrieval step simple later.
PDF text is billed per page extracted at $1.00 per 1,000, so a tenth of a cent a page. Pages that are encrypted, empty or unreadable come back as records and are not charged. Web pages converted to clean markdown are billed the same way, per page converted at $1.00 per 1,000.
For a thousand mixed documents you are looking at a couple of dollars and no afternoon. For twenty files, use the library and keep your money.
Plain text extraction from PDF files by URL, up to 200 files per run: one row per page (or one per file) with the text, page count, title, author, dates, producer and file size, plus whether the page has a text layer at all. Pay per page delivered.
$1.00 per 1,000 · Page extractedThe main content of web pages as Markdown and plain text, up to 500 URLs per run: title, description, author, date, language, word count, links and images, without menus, cookie banners and footers, ready for LLMs, search indexes and archives. Pay per page.
$1.00 per 1,000 · Page convertedSitemap URL extractor: every URL a website lists in its XML sitemaps, up to 100 sites per run: sitemaps are found through robots.txt and the usual paths, sitemap indexes and gzip are followed, and each URL comes with its sitemap, last modification date, change frequency and priority. Pay per URL.
$0.50 per 1,000 · URL listed