A GTK+ GUI Application written in Python that simplifies compressing PDF files with Ghostscript written for OS X

based on Densify

Change Log

To keep up-to-date with announcements and changes, follow @3dfosi on twitter!

MAY 25th, 2018 – v0.1.0 Released

  • Birth of iDensify



Under the Hood

It essentially takes your GUI input and turn them into the following Ghostscript command:

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.6 -dPDFSETTINGS=/ebook
-dNOPAUSE -dQUIET -dBATCH -sOutputFile=[compressed.pdf]

Error Handling

Currently, if any of the below conditions are met, the application will either automatically handle or show an error/warning dialog message that returns to the main window without doing anything upon the user clicking “OK”. This is designed to prevent any dangerous execution of Ghostscript. For the ones that are questionable, it will warn the user and provide a chance to cancel or confirm.

Automatically Handles:

  • Output file name was not specified, use “compressed.pdf” by default

Shows an Error Dialog Message and Returns to Main Window Upon the User Clicking “OK”:

  • Input file is not specified
  • Input file does not end with .pdf
  • Input File and Output File are the same
  • Input File Name Contains Unsupported Characters(/\:;`)
  • Output File Name Contains Unsupported Characters(/\:;`)

Questionable Conditions that the application will verify with User via A Dialog Message:

  • Output File does not end with .pdf, verify with user that’s really what they want
  • Output File Name Matches a File in the Output Directory


Step 1:

Install HomeBrew via if you haven’t already:

/usr/bin/ruby -e "$(curl -fsSL"

Step 2:

Install Ghostscript:

brew install gs

Step 3:

Download the latest DMG

Step 4:

Mount DMG & copy App Bundle into your /Applications Folder

Step 5:

Allow Apps Downloaded from Anywhere


If the option Anywhere is missing, click on the lock icon to unlock the settings:

Missing Anywhere Option

If it still does not show, then execute the following command in the terminal:

sudo spctl --master-disable

To lock the settings back up, execute the following command in the terminal:

sudo spectl --master-enable


Just Python

If this option is chosen, ensure that you already have Python3 installed on your Mac. If not, you can do the following:

Step 1:

Install HomeBrew via if you haven’t already:

/usr/bin/ruby -e "$(curl -fsSL"

Step 2:

Install Python3:

brew install python3

Just run the Python script:


Building Your Own One File Binary & MacOS Bundle

Dependencies: python3, gi, gtk+3, pygobject3, gs

Run the following inside the cloned directory:

python3 -m PyInstaller --clean iDensify.spec

Future Plans

  • If app is not in foreground, notify user via desktop notification upon completing compression
  • Fix Menu Bar Quit – Currently it does nothing
  • Better MacOS integration
  • More User Friendly Features


This application is maintained by volunteers and in no way do the maintainers make any guarantees. Please use at your own risk!


Many thanks to Anthony Wong and Koala Yeung for talking me through this and Dr. Haggen So for sharing the following link that inspired me to write this application:

This is an application utility sponsored by 3DF Limited’s Open Source Initiative.

To Learn more please visit:

Shout out goes to Ivan Oung for looking through the readme and suggesting changes to make this application more accessible!

Want a CLI alternative instead?

Check out cPDF, a Python script to simplify compress PDF file size with GhostScript

What about Linux?

Check out Densify, the original PDF compressor written for Linux which iDensify is based on