pdf2ps 721 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/sh
  2. # $Id: pdf2ps,v 1.4 2001/06/22 16:09:22 lpd Exp $
  3. # Convert PDF to PostScript.
  4. OPTIONS=""
  5. while true
  6. do
  7. case "$1" in
  8. -?*) OPTIONS="$OPTIONS $1" ;;
  9. *) break ;;
  10. esac
  11. shift
  12. done
  13. if [ $# -eq 2 ]
  14. then
  15. outfile=$2
  16. elif [ $# -eq 1 ]
  17. then
  18. outfile=`basename "$1" \.pdf`.ps
  19. else
  20. echo "Usage: `basename $0` [-dASCII85EncodePages=false] [-dLanguageLevel=1|2|3] input.pdf [output.ps]" 1>&2
  21. exit 1
  22. fi
  23. # Doing an initial 'save' helps keep fonts from being flushed between pages.
  24. # We have to include the options twice because -I only takes effect if it
  25. # appears before other options.
  26. exec gs $OPTIONS -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pswrite "-sOutputFile=$outfile" $OPTIONS -c save pop -f "$1"