How to compress a PDF in Linux.

Learn how to reduce the file size of PDFs on your Linux device using the command line and online resources.

Multi-page PDFs can quickly become too big to email or upload. Luckily, there are a few ways you can compress files to make it easier to handle larger PDFs. Here are the best ways to compress a PDF with Linux.

PDF compress in Linux with command line utilities.

If you run Debian or Ubuntu, you can compress PDFs with the Ghostscript command line tool. Ghostscript is software that interprets certain file types, so your Linux device can read and edit PDFs.

To begin, install Ghostscript with the command “sudo apt install ghostscript.” Once installed, you can use this command to compress PDF file sizes:

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -

dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -

sOutputFile=output.pdf input.pdf

In the command, replace output.pdf and input.pdf with your chosen filenames. The “dPDFSETTINGS” is where you’ll choose the file size. Change the suffix “=/screen” to suit your need:

Once you input your preferences, simply run the command. Your new compressed PDF will be saved in the same folder as the original.

Use an online PDF editor.

If you’re not comfortable with commands, the easiest way to compress a PDF is with an online PDF editor like Adobe Acrobat online services. Simply visit the Acrobat online services website from any web browser and follow three simple steps:

  1. Upload your file.
  2. Select the PDF to compress.
  3. Download the compressed file to your device.

The online PDF editor will compress the file without losing quality, and you won’t need to download software or enter commands.

Discover more about how Acrobat DC and Acrobat online services can simplify compressing PDFs online from your Linux device.