Extract Selected range of Pages of a PDF as a PDF File in Linux
You downloaded a PDF file and you are only interested in particular pages say 23-56 and the rest of it is useless for you, then you can use the GhostScript utility to extract these range of pages as a new PDF so you can save on size, and gain on reading confidence ( I hate books with huge no. of pages .. ) .
You can do this via this command
$ gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER \ -dFirstPage=22 -dLastPage=36 \ -sOutputFile=outfile_p22-p36.pdf 100p-inputfile.pdf
Remember to change the following params here
100p-inputfile.pdf Change it to your own input PDF file
-dFirstPage=22 Change it with your starting page range
-dLastPage=36 Change it to your range’s last page
-sOutputFile=pages22-36.pdf Change it to any arbitrary filename of your own
This is the easiest and the fastest method to achieve a page range extract as it uses the native GhostScript utility which is available in every distro of Unix/Linux Nowdays , so you can use it without installing any package or utility .