How to convert a pdf file to text
Using pdftotext
To install
sudo apt install poppler-utils
Convert whole pdf
file*
pdftotext -layout input.pdf output.txt
* -layout
option preserves the PDF layout when converting it to text, even if multi-column PDF cases.
Convert a page range
pdftotext -layout -f M -l N input.pdf
Convert all pdf
files in a folder
for file in *.pdf; do pdftotext -layout "$file"; done