home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 October / Chip_2002-10_cd1.bin / zkuste / pdf / download / gs704w32.exe / gs7.04 / lib / pdf2ps < prev    next >
Encoding:
Text File  |  2002-01-31  |  750 b   |  30 lines

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