| 1 |
#!/bin/sh |
| 2 |
# "Distill" PostScript. |
| 3 |
|
| 4 |
# This definition is changed on install to match the |
| 5 |
# executable name set in the makefile |
| 6 |
GS_EXECUTABLE=gs |
| 7 |
gs="`dirname \"$0\"`/$GS_EXECUTABLE" |
| 8 |
if test ! -x "$gs"; then |
| 9 |
gs="$GS_EXECUTABLE" |
| 10 |
fi |
| 11 |
GS_EXECUTABLE="$gs" |
| 12 |
|
| 13 |
OPTIONS="-P- -dSAFER" |
| 14 |
while true |
| 15 |
do |
| 16 |
case "$1" in |
| 17 |
-?*) OPTIONS="$OPTIONS $1" ;; |
| 18 |
*) break ;; |
| 19 |
esac |
| 20 |
shift |
| 21 |
done |
| 22 |
|
| 23 |
if [ $# -ne 2 ]; then |
| 24 |
echo "Usage: `basename \"$0\"` [options] input.ps output.ps" 1>&2 |
| 25 |
echo " e.g. `basename \"$0\"` -sPAPERSIZE=a4 input.ps output.ps" 1>&2 |
| 26 |
exit 1 |
| 27 |
fi |
| 28 |
|
| 29 |
exec "$GS_EXECUTABLE" -q -sDEVICE=ps2write -sstdout=%stderr "-sOutputFile=$2" -dNOPAUSE -dBATCH $OPTIONS "$1" |