[cups-devel] Duplex printing on Brother HL-3150cdw

Éric Brunet <[email protected]>
Newsgroups gmane.comp.printing.cups.devel
Message-ID <[email protected]>
> Eric,
> 
>>> The driver isn't exposing 2-sided printing using the proper,
>>> supported option name (Duplex).  Please report the bug to 
>>> Brother...

> Those hacks date before Adobe standardized the Duplex option in the
> mid 1990's.  They exist solely to support older printers from
> popular printer/RIP manufacturers of the day, and as it is now 2016
> we have no desire or plan to extend this list to include Brother's
> incorrect choice.
>
> (and the problem with being too liberal in what we accept is that
> you'll end up getting the wrong behavior... Modern computer science
> does not blindly follow that goal...)

Too bad. I still find being liberal and correct is the good thing to 
do, but anyway, I get your point. I will e-mail Brother to point out
that BRDuplex is not a good option name.

In the meantime, I fixed the issue on my computer. For the benefit of 
other people having similar printers, let me just write down what I 
did:

1) Edit the .ppd file corresponding to your printer in /etc/cups/ppd, 
and change all occurence of "BRDuplex" into "Duplex". Change also 
"DefaultBRDuplex" into "DefaultDuplex".

2) Apply the small patch at the end of the mail to the file 
       /usr/lib/cups/filter/brother_lpdwrapper_hl3150cdn
(Nota: I also changed the identical file that sit in .../lib64/...,
but even though my computer runs a 64bit cups, it is the /lib/ version
which seems to be used.)

3) restart cups. To be extra sure, I stopped cups, removed /var/cache/cups
and restarted cups, but maybe that was overkill.

Éric Brunet

Patch to apply to /usr/lib/cups/filter/brother_lpdwrapper_hl3150cdn
====================================================================
--- brother_lpdwrapper_hl3150cdn.orig	2016-01-15 20:16:42.167405090 +0100
+++ brother_lpdwrapper_hl3150cdn	2016-01-18 17:37:00.803136665 +0100
@@ -123,12 +123,17 @@
 fi
 
 CUPSOPTION=`echo "$5 Copies=$4" | 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/'`
+
+# Turn any Duplex option into BRDuplex
+CUPSOPTION=`echo "$CUPSOPTION" | sed -e 's/\bDuplex\b/BRDuplex/'`
+
 if [ -e "/opt/brother/Printers/hl3150cdn/cupswrapper/brcupsconfpt1" ]; then
-	
+# Copy the ppd, replacing Duplex into BRDuplex	
+  sed -e 's/\bDefaultDuplex\b/DefaultBRDuplex/' -e 's/\bDuplex\b/BRDuplex/' $PPDC > /tmp/br_ppd_$$
   if [ $DEBUG = 0 ]; then
-     /opt/brother/Printers/hl3150cdn/cupswrapper/brcupsconfpt1  HL3150CDN  $PPDC 0 "$CUPSOPTION" "hl3150cdn" $BRPRINTERRCFILE>> /dev/null
+     /opt/brother/Printers/hl3150cdn/cupswrapper/brcupsconfpt1  HL3150CDN  /tmp/br_ppd_$$ 0 "$CUPSOPTION" "hl3150cdn" $BRPRINTERRCFILE>> /dev/null
   else
-     /opt/brother/Printers/hl3150cdn/cupswrapper/brcupsconfpt1  HL3150CDN  $PPDC $LOGCLEVEL "$CUPSOPTION" "hl3150cdn" $BRPRINTERRCFILE>>$LOGFILE
+     /opt/brother/Printers/hl3150cdn/cupswrapper/brcupsconfpt1  HL3150CDN  /tmp/br_ppd_$$ $LOGCLEVEL "$CUPSOPTION" "hl3150cdn" $BRPRINTERRCFILE>>$LOGFILE
   fi
 fi
 
@@ -137,6 +142,7 @@
     echo brhl3150cdnrc_$$   > /tmp/hl3150cdn_latest_print_info
     cat  /tmp/brhl3150cdnrc_$$  >> /tmp/hl3150cdn_latest_print_info
     rm -f /tmp/brhl3150cdnrc_$$
+    rm -f /tmp/br_ppd_$$
 
     if [ $LOGLEVEL -gt 2 ];  then
 	   if [ $LOGFILE != "/dev/null" ]; then
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.