ambevar-dotfiles/.scripts/pdfresize

17 lines
288 B
Plaintext
Raw Normal View History

#!/bin/sh
if [ $# -ne 2 ]; then
cat<<EOF
2013-06-25 22:56:10 +02:00
Usage: ${0##*/} INPUT OUTPUT
Resize input PDF to an A4 output PDF.
EOF
exit
fi
if [ ! -f "$1" ]; then
echo "$1 is not a valid file."
fi
gs -q -o "$2" -sDEVICE=pdfwrite -sPAPERSIZE=a4 -dFIXEDMEDIA -dPDFFitPage -dCompatibilityLevel=1.4 "$1"