You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
758 B

#!/bin/bash
# AO-pdf-shrink
# GPLv3+
#
# Usage:
# AO-pdf-shrink foo.pdf
# Set QUALITY to one of the below:
# screen -- lower quality, smaller size.
# ebook -- for better quality, but slightly larger pdfs.
# prepress -- output similar to Acrobat Distiller "Prepress Optimized" setting
# printer -- selects output similar to the Acrobat Distiller "Print Optimized" setting
# default -- selects output intended to be useful across a wide variety of uses, possibly at the expense of a larger output file
QUALITY=screen
OUTPDF="`basename $1 .pdf`-$QUALITY.pdf"
gs \
-sDEVICE=pdfwrite \
-dCompatibilityLevel=1.4 \
-dPDFSETTINGS=/$QUALITY \
-dNOPAUSE \
-dQUIET \
-dBATCH \
-sOutputFile=$OUTPDF \
$1