[cli] Combine or remove pages from a PDF document using ghostscript
Combine pdf files:
$ gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=output.pdf pdffile1.pdf pdffile2.pdf
which combines pdffile1.pdf and pdffile2.pdf into a single ouput.pdf.
Delete certain pages of a PDF document:
$ gs -sDEVICE=pdfwrite -dNOPAUSE -dQUIET -dBATCH -dFirstPage=m -dLastPage=n -sOutputFile=output.pdf input.pdf where m and n are positive integers (page numbers), i.e. the above command only prints out pages starting from page number m through n of input.pdf into output.pdf.
Advertisement

[...] (If you’re at playing with PDFs you may also be interested in joining and removing pages from a PDF document using Ghostscript — see a previous post here) [...]
[...] [...]