#!/bin/bash # Source: http://tex.stackexchange.com/a/41273 file=$1 gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile="${1%.pdf}_small.pdf" "$file"