home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 May / PCO_5_97.ISO / FilesBBS / OS2 / GS_X11.ARJ / GS_X11.ZIP / bin / ps2pdf < prev    next >
Encoding:
Text File  |  1997-02-02  |  400 b   |  23 lines

  1. #!/bin/sh
  2. # Convert PostScript to PDF.
  3.  
  4. infile=$1;
  5.  
  6. if [ $# -eq 1 ]
  7. then
  8.     case "${infile}" in
  9.       *.ps)        base=`basename ${infile} .ps` ;;
  10.       *)        base=`basename ${infile}` ;;
  11.     esac
  12.     outfile=${base}.pdf
  13. else
  14.     outfile=$2
  15. fi
  16.  
  17. if [ $# -lt 1 -o $# -gt 2 ]; then
  18.     echo "Usage: `basename $0` input.ps [output.pdf]" 1>&2
  19.     exit 1
  20. fi
  21.  
  22. exec gs -q -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=$outfile $infile -c quit
  23.