pdfopt 485 B

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