ps2pdfwr 1015 B

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