Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Feb 2001 17:47:09 -0600 (CST)
From:      Mike Meyer <mwm@mired.org>
To:        Alexey Koptsevich <kopts@astro.ioffe.rssi.ru>
Cc:        questions@freebsd.org
Subject:   Re: duplex printer management
Message-ID:  <14969.62845.292701.146015@guru.mired.org>
In-Reply-To: <33885834@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
Alexey Koptsevich <kopts@astro.ioffe.rssi.ru> 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 '<symbol 0x1b>&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	<prefix>	<suffix>
....	text	<prefix>	<suffix>

(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
<prefix>. If there is no <prefix>, 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.

	<mike
--
Mike Meyer <mwm@mired.org>			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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14969.62845.292701.146015>