dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles # fast
git clone https://src.adamsgaard.dk/dotfiles.git # slow
Log | Files | Refs | README | LICENSE Back to index

pdf-compress.sh (450B)


      1 #!/bin/sh
      2 
      3 if [[ $# -gt 0 ]]; then
      4 
      5     for f in "$@"; do
      6         echo "processing '$f'"
      7         /usr/local/bin/gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 \
      8             -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH \
      9             -dDetectDuplicateImages \
     10             -dCompressFonts=true -r150 \
     11             -sOutputFile="${f%.*}_compressed.pdf" "$f";
     12     done
     13 else
     14     echo "Error: you must specify one or more input PDF files"
     15     exit 1 
     16 fi