home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / bin / ps2pdfwr < prev    next >
Encoding:
Text File  |  2006-11-28  |  1010 b   |  41 lines

  1. #!/bin/sh
  2. # $Id: ps2pdfwr 6300 2005-12-28 19:56:24Z giles $
  3. # Convert PostScript to PDF without specifying CompatibilityLevel.
  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="-dSAFER"
  10. while true
  11. do
  12.     case "$1" in
  13.     -?*) OPTIONS="$OPTIONS $1" ;;
  14.     *)  break ;;
  15.     esac
  16.     shift
  17. done
  18.  
  19. if [ $# -lt 1 -o $# -gt 2 ]; then
  20.     echo "Usage: `basename $0` [options...] (input.[e]ps|-) [output.pdf|-]" 1>&2
  21.     exit 1
  22. fi
  23.  
  24. infile="$1";
  25.  
  26. if [ $# -eq 1 ]
  27. then
  28.     case "${infile}" in
  29.       -)        outfile=- ;;
  30.       *.eps)    base=`basename "${infile}" .eps`; outfile="${base}.pdf" ;;
  31.       *.ps)        base=`basename "${infile}" .ps`; outfile="${base}.pdf" ;;
  32.       *)        base=`basename "${infile}"`; outfile="${base}.pdf" ;;
  33.     esac
  34. else
  35.     outfile="$2"
  36. fi
  37.  
  38. # We have to include the options twice because -I only takes effect if it
  39. # appears before other options.
  40. exec $GS_EXECUTABLE $OPTIONS -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite "-sOutputFile=$outfile" $OPTIONS -c .setpdfwrite -f "$infile"
  41.