scripts/pdf/reduce_pdf_size.sh

13 lines
626 B
Bash
Executable File

#!/bin/sh
# PDFSETTINGS:
# -dPDFSETTINGS=/screen lower quality, smaller size (72 dpi)
# -dPDFSETTINGS=/ebook better quality, larger size (150 dpi)
# -dPDFSETTINGS=/prepress same as Acrobat Distiller "Prepress Optimized" setting (300 dpi)
# -dPDFSETTINGS=/printer same as Acrobat Distiller "Print Optimized" setting (300 dpi)
# -dPDFSETTINGS=/default useful across a wide variety of uses, which may result in a larger output file
if [ "$#" -ne 2 ]; then
echo "usage: $0 INPUT_FILE OUTPUT_FILE"
exit 1
fi
gs -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile="$2" "$1"