[short-tip] Extract range of pages from a PDF file

Let’s assume you downloaded a PDF file with 700 pages. But you want to send by email only pages 7 to 27.

Ghostscript to the rescue! Available in every UNIX/Linux distribution, you can leverage the gs command to do this.

gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER /
   -dFirstPage=7 -dLastPage=27 /
   -sOutputFile=name_of_outfile.pdf name_of_inputfile.pdf
About these ads