Debian Codegraph @

pcl/tools/pcl2pdfwr

raw
1 #!/bin/sh
2 # $RCSfile$ $Revision: 2063 $
3 # Convert PCL or PCL to PDF without specifying CompatibilityLevel.
4
5 OPTIONS=
6 while true
7 do
8 case "$1" in
9 -?*) OPTIONS="$OPTIONS $1" ;;
10 *) break ;;
11 esac
12 shift
13 done
14
15 if [ $# -lt 1 -o $# -gt 2 ]; then
16 echo "Usage: `basename $0` [options...] (input.pcl|-) [output.pdf|-]" 1>&2
17 exit 1
18 fi
19
20 infile=$1;
21
22 if [ $# -eq 1 ]
23 then
24 case "${infile}" in
25 -) outfile=- ;;
26 *.pcl) base=`basename ${infile} .pcl`; outfile=${base}.pdf ;;
27 *.pxl) base=`basename ${infile} .pxl`; outfile=${base}.pdf ;;
28 *) base=`basename ${infile}`; outfile=${base}.pdf ;;
29 esac
30 else
31 outfile=$2
32 fi
33
34 # We have to include the options twice because -I only takes effect if it
35 # appears before other options.
36 exec gpcl6 $OPTIONS -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$outfile $OPTIONS $infile