RIMAS for UNIX
Software Installation
To: All Users of SCO Open Server UNIX Operating System
From: The SHARED LOGIC Group, Inc.
Re: Controlling HP LaserJet Printers
Date: April 28, 2000
Users
of SCO OpenServer 5 can install and control HP LaserJet printers by following
this procedure:
1.
Use
the SCO Printer Administration facility to define the printer to the UNIX
operating system. While most of the
steps required to do this are beyond the scope of this document, two entries
made during this process will be used in subsequent points in this procedure:
The name that you assign to
the printer. This memo will assume that
you named it “Laser”, but you may use any name you prefer.
Each printer is associated with a printer model. A printer model is, essentially, a computer program that
correlates features, such as “portrait”, with the codes the printer must
receive to activate that feature. It is
important that you select a printer model that defines the features of your
printer. This memo is based on use of
the “HPLaserJet” model.
2.
Shared
Logic has adopted the convention of naming all printer devices “LPTxxxxxxxxxx”,
where you may substitute 1 to 10 characters for the x’s. For example, “LPT1”, “LPTMAINOFFICE” and
“LPTHP” are all valid printer names.
There are two ways to send data to your printer. Data may be sent directly to the printer device, but this method
is not used when you want to control a laser printer’s features. The second method is to use the UNIX spooler
to send data to the printer, and this procedure is based on this method.
To send data to the UNIX spooler, you must create a script (which is similar to
a DOS batch file) in the /dev directory with the name you want to use for the
printer in Shared Logic programs. For
example, a script named “LPTL” containing the following lines will allow you to
output Shared Logic reports to a printer named “Laser” in step 1 above:
trap “” 1 2 3
rm –f /tmp/LPTL..LOCK
lp –d Laser >/dev/null
Remember that scripts must
be given execute permission.
However, this basic script
must be expanded to include the features of your laser printer you want to use
to control the appearance of your reports.
Features that are defined in the HPLaserJet model that are commonly used
are:
10, pica either specifies 10 characters/inch
12, elite either specifies 12 characters/inch
c specifies compressed (about 17 characters/inch)
fp# set primary font pitch to #
fs set primary font to fixed spacing
lpi# set number of lines/inch to #
vsi# set vertical spacing increment to #/48’s inch
lm# set left margin in column #
rm# set right margin in column #
portrait use portrait orientation
landscape use landscape orientation
nb do not print banner page
double automatic
double sided (duplex) print
ub, ubin feed paper from the upper cassette
lb, lbin feed paper from the lower cassette
These features are specified
on the third line of the script. For
example to print in landscape mode with the print line a little closer together
so that the report does not run over the end of the page, you would use the
following:
lp –o vsi7,landscape –d Laser >/dev/null
The “-o” indicates that the
options (features) will be listed in the command line.
A commonly used set of
options is written as follows:
lp –o fp20,vsi7,lm10,portrait,nb,double,lbbin –d Laser
>/dev/null
Any logical combination of
supported features may listed (separated by commas) after the
“-o” in the command line.
Multiple scripts may be set
up for the same printer, where each script specifies a set of features. For example,
LPTHPC (‘H’P laser, ‘P’ortrait, ‘C’ondensed font) could
include “-o c,portrait”
LPTHL2D (‘H’P laser,
‘L’andscape, ‘2’0cpi, “D”uplex) could include
“-o fp20,landscape,double”
Many combinations are possible, and the information provided above should make it possible for you to create an initial set of scripts for your laser printer, and to add more as the need arises.