Merging PDF Files

From CS Support Wiki
Jump to: navigation, search

You can use ghostscript to combine PDF files by using the following script in a cmd line:

    gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=merged.pdf  test1.pdf test2.pdf test3.pdf
  • gs: starts Ghostscript
  • -q: stops Ghostscript from displaying messages
  • -dNOPAUSE: continues to process the script without requesting confirmation
  • -dBATCH: exits Ghostscript after merging the PDF files
  • -sDevice=pdfwrite: Ghostscript uses the built-in PDF writer
  • -sOutputFile=merged.pdf: Ghostscript saves the PDF file. Change merged.pdf to what you want the merged document to be named.
  • test1.pdf, test2.pdf and test3.pdf: the names of the pdf files that you would like to merge.