Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#!/bin/sh
2
# $Id: dvipdf,v 1.5 2004/08/04 00:55:46 giles Exp $
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 -q -f "$infile" | $GS_EXECUTABLE $OPTIONS -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile="$outfile" $OPTIONS -c .setpdfwrite -