3 # Copyright (C) 2005 Brother. Industries, Ltd.
6 # This program is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by the Free
8 # Software Foundation; either version 2 of the License, or (at your option)
11 # This program is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 # You should have received a copy of the GNU General Public License along with
17 # this program; if not, write to the Free Software Foundation, Inc., 59 Temple
18 # Place, Suite 330, Boston, MA 02111-1307 USA
29 if [ $DEBUG != 0 ]; then
30 LOGFILE
=/tmp
/br_cupsfilter_debug_log
33 PPDC
=`printenv | grep "PPD="`
34 PPDC
=`echo $PPDC | sed -e 's/PPD=//'`
36 if [ "$PPDC" = "" ]; then
37 PPDC
="/usr/share/cups/model/brdcp9010cn.ppd"
41 if [ $LOGFILE != "/dev/null" ]; then
42 if [ $LOG_LATESTONLY == "1" ]; then
46 if [ -e $LOGFILE ]; then
52 echo "arg0 = $0" >>$LOGFILE
53 echo "arg1 = $1" >>$LOGFILE
54 echo "arg2 = $2" >>$LOGFILE
55 echo "arg3 = $3" >>$LOGFILE
56 echo "arg4 = $4" >>$LOGFILE
57 echo "arg5 = $5" >>$LOGFILE
58 echo "arg6 = $6" >>$LOGFILE
59 echo "PPD = $PPD" >>$LOGFILE
62 INPUT_TEMP_PS
=`mktemp /tmp/br_input_ps.XXXXXX`
65 if [ "" != '' ] && [ $NUPENABLE != 0 ]; then
69 elif [ "" != '' ]; then
71 elif [ "" != '' ]; then
73 elif [ "" != '' ]; then
75 elif [ "" != '' ]; then
77 elif [ "" != '' ]; then
79 elif [ "" != '' ]; then
81 elif [ "" != '' ]; then
83 elif [ "" != '' ]; then
86 echo "NUP=$nup" >>$LOGFILE
87 if [ -e /usr
/bin
/psnup
]; then
89 cat $6 |
$nup > $INPUT_TEMP_PS
91 cat |
$nup > $INPUT_TEMP_PS
101 if [ $# -ge 7 ]; then
107 if [ -e "/usr/local/Brother/Printer/dcp9010cn/lpd/filterdcp9010cn" ]; then
110 echo "ERROR: /usr/local/Brother/Printer/dcp9010cn/lpd/filterdcp9010cn does not exist" >>$LOGFILE
115 CUPSOPTION
=`echo "$5 Copies=1" | sed -e 's/BrMirror=OFF/MirrorPrint=OFF/' -e 's/BrMirror=ON/MirrorPrint=ON/' -e 's/BrChain/Chain/' -e 's/BrBrightness/Brightness/' -e 's/BrContrast/Contrast/' -e 's/BrHalfCut/HalfCut/' -e 's/BrAutoTapeCut/AutoCut/' -e 's/BrHalftonePattern/Halftone/' -e 's/Binary/Binary/' -e 's/Dither/Dither/' -e 's/ErrorDiffusion/ErrorDiffusion/' -e 's/BrSheets/Sheets/' -e 's/multiple-document-handling/Collate/' -e 's/separate-documents-collated-copies/ON/' -e 's/separate-documents-uncollated-copies/OFF/'`
116 if [ -e "/usr/local/Brother/Printer/dcp9010cn/cupswrapper/brcupsconfpt1" ]; then
117 if [ $DEBUG = 0 ]; then
118 /usr
/local
/Brother
/Printer
/dcp9010cn
/cupswrapper
/brcupsconfpt1 DCP9010CN
$PPDC 0 "$CUPSOPTION" "dcp9010cn">> /dev
/null
120 /usr
/local
/Brother
/Printer
/dcp9010cn
/cupswrapper
/brcupsconfpt1 DCP9010CN
$PPDC $LOGCLEVEL "$CUPSOPTION" "dcp9010cn">>$LOGFILE
124 if [ $DEBUG -lt 10 ]; then
125 cat $INPUT_TEMP_PS |
/usr
/local
/Brother
/Printer
/dcp9010cn
/lpd
/filterdcp9010cn
"$$" "CUPS" "USB"
127 if [ $LOGLEVEL -gt 2 ]; then
128 if [ $LOGFILE != "/dev/null" ]; then
130 echo " ------PostScript Data-------" >>$LOGFILE
131 cat $INPUT_TEMP_PS >>$LOGFILE