
Medium quality output (150 dpi) with moderate output file size Higher quality output (300 dpi) but bigger size This is what determines the compression level and thus the quality of your compressed PDF file. What you need to know is the dPDFSETTINGS parameter. In the above command, you should add the correct path of the input and out PDF file. Now that you have made sure that Ghostscript is installed, you can use the following command to reduce the size of your PDF file: gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/prepress -dNOPAUSE -dQUIET -dBATCH -sOutputFile=compressed_PDF_file.pdf input_PDF_file.pdf On Debian/Ubuntu based distributions, use the following command to install Ghostscript: sudo apt install ghostscript However, you can still try to install it just to make sure. Most Linux distributions include the open source version of Ghostscript already.

You can use Ghostscript command line tool for compressing a PDF file.

Method 1: Reduce PDF file size in Linux command line
