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 / dvipdf < prev    next >
Encoding:
Text File  |  2006-11-28  |  967 b   |  46 lines

  1. #!/bin/sh
  2. # $Id: dvipdf 6300 2005-12-28 19:56:24Z giles $
  3. # Convert DVI to PDF.
  4. #
  5. # Please contact Andrew Ford <A.Ford@ford-mason.co.uk> with any questions
  6. # about this file.
  7. #
  8. # Based on ps2pdf
  9.  
  10. # This definition is changed on install to match the
  11. # executable name set in the makefile
  12. GS_EXECUTABLE=gs
  13.  
  14.  
  15. OPTIONS=""
  16. while true
  17. do
  18.     case "$1" in
  19.     -*) OPTIONS="$OPTIONS $1" ;;
  20.     *)  break ;;
  21.     esac
  22.     shift
  23. done
  24.  
  25. if [ $# -lt 1 -o $# -gt 2 ]; then
  26.     echo "Usage: `basename $0` [options...] input.dvi [output.pdf]" 1>&2
  27.     exit 1
  28. fi
  29.  
  30. infile=$1;
  31.  
  32. if [ $# -eq 1 ]
  33. then
  34.     case "${infile}" in
  35.       *.dvi)    base=`basename "${infile}" .dvi` ;;
  36.       *)        base=`basename "${infile}"` ;;
  37.     esac
  38.     outfile="${base}".pdf
  39. else
  40.     outfile=$2
  41. fi
  42.  
  43. # We have to include the options twice because -I only takes effect if it
  44. # appears before other options.
  45. exec dvips -Ppdf -q -f "$infile" | $GS_EXECUTABLE $OPTIONS -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile="$outfile" $OPTIONS -c .setpdfwrite -
  46.