cvsdist 99ecd1
#!/bin/sh
cvsdist 99ecd1
#
cvsdist 99ecd1
# "$Id: pstoraster.in,v 1.3 2002/05/12 00:46:34 easysw Exp $"
cvsdist 99ecd1
#
cvsdist 99ecd1
# CUPS filter script for Ghostscript.
cvsdist 99ecd1
#
cvsdist 99ecd1
# Copyright 2001-2002 by Easy Software Products.
cvsdist 99ecd1
#
cvsdist 99ecd1
# This program is free software; you can redistribute it and/or modify
cvsdist 99ecd1
# it under the terms of the GNU General Public License as published by
cvsdist 99ecd1
# the Free Software Foundation; either version 2, or (at your option)
cvsdist 99ecd1
# any later version.
cvsdist 99ecd1
#
cvsdist 99ecd1
# This program is distributed in the hope that it will be useful,
cvsdist 99ecd1
# but WITHOUT ANY WARRANTY; without even the implied warranty of
cvsdist 99ecd1
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
cvsdist 99ecd1
# GNU General Public License for more details.
cvsdist 99ecd1
#
cvsdist 99ecd1
# You should have received a copy of the GNU General Public License
cvsdist 99ecd1
# along with this program; if not, write to the Free Software
cvsdist 99ecd1
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
cvsdist 99ecd1
#
cvsdist 99ecd1
cvsdist 99ecd1
# Installation directories...
cvsdist 58029c
prefix=/usr
cvsdist 99ecd1
exec_prefix=${prefix}
cvsdist 99ecd1
bindir=${exec_prefix}/bin
cvsdist 99ecd1
cvsdist 99ecd1
# Set the library/font path...
cvsdist 99ecd1
GS_FONTPATH="$CUPS_FONTPATH"
cvsdist 99ecd1
export GS_FONTPATH
cvsdist 99ecd1
cvsdist 99ecd1
# Options we use with Ghostscript...
cvsdist 99ecd1
gsopts="-dQUIET -dDEBUG -dPARANOIDSAFER -dNOPAUSE -dBATCH "
cvsdist 99ecd1
gsopts="$gsopts -dNOMEDIAATTRS -sDEVICE=cups -sstdout=%stderr"
cvsdist 99ecd1
cvsdist 99ecd1
# See if we have a profile=n,n,n,n,n,n,n,n,n,n,n option...
cvsdist 99ecd1
profile=""
cvsdist 99ecd1
for option in $5; do
cvsdist 99ecd1
    case $option in
cvsdist 99ecd1
        profile=*)
cvsdist 99ecd1
	    profile="-scupsProfile=`echo $option | awk -F= '{print $2}'`"
cvsdist 99ecd1
	    ;;
cvsdist 99ecd1
    esac
cvsdist 99ecd1
done
cvsdist 99ecd1
cvsdist 99ecd1
# See if we have a filename on the command-line...
cvsdist 99ecd1
if test -z "$6"; then
cvsdist 99ecd1
	ifile="-"
cvsdist 99ecd1
else
cvsdist 99ecd1
	ifile="$6"
cvsdist 99ecd1
fi
cvsdist 99ecd1
cvsdist 99ecd1
# Now run Ghostscript...
cvsdist 99ecd1
$bindir/gs $gsopts -sOUTPUTFILE="%stdout" $profile $ifile
cvsdist 99ecd1
cvsdist 99ecd1
#
cvsdist 99ecd1
# End of "$Id: pstoraster.in,v 1.3 2002/05/12 00:46:34 easysw Exp $".
cvsdist 99ecd1
#