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

pdftotext

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

click the source code to copy install pdftotext on any operating system with command-not-found.com