Forrest logo
back to the gs tool

gs:tldr:e0577

gs: Reduce PDF file size to 150 dpi images for reading on a e-book device.
$ gs -dNOPAUSE -dQUIET -dBATCH -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -sOutputFile=${output-pdf} ${input-pdf}
try on your machine

This command is used to create a PDF file with specified settings from an input PDF file.

Let's break down the individual components of the command:

  • gs: This is the command for Ghostscript, a popular software suite used for interpreting PostScript and PDF files.
  • -dNOPAUSE: This option disables the prompt for user intervention when processing a file.
  • -dQUIET: This option suppresses unnecessary information and error messages during the conversion process.
  • -dBATCH: This option exits Ghostscript after processing the file, preventing it from entering interactive mode.
  • -sDEVICE=pdfwrite: This option specifies the output device as pdfwrite, which means the command will produce a PDF file.
  • -dPDFSETTINGS=/ebook: This option sets the specified PDF settings to optimize the file for ebook usage. This includes a lower resolution and compressed images, potentially reducing file size.
  • -sOutputFile=${output-pdf}: This option specifies the output file name and location. The ${output-pdf} is a placeholder for the desired output file name. It should be replaced with the desired name and file path.
  • ${input-pdf}: This is a placeholder for the input file name and path. It should be replaced with the actual path to the input PDF file.

So, when this command is executed with proper input and output file paths, Ghostscript will convert the input PDF file using the specified settings and save the result as the output PDF file.

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