Ubuntu / Linux news and application reviews.

Compress PDF

Compress PDF is a Nautilus script which uses ghostscript to compress PDF files and comes in 8 languages (English, Portuguese (pt-PT), Spanish (es-AR), Czech, French, Simplified Chinese, Arabic, Malayalam). The script lets you choose between 5 different compression levels: Screen-view only, Low Quality, Hight Quality, High Quality (Color Preserving) and Default.

Ricardo has just released an update (version 1.2) which fixes a bug that was causing metadata from the original PDF file (meaning author, title, creator) to be lost after compression.


Update: the post now links to Compress PDF 1.4 which comes with the following changes:

  • Compress PDF now uses notify-osd to inform the user when the compression is completed, and automatically exits (useful for bigger files);
  • Temporary files are now hidden;
  • Saving and replacing the original PDF file with the compressed one works as expected;
  • Fixed: If the user presses Cancel, at any time, Compress PDF will exit and temporary files will be removed;


To use the script in Nautilus for Ubuntu versions older than 13.04 (12.04, 12.10 or older), run the following commands in a terminal:
sudo apt-get install zenity ghostscript
mkdir -p ~/.gnome2/nautilus-scripts
cd ~/.gnome2/nautilus-scripts
rm "Compress PDF" #in case you're using an older version
wget http://launchpad.net/compress-pdf/1.x/1.4/+download/Compress-PDF-1.4.tar.gz
tar zxvf Compress-PDF-1.4.tar.gz && rm Compress-PDF-1.4.tar.gz

For Ubuntu 13.04 and newer, use the following commands instead:
sudo apt-get install zenity ghostscript
mkdir -p ~/.local/share/nautilus/scripts/
cd ~/.local/share/nautilus/scripts/
rm "Compress PDF" #in case you're using an older version
wget http://launchpad.net/compress-pdf/1.x/1.4/+download/Compress-PDF-1.4.tar.gz
tar zxvf Compress-PDF-1.4.tar.gz && rm Compress-PDF-1.4.tar.gz

Or manually download the script from HERE.

Thanks to Ricardo Ferreira for the script and the tip!