Summary:Printcap filters for orientation switching on HP laser printers

From: Dwight Walker (PSS) <"Dwight>
Date: Wed, 28 May 1997 13:42:39 +1000

I finally got tired of looking for the invisible information regarding
switching orientation, fonts, modes etc. for remote HP printers that
run jetadmin cards.

Because, as DEC put it "the printcap has been designed to let the
printer do all the work" and the fact that any filters ( if and of
fields ) are void when the entry is for a remote printer, one has to
apply the following work around.

Have a separate entry for each mode you wish to switch to for each
printer, which just passes the file through a filter, then spits it
off to the actual printer that is setup to send the job to the remote
printer. I have set up the following on a printer called jaws which
is a HP laserjet 4si. The modes I needed were landscape, portrait,
compressed landscape and portrait, double sided, and postscript.

Basically the filters insert the PCL5 escape codes into the head of
the document. One thing to watch is that you will lose one line off
the page unless you reset the margins. This isn't a problem unless
your application that is generating the reports etc. force page
breaks. My double sided filter has this extra escape code ( the first
code I think ).

Note the jaws_post just sends the raw data straight to the printer (
rp=raw ) The personality must be set to auto for this to work.
 Although did have to force a switch on one of our HP4 printers by
having a filter like this one

#!/bin/sh
OFILE=/tmp/post.$$
echo '^[%-12345X_at_PJL ENTER LANGUAGE=POSTSCRIPT' > $OFILE
cat >> $OFILE
lpr -Pjaws
rm -f $OFILE

Portrait. This just sends the data straight to the printer as it is
already set for portriat etc.

lp|jaws_p:\
        :lf=/usr/adm/lperr:\
        :lp=:\
        :rm=jaws:\
        :rp=text:\
        :mx#0:\
        :sh:\
        :sd=/usr/spool/lpd/jaws_p:

Landscape. This is a dummy entry that passes the file thru the filter
/usr/lbin/jaws_l .

lp1|jaws_l:\
        :lf=/usr/adm/lperr:\
        :lp=/dev/null:\
        :of=/usr/lbin/jaws_l:\
        :mx#0:\
        :sh:\
        :sd=/usr/spool/lpd/jaws_l:

jaws_l filter


#!/bin/sh

OFILE=/tmp/l.$$
echo '^[&l1O^[(s12H^[(s0P' > $OFILE
cat >> $OFILE
lpr -Pjaws_p $OFILE
rm -f $OFILE


Compressed portrait
lp2|jaws_cp:\
        :lf=/usr/adm/lperr:\
        :lp=/dev/null:\
        :of=/usr/lbin/jaws_cp:\
        :mx#0:\
        :sh:\
        :sd=/usr/spool/lpd/jaws_cp:

jaws_cp filter

#!/bin/sh

OFILE=/tmp/rep.$$
echo '^[&l2E^[&l1S^[(8U^[(s0p12.00h10.0v0s0b3T' > $OFILE
cat >> $OFILE

lpr -Pjaws_p $OFILE

rm -f $OFILE

Compress landscape

lp3|jaws_cl:\
        :lf=/usr/adm/lperr:\
        :lp=/dev/null:\
        :of=/usr/lbin/jaws_cl:\
        :mx#0:\
        :sh:\
        :sd=/usr/spool/lpd/jaws_cl:

jaws_cl filter

#!/bin/sh

OFILE=/tmp/rep.$$
echo '^[&l2E^[&l1S^[(8U^[(s0p12.00h10.0v0s0b3T' > $OFILE
cat >> $OFILE

lpr -Pjaws_p $OFILE

rm -f $OFILE

Double sided
lp4|jaws_rep:\
        :lf=/usr/adm/lperr:\
        :lp=/dev/null:\
        :of=/usr/lbin/jaws_rep:\
        :mx#0:\
        :sh:\
        :sd=/usr/spool/lpd/jaws_rep:

jaws_rep filter

#!/bin/sh

OFILE=/tmp/rep.$$
echo '^[&l2E^[&l1S^[(8U^[(s0p12.00h10.0v0s0b3T' > $OFILE
cat >> $OFILE

lpr -Pjaws_p $OFILE

rm -f $OFILE

Postscript

lp5|jaws_post:\
        :lf=/usr/adm/lperr:\
        :lp=:\
        :rm=jaws:\
        :rp=raw:\
        :mx#0:\
        :sh:\
        :sd=/usr/spool/lpd/jaws_post:



Received on Thu May 29 1997 - 03:38:53 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:36 NZDT