home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / bin / pdf2ps < prev    next >
Encoding:
Text File  |  2005-11-16  |  782 b   |  34 lines

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