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