Home/Guides/Converter
๐Ÿ“Converter

Getting Text or Images Out of a PDF: Two Different Jobs

Extraction reads a text layer that scans do not have. When PDF to TXT returns nothing, what it gets wrong even when it works, and what dpi to render at.

7 min read

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 PDFHow it was madeCan you select text in a viewer?PDF to TXT result
Digital / born-digitalExported from Word, a browser, LaTeX, an accounting systemYesFull, accurate text
Scanned imageScanner, copier, phone scan appNoEmpty โ€” there is no text to extract
Scanned with OCRScanned, then run through OCR softwareYes, roughlyText, with OCR's error rate
MixedDigital document with scanned pages insertedOn some pagesOnly 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 toUseNote
Search or index the contentPDF to TXTFails silently on scans โ€” check for a text layer first
Compare two revisionsPDF to TXTDiffing text is far easier than comparing rendered pages
Feed a document to a program or modelPDF to TXTStrip repeated headers and footers afterwards
Put a page in a slide or reportPDF to PNGRender at 2ร— the display size
Prepare pages for OCRPDF to PNG at 300 dpiOCR accuracy drops sharply below 200 dpi
Share a page with someone who cannot open PDFsPDF to JPGOne image per page, universally viewable
Make a plain-text document into a PDFTXT to PDFThe 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.

Frequently asked questions

My PDF to TXT output is empty. Is the file broken?

Almost certainly not. The pages are images with no text layer, which is normal for anything scanned. You need OCR, not extraction.

Why is the extracted text in the wrong order?

Multi-column or heavily designed layouts store glyphs in drawing order, which is not always reading order. Rendering the page as an image and running OCR often gives a better reading order than extraction does.

Can I extract just one page?

Split the PDF first, then extract from the part you want.

What dpi should I render at?

150 for screen reference, 300 for printing or OCR, 72 for thumbnails. Higher than 300 rarely helps and grows the file fast.

Does rendering to images keep the text searchable?

No โ€” that is the trade. An image of a page has no text in it at all, which is sometimes exactly the point.

Is my document uploaded?

No. Parsing and rendering run in your browser using a local PDF engine, which matters for contracts, statements and medical records.

Tools mentioned in this guide