Forrest logo
back to the gs tool

gs:tldr:5c2a9

gs: Merge PDF files.
$ gs -dQUIET -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=${output-pdf} ${input1-pdf} ${input2-pdf}
try on your machine

The command you provided is used to merge multiple PDF files into a single PDF file using the Ghostscript tool. Here is the breakdown of each option and parameter:

  • gs: Command to invoke Ghostscript.

Options:

  • -dQUIET: Runs Ghostscript silently without displaying any output messages.
  • -dBATCH: Exits Ghostscript immediately after processing the input files.
  • -dNOPAUSE: Prevents Ghostscript from pausing after each page.
  • -sDEVICE=pdfwrite: Specifies the output device as pdfwrite which allows creating a PDF file.
  • -sOutputFile=${output-pdf}: Defines the output file name for the assembled PDF. The ${output-pdf} is a placeholder for the actual output file name, which will be provided when running the command.
  • ${input1-pdf} and ${input2-pdf}: Placeholders for the input PDF files to be merged. The actual file names or paths of the input files need to be placed here.

To use this command, you should replace ${output-pdf} with the desired output file name and ${input1-pdf} and ${input2-pdf} with the names or paths of the PDF files you want to merge. The resulting merged PDF file will be saved with the name specified in ${output-pdf}.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the gs tool