SUMMARY: Jetadmin and Custom Printers

From: Conner McCleod (nimrha@hotmail.com)
Date: Mon Aug 28 2000 - 11:50:01 CDT


THIS IS MY WRITE-UP TO COWORKER'S BEEN POSTER AS A SUMMARY CREDIT & THANKS
TO ALL WHO RESPONDED:

Admins,

I believe that with Garry's help we managed to decipher the relationship
between:
/var/spool/lp/model/*
/var/spool/lp/interface/*
/var/spool/lp/interface/model.original/*
and
/opt/hpnp/sh/*

Garry was adding local printers which appear to simply copy the
/var/spool/lp/model/PRINTER_GENERIC to /var/spool/lp/interface/PRINTER_NAME.
  That appears to be a straight copy between from the generic model script
to the interface script.

This is what Ken's custom script is doing. His
SERVER1:/var/spool/lp/model/INFO.HPLJ gets copy for all local printers to
SERVER1:/var/spool/lp/interface/INFO_PRINTER_NAME. Other people on the
Internet have suggested using or copying the interface file for a custom
printer. That appears not to work for Jetdirect printers.

In the case of Jetdirect Printers, the process is a bit more complicated.
First Jetdirect invokes the generic files under /opt/honp/sh/* like
(/opt/hpnp/sh/net_ljx000). Those files have the definitions for multiple
types of printers (net_ljx000; supports LaserJet 4000, 5000, 6000 and 8000
printers). That script generates two entries one under
/var/spool/lp/interface/ and the other under
/var/spool/lp/interface/model.orig/. The file under interface appears to
have network resolution information and other configuration information.
However, it seems that it calls the file under model.orig which has the
actual commands to control the printer.

So, for Jetdirect printers there is one more level of complexity in setting
up printers. We tried modifying the files under interface and under
model.orig with out success. Matter of fact making changes to the files
under interface breaks the print queue.

Everything said, we still do not have a solution for changing the default
behavior or the printer definitions of Jetdirect printers. Fortunately,
Matt Reynolds matt@aztek-eng.com gave us a script that can be used to fix
this problem.

On SERVER2:/users/control/country.bbx we will replace lp with his script and
his options. Will use "lps", Matt's script. Instead of "lp -onb -s -djd22"
we can use "lps" Matt's scripts has to be modified to work with SERVER2.
The custom scapes can be added to his script:

echo "\033&13A\c" #legal paper
echo "\033&k2s\c" #compressed pitch
echo "\033&a2L\c" #left margin column 2
echo "\033&11O\c" #landscape mode

Here is a copy of Matt's script. I will now stop working with this issue.

Thanks to everyone that helped in this matter.

Yours,

Conner

############################################################

Thanks to:
David Evans <daevans@us.oracle.com>
Matt Reynolds <matt@aztek-eng.com>
Bill Hassell blh@rc.atl.hp.com
"Lee, Annette" <Annette_Lee@bmc.com>

David:
When using jetadmin I use the scripts in .../interface/
directory.
David (still in the US) Evans J

Bill:
The interface directory contains the generic scripts used to talk
to the network. They call the actual printer script in the
subdirectory in model.orig one level below.

Annette:
I have copied the ascii interface file to the unique printer name and
modified it accordingly with my own option strings and associated those
strings with the appropriate escape sequences. I had a pretty
voluminous interface file because I downloaded custom fonts and had options
for those fonts and various LPI, CPI etc. It really just acted as a filter.
The only problem I encountered was that some escape sequences had to be in a
certain order or they behaved badly.

Matt:
Matt sent a script that took care of my problems. With a few modifications
everything worked fine:

#!/bin/sh

#this script processes the laserprinter option (-l) and cats
multiple files

#to lp .

file=$$

if [ -z "$1" ]

then

    echo ""

    echo "usage : lps [-2abcefglmnotxyzN] file1 file2 etc. (
wildcards ok) "

    echo " -a prints in 166 x 60 mode (landscape)"

    echo " -b prints in 132 x 60 mode (landscape)"

    echo " -c prints in data mode (132 x 66)(portrait)"

    echo " -d prints 2 pages up in landscape mode "

    echo " -e prints to the HP Color Laserjet (colorj) in
the South Bridge"

    echo " -f prints to the HP 4p at the front desk"

    echo " -k prints with line numbers"

    echo " -l prints to the LaserJet 4mp (nbridge) "

    echo " -m prints to the HP 4mp downstairs (1stflr)"

    echo " -n prints to the HP IVSI (comprm)"

    echo " -o prints to the HP 4mv printer (tabloid)"

    echo " -x prints to the South suite Xerox
copier/printer"

    echo " -y prints to the Building D Xerox
copier/printer"

    echo " -z prints to the 1st floor Xerox
copier/printer"

    echo " -2 causes the IVsi to print on both sides of
the paper"

    echo " -tN defines the tabsize, where N is a number
(1-9)."

    echo ""

    exit

fi

set -- `getopt abcdefklmnoxyz2t: $*`

ct="cat"

drive=""

tabsize="0"

dup=""

set1=""

set2=""

set3=""

set4=""

dest=""

set5=""

bld=""

dest="-divsi_1"

for i in $*

do

    case $i in

    -a) set1="\033&l1O\c"; set2="\033&l8D\c"; set3="\033&k2S\c";
shift;;

    -b) set1="\033&l1O\c"; set2="\033&l8D\c";
set3="\033(s13H\c"; shift;;

    -c) set1="\033&k2S\c"; shift;;

    -d) set5="up"; shift;;

    -2) set4="\033&l1S\c"; shift;;

    -e) dest="-dhpcj_1" ; shift;;

    -f) dest="-drecppr_1" ; set1=""; set2=""; set3=""; set4="";
shift;;

    -k) ct="cat -n"; shift;;

    -l) dest="-dn4mp_1" ; shift;;

    -m) dest="-dhp4mplus_1" ; shift;;

    -n) dest="-divsi_1" ; shift;;

    -o) dest="-dhp4mv_1" ; shift;;

    -x) dest="-dlp" ; shift;;

    -y) dest="-dlp" ; bld="D"; shift;;

    -z) dest="-dlp" ; bld="1"; shift;;

    -t) tabsize=$2; shift 2;;

    --) shift; break;;

    esac

done

echo "$set1\c" > /tmp/$file

echo "$set2\c" >>/tmp/$file

echo "$set3\c" >> /tmp/$file

echo "$set4\c" >> /tmp/$file

if [ "$set5" ]

then

        if [ "$bld" != "D" ]

                then

                        if [ "$bld" != "1" ]

                                then

                                        $ct $* | /usr/openwin/bin/mp -l -s
$* | lp $dest; exit 0

                                else

                                        $ct $* | /usr/openwin/bin/mp -l -s
$* | rsh bkup lp $dest;
exit 0

                        fi

                else

                                        $ct $* | /usr/openwin/bin/mp -l -s
$* | rsh mash lp $dest;
exit 0

        fi

else

        if [ "$dest" != "-dlp" ]

                then

        $ct $* >>/tmp/$file

        else

                $ct $* | unix2dos -437 >>/tmp/$file

        fi

fi

if [ "$bld" != "D" ]

        then

                if [ "$bld" != "1" ]

                        then

                                /bin/sed -e '1s/.&l1S%!\(.*\)/%!\1\

                                statusdict begin\

                                true setduplexmode\

                                statusdict end\

                                /' /tmp/$file | lp $dest

                        else

                                /bin/sed -e '1s/.&l1S%!\(.*\)/%!\1\

                                statusdict begin\

                                true setduplexmode\

                                statusdict end\

                                /' /tmp/$file | rsh bkup lp $dest

                fi

        else

                                /bin/sed -e '1s/.&l1S%!\(.*\)/%!\1\

                                statusdict begin\

                                true setduplexmode\

                                statusdict end\

                                /' /tmp/$file | rsh mash lp $dest

fi

if [ "$set5" ]

then

        exit 0

else

rm /tmp/$file

fi

exit 0

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.

S
U BEFORE POSTING please READ the FAQ located at
N ftp://ftp.cs.toronto.edu/pub/jdd/sun-managers/faq
. and the list POLICY statement located at
M ftp://ftp.cs.toronto.edu/pub/jdd/sun-managers/policy
A To submit questions/summaries to this list send your email message to:
N sun-managers@ececs.uc.edu
A To unsubscribe from this list please send an email message to:
G majordomo@sunmanagers.ececs.uc.edu
E and in the BODY type:
R unsubscribe sun-managers
S Or
. unsubscribe sun-managers original@subscription.address
L To view an archive of this list please visit:
I http://www.latech.edu/sunman.html
S
T



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:14:15 CDT