Skip to content

Instantly share code, notes, and snippets.

@richlamdev
Last active December 1, 2020 05:23
Show Gist options
  • Save richlamdev/52603ff582bfdbc35d93cf4cafd2ba1a to your computer and use it in GitHub Desktop.
Save richlamdev/52603ff582bfdbc35d93cf4cafd2ba1a to your computer and use it in GitHub Desktop.
ghostscript notes
GHOSTSCRIPT - CONCATENTATE PAGES
#with compressions (default)
#combines in1.pdf and in2.pdf into out.pdf.
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=out.pdf in1.pdf in2.pdf
#without compression:
#combines in1.pdf and in2.pdf into out.pdf.
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress -sOutputFile=out.pdf in1.pdf in2.pdf
GHOSTSCRIPT - PRINT RANGE OF PAGES
#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.
gs -sDEVICE=pdfwrite -dNOPAUSE -dQUIET -dBATCH -dFirstPage=m -dLastPage=n -sOutputFile=output.pdf input.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment