Information Technology Reference
In-Depth Information
Print Models
A
print model
is a script that defines how the LP Print Service interfaces with
the printers. The print model is responsible for initializing the printer port
and the printer based on information provided by the terminfo database,
printing a banner page and multiple copies if requested.
Generic print models are provided with the Solaris operating system. To
make full use of printer capability, a model might be provided with the print-
er, or a custom model can be written. The default print model for a local
printer is
/etc/lp/model/standard
, and the default model for a remote
printer is
/etc/lp/model/netstandard
.
The terminfo Database
The characteristics of both terminals and printers are defined in a database
referred to as the
terminfo
database. Characteristics include control sequences
that switch between typefaces (bold, underline, and so on) and other function-
ality, such as cursor/print head positioning. Using the name of a terminal or
printer, applications can look up the characteristics of a printer or terminal and
issue the appropriate commands to initialize and control its operation.
If the terminfo name of a printer is known, the
infocmp(1M)
command can be
used to display the terminfo entry for that printer. The following listing shows
how the
infocmp
command is used to display the
hplaser terminfo
entry:
$ infocmp hplaser
hplaserjet|hplaser|HP Laserjet I,
bitwin#1, bitype#2, cols#80, lines#60, npins#8,
orc#12, orhi#120, orl#8, orvi#48, spinh#300,
spinv#300,
chr=%?%p1%{0}%>%p1%{127}%<%t\E&k%p1%dH%;,
cpi=%?%p1%{10}%=%t\E&k0S%e%p1%{17}%=%t\E&k2S%;, cr=\r,
cud=\E&a+%p1%dR, cud1=\n, cuf=\E&a+%p1%dC, cuf1=\s,
cvr=%?%p1%{0}%>%p1%{127}%<%t\E&l%p1%dC%;,
endbi=\E*rB, ff=\f, hpa=\E&a%p1%dC, is2=\EE\E&k2G,
mgc=\E9, porder=1\,2\,3\,4\,5\,6\,7\,8;0, ritm=\E(s0S,
rmul=\E&d@, sbim=\E*b%p1%dW, sitm=\E(s1S,
slines=\E&l%p1P, smgbp=\E&l%p1%{1}%+%dF,
smglp=\E&a%p1%dL, smgrp=\E&a%p1%dM,
smgtp=\E&l%p1%{1}%+%dE, smul=\E&dD, u9=\E&l%p1P,
vpa=\E&a%p1%dR,
$
If the terminfo name for a printer is not known, examine the subdirectories under
/usr/share/lib/terminfo
. Entries for terminals/printers are stored in separate files under
one or two levels of subdirectories. For example, the terminfo entry for a Hewlett-
Packard (HP) LaserJet printer is stored in the
/usr/share/lib/terminfo/h/hplaserjet
file.