pdftotext -layout input.pdf output.txt

Category: Media & Conversion

pdftotext -layout input.pdf output.txt

Extract text preserving layout

Extracts the text layer of the PDF into a text file. -layout keeps approximate line and column positions, which helps for tables. Scanned PDFs have no text layer and need OCR instead.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.