How to Compress a PDF on Linux — Browser and Command-Line Methods
Compress PDFs on Linux using a free browser tool or command-line tools like Ghostscript. No proprietary software required.
Compress PDFs on Linux using a free browser tool or the command line. FixMyPDF's Compress PDF tool works in any Linux browser, or use Ghostscript for command-line compression.
Method 1: Browser-Based Compression (No Install)
Open Firefox or Chrome on your Linux system. Navigate to fixmypdf.in/tools/compressor. Click "Choose File", select your PDF. Click "Compress PDF". Download the compressed file. Works on Ubuntu, Fedora, Debian, Arch — any distro with a modern browser.
Method 2: Ghostscript Command Line
Ghostscript is available in most Linux package managers. Install with sudo apt install ghostscript (Debian/Ubuntu) or sudo dnf install ghostscript (Fedora). Then run: gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
Ghostscript Compression Levels
The -dPDFSETTINGS flag controls quality vs size: /screen (72 dpi, smallest), /ebook (150 dpi, balanced), /printer (300 dpi, high quality), /prepress (300 dpi, maximum quality). For most use cases, /ebook is the best balance.
Method 3: pdftk or qpdf
qpdf --linearize input.pdf output.pdf linearises the PDF for faster web loading but doesn't reduce image quality. For compression, Ghostscript is the standard Linux tool. pdftk is better for splitting and merging than compression.
Batch Compression on Linux
For compressing multiple PDFs in a directory, use a Bash loop: for f in *.pdf; do gs -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile="compressed_$f" "$f"; done. This processes all PDFs in the current folder.
Browser Tool Advantages Over CLI
The browser tool at FixMyPDF requires no package installation and works identically regardless of Linux distro. For quick one-off compressions, opening a browser tab is faster than setting up a Ghostscript command. Use CLI for batch or automated workflows.
Checking Compression Results
After compression, compare file sizes with ls -lh *.pdf. Open the compressed PDF in Evince, Okular, or your preferred Linux PDF viewer to verify quality is acceptable before sending.
Try Compress PDF Now — Free
Browser-based, private, and instant. No account or software required.
Open Compress PDF


