2017-12-05 20:12:55 +00:00
|
|
|
# pdftotext
|
|
|
|
|
|
|
|
> Convert PDF files to plain text format.
|
2021-08-12 13:27:58 +01:00
|
|
|
> More information: <https://www.xpdfreader.com/pdftotext-man.html>.
|
2017-12-05 20:12:55 +00:00
|
|
|
|
2021-01-31 17:05:18 +00:00
|
|
|
- Convert `filename.pdf` to plain text and print it to standard output:
|
2017-12-05 20:12:55 +00:00
|
|
|
|
|
|
|
`pdftotext {{filename.pdf}} -`
|
|
|
|
|
2021-01-31 17:05:18 +00:00
|
|
|
- Convert `filename.pdf` to plain text and save it as `filename.txt`:
|
2017-12-05 20:12:55 +00:00
|
|
|
|
|
|
|
`pdftotext {{filename.pdf}}`
|
|
|
|
|
2021-01-31 17:05:18 +00:00
|
|
|
- Convert `filename.pdf` to plain text and preserve the layout:
|
2019-12-02 16:44:17 +00:00
|
|
|
|
|
|
|
`pdftotext -layout {{filename.pdf}}`
|
|
|
|
|
2021-01-31 17:05:18 +00:00
|
|
|
- Convert `input.pdf` to plain text and save it as `output.txt`:
|
2017-12-05 20:12:55 +00:00
|
|
|
|
|
|
|
`pdftotext {{input.pdf}} {{output.txt}}`
|
|
|
|
|
2021-01-31 17:05:18 +00:00
|
|
|
- Convert pages 2, 3 and 4 of `input.pdf` to plain text and save them as `output.txt`:
|
2017-12-05 20:12:55 +00:00
|
|
|
|
2017-12-07 06:29:30 +00:00
|
|
|
`pdftotext -f {{2}} -l {{4}} {{input.pdf}} {{output.txt}}`
|