#! /bin/sh #----------------------------------------------------------------------------- # pcl2pdf Convert PCL or PXL to PDF # Derived from pcl2pdfwr # brian@aljex.com # # Creation : 2011-01-11 holbru # Last update: $Id$ # # Copyright (c) 2011-@@YEAR@@ Holger Bruenjes, holgerbruenjes(at)gmx(dot)net # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- OPTIONS='-dCompatibilityLevel=1.4' while true do case "$1" in -?*) OPTIONS="$OPTIONS $1" ;; *) break ;; esac shift done if [ $# -lt 1 -o $# -gt 2 ] then echo "Usage: `basename $0` [options...] (input.pcl|-) [output.pdf|-]" 1>&2 exit 1 fi infile=$1; if [ $# -eq 1 ] then case "${infile}" in -) outfile=- ;; *.pcl) base=$(basename ${infile} .pcl); outfile=${base}.pdf ;; *.pxl) base=$(basename ${infile} .pxl); outfile=${base}.pdf ;; *) base=$(basename ${infile}); outfile=${base}.pdf ;; esac else outfile=$2 fi # We have to include the options twice because -I only takes effect if it # appears before other options. exec pcl6 $OPTIONS -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$outfile $OPTIONS $infile