#!/bin/bash # PDF Compressor # Dependencies: ghostscript if [[ -e $1 ]]; then gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/prepress -dNOPAUSE -dQUIET -dBATCH -sOutputFile="${1}_compressed.pdf" "$1" && printf "done" || printf "error" fi