HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

pdftotext — Convert PDF files to plain text format. More information: <https://www.xpdfreader.com/pdftotext-man.

Submitted by: @import:tldr-pages··
0
Viewed 0 times
pdftotextplaincommandfilestextconvertclipdf

Problem

How to use the pdftotext command: Convert PDF files to plain text format. More information: <https://www.xpdfreader.com/pdftotext-man.html>.

Solution

pdftotext — Convert PDF files to plain text format. More information: <https://www.xpdfreader.com/pdftotext-man.html>.

Convert filename.pdf to plain text and print it to stdout:
pdftotext {{filename.pdf}} -


Convert filename.pdf to plain text and save it as filename.txt:
pdftotext {{filename.pdf}}


Convert filename.pdf to plain text and preserve the layout:
pdftotext -layout {{filename.pdf}}


Convert input.pdf to plain text and save it as output.txt:
pdftotext {{input.pdf}} {{output.txt}}


Convert pages 2, 3, and 4 of input.pdf to plain text and save them as output.txt:
pdftotext -f {{2}} -l {{4}} {{input.pdf}} {{output.txt}}

Code Snippets

Convert `filename.pdf` to plain text and print it to `stdout`

pdftotext {{filename.pdf}} -

Convert `filename.pdf` to plain text and save it as `filename.txt`

pdftotext {{filename.pdf}}

Convert `filename.pdf` to plain text and preserve the layout

pdftotext -layout {{filename.pdf}}

Convert `input.pdf` to plain text and save it as `output.txt`

pdftotext {{input.pdf}} {{output.txt}}

Convert pages 2, 3, and 4 of `input.pdf` to plain text and save them as `output.txt`

pdftotext -f {{2}} -l {{4}} {{input.pdf}} {{output.txt}}

Context

tldr-pages: common/pdftotext

Revisions (0)

No revisions yet.