From owner-freebsd-questions Thu Feb 1 15:47:28 2001 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-65-26-235-186.mmcable.com [65.26.235.186]) by hub.freebsd.org (Postfix) with SMTP id E3CD337B4EC for ; Thu, 1 Feb 2001 15:47:09 -0800 (PST) Received: (qmail 93164 invoked by uid 100); 1 Feb 2001 23:47:09 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14969.62845.292701.146015@guru.mired.org> Date: Thu, 1 Feb 2001 17:47:09 -0600 (CST) To: Alexey Koptsevich Cc: questions@freebsd.org Subject: Re: duplex printer management In-Reply-To: <33885834@toto.iv> X-Mailer: VM 6.75 under 21.1 (patch 10) "Capitol Reef" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Alexey Koptsevich types: > Hello, > I would like to switch simplex/duplex printing for my HP 4050. I tried > apsfilter but it does not do it correctly, unfortunately. How can I send > escape characters for changing printer modes from the command line? Say, > echo '&l1S' > /dev/lpt0 > does not help... > > Please cc: your reply to me. That's SOP on this list. magicfilter (an alternative print manager to apsfilter) can handle this problem. When you install the port, it puts a slew of filters in /usr/local/libexec/magicfilter. You need to choose the one that's closes to your printer (probably ljet4-filter, but I'm not familiar with the 4050), and set that up in printcap like so: lj|lp|LaserJet 5M:\ :lp=/dev/ulpt0:\ :sd=/var/spool/lpd/lj:\ :lf=/var/spool/lpd/lj/log:\ :af=/var/spool/lpd/lj/acct:\ :if=/usr/local/libexec/magicfilter/ljet4m-filter:\ :mx#0:\ :sh: Then you copy the filter you used from foo-filter to foo-duplex-filter, and edit it to add do the prefix you want. To enable duplex, the lines that look like .... cat .... text (where suffix or prefix and suffix may be mixing) need to be changed to add the string to put the printer in duplex mode to the . If there is no , then just put in the string to put the printer in duplex mode. This will cause file types that are sent straight to the printer to have the prefix added. Second, turn all occurrences of filter and ffilter into pipe and fpipe, respectively. That causes the output of commands that normally would have gone to the printer to be sent back through the filter, which will tack on the prefix because you're sending PCL. Finally, add a second printcap entry called "duplex" that uses the filter you just created, and then print to it by doing: "lpr -P duplex" or change the first one to simplex, and just call the second one lp so that the default printer is duplex, and youget simplex with "lpr -P simplex". And no, I haven't tested this - I just thought about it. I want everything duplex accept the occasional WP document, and my WP has hooks control the duplexer. So I just set the printer to default to duplex, and forgot about it. http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message