Two ways out of a PDF, and they answer different questions
Getting something out of a PDF splits into two entirely separate operations that people often confuse. Extracting text reads the characters the document already contains and gives you a file you can search, diff or feed to a program. Extracting images renders each page as a picture, which looks exactly like the page but contains no text at all. Choosing wrongly is why people end up with a folder of PNGs when they wanted a transcript, or an empty text file when they wanted a readable page.
Why PDF to TXT sometimes returns nothing
A PDF can hold text in two completely different ways, and they look identical on screen.
| Kind of PDF | How it was made | Can you select text in a viewer? | PDF to TXT result |
|---|---|---|---|
| Digital / born-digital | Exported from Word, a browser, LaTeX, an accounting system | Yes | Full, accurate text |
| Scanned image | Scanner, copier, phone scan app | No | Empty โ there is no text to extract |
| Scanned with OCR | Scanned, then run through OCR software | Yes, roughly | Text, with OCR's error rate |
| Mixed | Digital document with scanned pages inserted | On some pages | Only the digital pages |
The one-second test: open the PDF and try to select a sentence with the cursor. If the selection highlights letters, there is a text layer and extraction will work. If it draws a rectangle over the whole page, the page is a picture and no extraction tool on earth will find words in it โ what it needs is OCR, which is a different technology that recognises shapes as characters. PDF to TXT reads the text layer; it does not perform OCR.
What text extraction gets wrong even when it works
A PDF does not store paragraphs. It stores instructions to draw glyphs at coordinates. Any extractor has to infer structure from position, and there are recurring failure modes worth knowing before you blame the tool:
- Multi-column layouts may come out interleaved, reading across the columns rather than down them, because the glyphs really are laid out in that order on the page.
- Tables lose their structure. There are no cells in the file, only text positioned in a grid. You get the values without knowing which column they came from.
- Headers, footers and page numbers appear inline, interrupting sentences at every page break.
- Ligatures such as fi and fl may extract as single unusual characters, which breaks naive text searching.
- Hyphenation at line ends survives into the text, so a word is split across two lines.
- Subset fonts with broken encoding produce genuine gibberish โ the file maps glyph shapes to arbitrary codes and never records what letters they represent. Rare, and unfixable without OCR.
When you want pages as images instead
Rendering pages is the right choice when appearance matters more than content: putting a page into a slide deck or a document, posting an extract where you do not want the text copied, sending a preview to someone whose software cannot open PDFs, or feeding pages to OCR software.
- PDF to PNG for pages with text, line art or diagrams. Lossless, so letters stay crisp and there is no ringing around edges. Larger files.
- PDF to JPG for photographic pages, or when you need many pages at a manageable total size. Smaller, with some softening around text.
Resolution is the setting that decides everything here. Rendering at 150 dpi is fine for on-screen reference; 300 dpi is what OCR wants and what prints acceptably; 72 dpi is a thumbnail. Each doubling of dpi quadruples the pixel count and roughly quadruples the file size, so a 300 dpi render of a long document gets heavy quickly.
Choosing by what happens next
| You want to | Use | Note |
|---|---|---|
| Search or index the content | PDF to TXT | Fails silently on scans โ check for a text layer first |
| Compare two revisions | PDF to TXT | Diffing text is far easier than comparing rendered pages |
| Feed a document to a program or model | PDF to TXT | Strip repeated headers and footers afterwards |
| Put a page in a slide or report | PDF to PNG | Render at 2ร the display size |
| Prepare pages for OCR | PDF to PNG at 300 dpi | OCR accuracy drops sharply below 200 dpi |
| Share a page with someone who cannot open PDFs | PDF to JPG | One image per page, universally viewable |
| Make a plain-text document into a PDF | TXT to PDF | The reverse trip, for logs and exports |
A note on what extraction does not do
Extracting text from a PDF is not the same as removing a restriction. If a document is encrypted so that copying is disallowed, that permission flag exists to be honoured, and the right route is to ask whoever published it. Separately, extracting text does not strip a document's metadata or its provenance โ if you are sharing an extract, check what else travelled with it.