dependencies: On Ubuntu/Debian: sudo apt-get install ghostscript On macOS with Homebrew: brew install ghostscript On Windows, download and install from the Ghostscript website
usage: python compressor-balanced.py mypdf.pdf
will save as compressed_mypdf.pdf in same directory