home *** CD-ROM | disk | FTP | other *** search
/ PCNET 2006 September - Disc 1 / PCNET_CD_2006_09.iso / linux / puppy-barebones-2.01r2.iso / pup_201.sfs / usr / bin / pdf2ps < prev    next >
Encoding:
Text File  |  2005-07-31  |  844 b   |  34 lines

  1. #!/bin/sh
  2. # $Id: pdf2ps,v 1.7 2004/08/04 00:55:46 giles Exp $
  3. # Convert PDF to PostScript.
  4.  
  5. # This definition is changed on install to match the
  6. # executable name set in the makefile
  7. GS_EXECUTABLE=gs
  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_EXECUTABLE $OPTIONS -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pswrite "-sOutputFile=$outfile" $OPTIONS -c save pop -f "$1"
  34.