-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpdfcomp
More file actions
executable file
·26 lines (26 loc) · 798 Bytes
/
pdfcomp
File metadata and controls
executable file
·26 lines (26 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
[ -z "$1" ] && printf "Missing Output File\n" 2>&1 && exit
outfile=$1
shift
while [ $# -gt 0 ]; do
case $1 in
-high)
shift
convert -density 300x300 -quality 100 "$@"
break
;;
-low)
shift
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress -sOutputFile="$outfile" "$@"
break
;;
-comp)
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH -dDetectDuplicateImages -dCompressFonts=true -r150 -sOutputFile="$outfile" "$@"
break
;;
*)
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile="$outfile" "$@"
break
;;
esac
done