xref: /plan9/sys/src/cmd/gs/lib/pdfopt (revision 593dc095aefb2a85c828727bbfa9da139a49bdf4)
1#!/bin/sh
2# $Id: pdfopt,v 1.7 2004/08/04 00:55:46 giles Exp $
3# Convert PDF to "optimized" form.
4
5# This definition is changed on install to match the
6# executable name set in the makefile
7GS_EXECUTABLE=gs
8
9OPTIONS="-dSAFER -dDELAYSAFER"
10while true
11do
12	case "$1" in
13	-*) OPTIONS="$OPTIONS $1" ;;
14	*)  break ;;
15	esac
16	shift
17done
18
19if [ $# -ne 2 ]; then
20	echo "Usage: `basename $0` input.pdf output.pdf" 1>&2
21	exit 1
22fi
23
24exec $GS_EXECUTABLE -q -dNODISPLAY $OPTIONS -- pdfopt.ps "$1" "$2"
25