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

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