IBM Printer and Printing
IBM Printer and Printing
IBM Printer and Printing
SC23-4897-03
SC23-4897-03
Note
Before using this information and the product it supports, read the information in Notices on page 239.
Contents
About this document . . . . . . . . . v
Highlighting . . . .
Case-sensitivity in AIX .
ISO 9000. . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. v
. v
. v
iii
iv
135
136
136
137
137
137
138
138
139
139
139
139
140
140
140
141
141
141
141
141
142
144
145
146
147
147
147
147
150
151
152
154
156
157
159
160
161
163
166
167
169
170
172
175
176
176
177
177
177
177
182
183
183
183
184
188
189
190
190
190
191
192
192
203
217
223
224
224
225
225
225
226
229
230
231
232
232
233
234
234
235
Notices . . . . . . . . . . . . . . 239
Trademarks .
. 240
Index . . . . . . . . . . . . . . . 241
Highlighting
The following highlighting conventions are used in this book:
Bold
Identifies commands, subroutines, keywords, files, structures, directories, and other items whose names are
predefined by the system. Also identifies graphical objects such as buttons, labels, and icons that the user
selects.
Italics
Identifies parameters whose actual names or values are to be supplied by the user.
Monospace
Identifies examples of specific data values, examples of text similar to what you might see displayed,
examples of portions of program code similar to what you might write as a programmer, messages from
the system, or information you should actually type.
Case-sensitivity in AIX
Everything in the AIX operating system is case-sensitive, which means that it distinguishes between
uppercase and lowercase letters. For example, you can use the ls command to list files. If you type LS, the
system responds that the command is not found. Likewise, FILEA, FiLea, and filea are three distinct file
names, even if they reside in the same directory. To avoid causing undesirable actions to be performed,
always ensure that you use the correct case.
ISO 9000
ISO 9000 registered quality systems were used in the development and manufacturing of this product.
vi
v Priority level
Use the qprt command to create and queue a print job to print the file you specify. If you specify more
than one file, all the files together make up one print job. These files are printed in the order specified on
the command line.
The basic format of the qprt command is:
qprt -PQueueName FileName
Specifies the bottom margin. The bottom margin is the number of blank lines to be left at
the bottom of each page.
-B Value
-e Option
-E Option
Always prints the (header or trailer) page for each file in each print job.
Prints the (header or trailer) page once for each print job (group of files). For
example, the -B ga flag specifies that a header page be printed at the beginning
of each print job and that a trailer page be printed after each file in each print
job.
In a remote print environment, the default is determined by the remote
queue on the server.
-f FilterType
A one-character identifier that specifies a filter through which your print file or files are
to be passed before being sent to the printer. The available filter identifiers are p, which
invokes the pr filter, and n, which processes output from the troff command.
-i Number
Causes each line to be indented the specified number of spaces. The Number variable
must be included in the page width specified by the -w flag.
-K Option
-l Number
Sets the page length to the specified number of lines. If the Number variable is 0, the page
length is ignored, and the output is considered to be one continuous page. The page
length includes the top and bottom margins and indicates the printable length of the
paper.
-L Option
Specifies whether lines wider than the page width should be wrapped to the next line or
truncated at the right margin.
+
Indicates that long lines should not wrap but instead should be truncated at the
right margin.
-N Number
Specifies the number of copies to be printed. If this flag is not specified, one copy is
printed.
-p Number
Sets the pitch to Number characters per inch. Typical values for Number are 10 and 12. The
actual pitch of the characters printed is also affected by the values for the -K (condensed)
flag and the -W (double-wide) flag.
-P Queue[:QueueDevice]
Specifies the print queue name and the optional queue device name. If this flag is not
specified, the default printer is assumed.
-Q Value
Specifies paper size for the print job. The Value for paper size is printer-dependent.
Typical values are 1 for letter-size paper, 2 for legal, and so on. Consult your printer
manual for the values assigned to specific paper sizes.
-t Number
Specifies the top margin. The top margin is the number of blank lines to be left at the top
of each page.
-w Number
Sets the page width to the number of characters specified by the Number variable. The
page width must include the number of indention spaces specified with the -i flag.
-W Option
-z Value
-# Value
Rotates page printer output the number of quarter-turns clockwise as specified by the
Value variable. The length (-l) and width (-w) values are automatically adjusted
accordingly.
0
Portrait
Landscape right
Portrait upside-down
Landscape left
Queues the print job, but puts it in the HELD state until it is released again.
Validates the specified printer backend flag values. This validation is useful in
checking for illegal flag values at the time of submitting a print job. If the
validation is not specified, an incorrect flag value will stop the print job later
when the job is actually being processed.
The following list contains examples of how to use the qprt command flags:
v To request that the myfile file be printed on the first available printer configured for the default print
queue using default values, type:
qprt myfile
v To request that the myfile file be printed on a specific queue using specific flag values and to validate
the flag values at the time of print job submission, type:
qprt -f p -e + -Pfastest -# v myfile
This passes the myfile file through the pr filter command (the -f p flag) and prints it using emphasized
mode (the -e + flag) on the first available printer configured for the queue named fastest (the -Pfastest
flag).
v To print the myfile file on legal-size paper, type:
qprt -Q2 myfile
v To print three copies of each of the new.index.c, print.index.c, and more.c files at the print queue
Msp1, type:
qprt -PMsp1 -N 3 new.index.c print.index.c more.c
v To print three copies of the concatenation of three files, new.index.c, print.index.c, and more.c, type:
cat new.index.c print.index.c more.c | qprt -PMsp1 -N 3
Note: The base operating system also supports the BSD UNIX print command (lpr) and the System V
UNIX print command (lp). For the complete syntaxes, see the lpr and lp commands in the AIX 5L
Version 5.3 Commands Reference.
For the complete syntax, see the qprt command in the AIX 5L Version 5.3 Commands Reference.
Printers and Printing
You can also use SMIT to request a print job. To start a print job using SMIT, type:
smit qprt
For the complete syntax, see the qcan command in the AIX 5L Version 5.3 Commands Reference.
The following list contains examples of how to use the qcan command:
v To cancel job number 123 on whichever printer the job is on, type: qcan -x 123
v To cancel all jobs queued on printer lp0, type: qcan -X -Plp0
Note: The base operating system also supports the BSD UNIX cancel print command (lprm) and the
System V UNIX cancel print command (cancel). For the complete syntaxes, see the lprm and cancel
commands in the AIX 5L Version 5.3 Commands Reference.
2. In the Printer Queues window, select the print job, and then use the menus to cancel the print job
from a print queue.
For the complete syntax, see the qpri command in the AIX 5L Version 5.3 Commands Reference.
The following list contains examples of how to use the qpri command:
v To change job number 123 to priority number 18, type:
qpri -# 123 -a 18
You can move a print job with one of the following commands:
v qmov -m DestinationQueue -# JobNumber
v qmov -m DestinationQueue -P Queue
v qmov -m DestinationQueue -u User
For the complete syntax, see the qmov command in the AIX 5L Version 5.3 Commands Reference.
The following list contains examples of how to use the qmov command:
v To move all print jobs on print queue hp4D to print queue hp2, type:
qmov -mhp2 -Php4D
Note: The base operating system also supports the BSD UNIX check print queue command (lpq) and the
System V UNIX check print queue command (lpstat). For the complete syntaxes, see the lpq and lpstat
commands in the AIX 5L Version 5.3 Commands Reference.
The following list contains examples of how to use the qchk command:
v To display the default print queue, type:
qchk -q
v To display the long status of all queues until empty, while updating the screen every 5 seconds, type:
qchk -A -L -w 5
qchk -A
Indicates that:
v More than one queue is defined to a printer device (lp0) and another queue is currently using the printer
device.
v qdaemon attempted to use the printer port device (lp0), but another application is currently using that printer
device
To recover from a DEV_BUSY, wait until the queue or application has released the printer device, or cancel the
job or process that is using the printer port.
DEV_WAIT
Indicates that the queue is waiting on the printer because the printer is offline, out of paper, jammed, or the
cable is loose, bad, or wired incorrectly.
To recover from a DEV_WAIT, correct the problem that caused it to wait. It might be easier for diagnostic
testing to use the enq command to move all queued jobs from the DEV_WAIT queue to another queue that is
either printing or is DOWN. After the problem is corrected, you can move any unprinted job back to the original
queue.
DOWN
A queue usually goes into a DOWN state after it has been in the DEV_WAIT state. This situation occurs when
the printer device driver cannot tell if the printer is there because of absence of correct signaling. However, some
printers might not have the capability to signal the queuing system that they are offline, and they instead send
signals that they are off. If the printer device signals or appears to be off, the queue will go into the DOWN
state.
To recover from a DOWN state, correct the problem that brought the queue down and have the system
administrator bring the queue back up. The queue must be manually brought up before it can be used again.
HELD
Specifies that a print job is held. The print job cannot be processed by the spooler until it is released.
QUEUED
READY
Specifies that everything involved with the queue is ready to queue and print a job.
RUNNING
DEV_BUSY
Indicates that:
v More than one queue is defined to a printer device (lp0) and another queue is currently using the printer
device.
v qdaemon attempted to use the printer port device (lp0), but another application is currently using that printer
device
To recover from a DEV_BUSY, wait until the queue or application has released the printer device, or cancel the
job or process that is using the printer port.
DEV_WAIT
Indicates that the queue is waiting on the printer because the printer is offline, out of paper, jammed, or the
cable is loose, bad, or wired incorrectly.
To recover from a DEV_WAIT, correct the problem that caused it to wait. It might be easier for diagnostic
testing to use the enq command to move all queued jobs from the DEV_WAIT queue to another queue that is
either printing or is DOWN. After the problem is corrected, you can move any unprinted job back to the original
queue.
DOWN
A queue usually goes into a DOWN state after it has been in the DEV_WAIT state. This situation occurs when
the printer device driver cannot tell if the printer is there because of absence of correct signaling. However, some
printers might not have the capability to signal the queuing system that they are offline, and they instead send
signals that they are off. If the printer device signals or appears to be off, the queue will go into the DOWN
state.
To recover from a DOWN state, correct the problem that brought the queue down and have the system
administrator bring the queue back up. The queue must be manually brought up before it can be used again.
HELD
Specifies that a print job is held. The print job cannot be processed by the spooler until it is released.
QUEUED
READY
Specifies that everything involved with the queue is ready to queue and print a job.
RUNNING
10
DEV_BUSY
Indicates that:
v More than one queue is defined to a printer device (lp0) and another queue is currently using the printer
device.
v qdaemon attempted to use the printer port device (lp0), but another application is currently using that printer
device
To recover from a DEV_BUSY, wait until the queue or application has released the printer device, or cancel the
job or process that is using the printer port.
DEV_WAIT
Indicates that the queue is waiting on the printer because the printer is offline, out of paper, jammed, or the
cable is loose, bad, or wired incorrectly.
To recover from a DEV_WAIT, correct the problem that caused it to wait. It might be easier for diagnostic
testing to use the enq command to move all queued jobs from the DEV_WAIT queue to another queue that is
either printing or is DOWN. After the problem is corrected, you can move any unprinted job back to the original
queue.
DOWN
A queue usually goes into a DOWN state after it has been in the DEV_WAIT state. This situation occurs when
the printer device driver cannot tell if the printer is there because of absence of correct signaling. However, some
printers might not have the capability to signal the queuing system that they are offline, and they instead send
signals that they are off. If the printer device signals or appears to be off, the queue will go into the DOWN
state.
To recover from a DOWN state, correct the problem that brought the queue down and have the system
administrator bring the queue back up. The queue must be manually brought up before it can be used again.
HELD
Specifies that a print job is held. The print job cannot be processed by the spooler until it is released.
QUEUED
READY
Specifies that everything involved with the queue is ready to queue and print a job.
RUNNING
-h String
Displays the specified string, enclosed in quotes (" "), instead of the file name as the page header.
Separate the flag and string by a space.
-l Lines
Overrides the 66-line default and resets the page length to the number of lines specified by the Lines
variable. If the Lines value is smaller than the sum of both the header and trailer depths (in lines), the
header and trailer are suppressed (as if the -t flag were in effect).
-m
Merges files. Standard output is formatted so the pr command writes one line from each file specified by
a File variable, side by side into text columns of equal fixed widths, based on the number of column
positions. This flag should not be used with the -Column flag.
-n [Width][Character]
Provides line numbering based on the number of digits specified by the Width variable. The default is 5
digits. If the Character (any nondigit character) variable is specified, it is appended to the line number to
separate it from what follows on the line. The default character separator is the ASCII Tab character.
-o Offset
Indents each line by the number of character positions specified by the Offset variable. The total number
of character positions per line is the sum of the width and offset. The default value of Offset is 0.
-s Character
Separates columns by the single character specified by the Character variable instead of by the appropriate
number of spaces. The default value for Character is an ASCII Tab character.
11
-t
Does not display the five-line identifying header and the five-line footer. Stops after the last line of each
file without spacing to the end of the page.
-w Width
Sets the number of column positions per line to the value specified by the Width variable. The default
value is 72 for equal-width multicolumn output. There is no limit otherwise. If the -w flag is not specified
and the -s flag is specified, the default width is 512 column positions.
-Column
Sets the number of columns to the value specified by the Column variable. The default value is 1. Do not
use this option with the -m flag. The -e and -i flags are assumed for multicolumn output. A text column
should never exceed the length of the page (see the -l flag). When this flag is used with the -t flag, use the
minimum number of lines to write the output.
+Page
Begins the display with the page number specified by the Page variable. The default value is 1.
For the complete syntax, see the pr command in in AIX 5L Version 5.3 Commands Reference.
The following is a list of examples of how pr command flags can be used:
v To print a file named prog.c with headings and page numbers on the printer, type:
pr prog.c | qprt
This command adds page headings to prog.c and sends it to the qprt command. The heading consists
of the date the file was last modified, the file name, and the page number.
v To specify a title for a file named prog.c, type:
pr -h "MAIN PROGRAM" prog.c | qprt
This prints prog.c with the title MAIN PROGRAM in place of the file name. The modification date and
page number are still printed.
v To print a file named word.lst in multiple columns, type:
pr -3 word.lst | qprt
This prints member.lst and visitor.lst side by side with the title Members and Visitors.
v To modify a file named prog.c for later use, type:
pr -t -e prog.c > prog.notab.c
This command replaces tab characters in prog.c with spaces and puts the result in prog.notab.c. Tab
positions are at columns 9, 17, 25, 33, and so on. The -e flag tells the pr command to replace the tab
characters; the -t flag suppresses the page headings.
v To print a file named myfile in two columns, in landscape, and in 7-point text, type:
pr -l66 -w172 -2 myfile | qprt -z1 -p7
12
-1+
-2+
-3+
Prints the page headings, dates, and page numbers in a fancy style. This is sometimes referred to as gaudy
mode.
-4+
-5+
-h string
Specifies a string to be used for page headings. If this flag is not specified, the heading consists of the file
name, modification date, and page number.
-l value
Specifies the maximum number of lines printed per page. Depending on the point size, fewer lines per page
might actually be displayed.
-L!
-p
Specifies the point size. If this flag is not specified, a point size of 10 is assumed, unless two-column rotated
mode (-2+ -z1) is specified, in which case a value of 7 is used.
-s
Specifies the font style. If this flag is not specified, the Courier font is used. The PostScript printer must have
access to the specified font. Acceptable values are:
Courier-Oblique
Helvetica
Helvetica-Oblique
Helvetica-Narrow
Helvetica-Narrow-Oblique
NewCenturySchlbk-Italic
Optima
Optima-Oblique
Palatino-Roman
Palatino-Italic
Times-Roman
Times-Italic
-z1
The following list contains examples of how these qrpt command flags can be used:
v To send the ACSII file myfile.ascii to the PostScript printer named Msps1, type:
qprt -da -PMsps1 myfile.ascii
v To send the ACSII file myfile.ascii to the PostScript printer named Msps1 and print out in the
Helvetica font, type:
qprt -da -PMsps1 -sHelvetica myfile.ascii
v To send the ASCII file myfile.ascii to the PostScript printer named Msps1 and print out in the point
size 9, type:
qprt -da -PMsps1 -p9 myfile.ascii
13
2. Type the PostScript queue name, or use the List feature to select from a list of queues.
3. Select the Printer Setup menu option.
4. Change the value of AUTOMATIC detection of print file TYPE to be done? field to yes.
Any of the following commands now convert an ASCII file to a PostScript file and print it on a PostScript
printer. To convert myfile.ascii, type any of the following at the command line:
qprt -Pps myfile.ps myfile.ascii
lpr -Pps myfile.ps myfile.ascii
lp -dps myfile.ps myfile.acsii
v To print the source listing of a PostScript file named myfile.ps that begins with %!, type the following
command:
qprt -da -Pps myfile.ps
lp
lpq
lpr
lprm
lpstat
pr
qcan
qchk
qhld
qmov
qpri
qprt
Printing administration
When working with printers, system administrators must manage a spooler, real printers, virtual printers,
backends, and queues, which are all parts of the printer subsystem.
The system management information associated with printers includes:
14
Printing processes
When you print a file, the system sends codes to the printer. Some codes print specific characters, such as
specific alphabetic or numeric characters. Other codes control how characters or files are printed, such as
by underscoring certain characteristics or by adjusting the page length.
If you want to send different character codes to the printer, such as changing the word that to this, you
do not have to understand the underlying codes; you merely edit the file.
To alter the way a printer works, however, you must understand what happens when you print a file,
which options you have for sending control information to the printer, and which printer characteristics
you can control.
You can use the Web-based System Manager (type wsm, and then select Printers), the System Manager
Interface Tool (SMIT), or the qprt command to send a file to a printer. In addition, you can use the
Web-based System Manager or SMIT to cancel or prioritize a print job.
Whichever method you use to print, a file never goes directly to the printer. All three methods first must
call the enq command to place the print request in a queue. The print request stays in the queue until a
printer becomes available, at which point the qdaemon command runs the (printer input/output
backend) piobe command. The piobe command processes the file and sends it, along with control
information, to the printer. The printer then receives a data stream containing the contents of the file and
the control information specified with the qprt command.
The flag on the command line overrides the standard qprt command setting for this job. The standard
qprt command pitch setting remains 10.
v Change the standard qprt command settings.
Printers and Printing
15
The Web-based System Manager (type wsm, and then select Printers) allows you to change or show the
print queue characteristics of a printer. You can also use SMIT or the lsvirprt command.
Note: You must have root authority or be a member of the printq group.
For example, to change the standard pitch to 12 characters per inch, run the Web-based System
Manager (type wsm, and then select Devices.), the chvirprt command, or SMIT. Select the printer from
the list displayed and type the attribute name and value, separated by the equal sign (=).
The attribute names for the qprt command flags are the flag letters. You can change the standard pitch
to 12 by specifying p=12.
16
To view a list of print queues and their associated virtual printers, use the Web-based System Manager
(type wsm, and then select Printers), the SMIT List All Print Queues option, or the lsvirprt command.
17
18
where:
QueueName
FileName
See the individual queuing commands for additional flags that can be specified.
19
You might need to use the -a flag several times to fully configure a print queue device.
At the NAME of Queue to Add prompt, type: plta to define serial port a.
At the NAME of Device to Add prompt, type: plota to define serial port a.
For BACKEND PROGRAM Pathname, type: /usr/lib/lpd/plotgbe -gswa 9600.
At the NAME of Queue to Add prompt, type:
pltb
Each line must be entered with no spaces, ESC has the ASCII value 27. The . (period) is part of the
command.
20
21
Extended ASCII
Hewlett-Packard LaserJet
Plotter
PostScript
Diablo 630
Texas Instruments 855 dot matrix printer in dp mode
2. After you have identified the data stream used by your printer, select either a supported printer that
uses the same data stream or one of the generic printers, and customize the definition for your
printer.
22
1. If you use FG as a cable shield, make sure that it is connected only at one end. It makes no difference
which end is connected. This provides an efficient shield against electrical noise.
2. If your RTS signal is used to supply voltage to CTS on the printer port, check to see what your
printer does with its RTS signal.
Although RTS and CTS data pacing is not supported on serial printers, the device driver will block
the open of the printer port until the voltage of CTS becomes high. The CTS signal is usually supplied
by the RTS signal from the printer. However, some printers use the RTS signal for data pacing. These
printers drop RTS when they want the system to stop sending data. Because the queuing system
always needs the port opened to check for status, if the printer drops the RTS signal, the port closes
and the queue goes down.
3. Some printers require that you raise the voltage of DCD and DSR or CTS on the printer side. If your
printer requires that these voltages be raised, use one of the following methods for raising the voltage:
a. Use DTR or RTS on the computer side to supply the voltage.
OR
b. Obtain the voltage from the printer side.
23
5. Configure a virtual printer and print queue. See Configuring a virtual printer and print queue on
page 25.
6. Establish a queue for a modem line. See Configuring a queue for modem connections on page 25.
Installing a physical ASCII terminal:
Before you can use a physical ASCII terminal, you must install the terminal.
You should perform the following steps to install a physical ASCII terminal:
1. Review all relevant installation planning information and the terminals documentation to ensure that
you have the components required for installation.
2. Review your systems configuration, and select the serial port.
3. Ensure that the communications port is not in use.
4. Connect the terminal to the serial communications port. Be sure to use proper cabling. Consult your
documentation for cabling instructions.
5. Configure the terminal according to the documentation provided with it. Be sure to record the settings
you choose for baud rate, stop bits, bits per character, and flow control. You need this information to
configure the base operating system tty device driver.
Configuring the terminal device driver (tty):
You must configure the terminal device driver (tty) before you can use the associated terminal.
To configure the tty:
1. Log in as the root user.
2. At the system prompt, type:
Devices
3. In the Web-based System Manager Devices window, use the menus to complete the steps that
configure the terminal device driver.
4. Select the Add a TTY option and the tty type.
5. Provide additional information as prompted, such as the configuration settings you made on your
terminal at installation. If you are not sure of the port number IDs, press the F4 key to display a list
of available IDs. Be sure to enter the correct TERMINAL type. When you have entered all of the
configuration information, press Enter.
You can also perform this task with the SMIT fast path smit tty.
Verifying terminal output:
After a terminal device has been configured, you should verify that the terminal is working.
Use the following command to verify that the terminal is working and to send output directly to the
terminal screen:
cat /etc/qconfig > /dev/ttynn
where nn is the appropriate tty device number. The contents of the /etc/qconfig file should appear on
the terminal screen.
Installing a physical printer:
Before you can use a physical printer, you must install the printer.
Perform the following steps to install a physical printer.
24
1. Review all relevant installation planning information and the printers documentation to ensure that
you have the required components and information to install the printer.
2. Review the terminal documentation for information on connecting printers to the auxiliary (AUX)
port.
3. Verify that the AUX port on the terminal is configured with the same settings as your printer, such as
baud rate, parity, data bits, stop bits, and XON/XOFF.
v For information about setting values for the AUX port, consult your terminal documentation.
v For information about configuring the printers serial interface, consult your printer documentation.
4. Connect the printer to the terminals AUX port. Be sure to use the proper cabling. Consult your
documentation for cabling instructions.
Configuring a virtual printer and print queue:
Before you can use a virtual printer and print queue, you must configure the virtual printer and print
queue.
To configure your terminal-attached printer into the print spooling subsystem:
1. At the system prompt, type:
Devices
2. In the Web-based System Manager Devices window, use the menus to complete the steps that
configure a virtual printer and print queue.
3. Select the ascii attachment type, manufacturer, and printer model.
4. Provide additional information as prompted.
You can also perform this procedure with the piomkpq command or with the SMIT fast path smit mkpq.
Configuring a queue for modem connections:
You can configure a queue for modem connections.
Terminal-attached printing can also be supported by establishing a queue for a modem line instead of
creating the queue for a specific terminal. Because the terminal type of a dial-in terminal cannot be
guaranteed, set the PIOTERM environment variable to the terminal type of the dial-in terminal by typing
the following command:
export PIOTERM=Dialin-Terminal-Type
25
IBM
IBM
IBM
IBM
IBM
2390
2391
2380
2381
2390
Personal
Personal
Personal
Personal
Personal
Printer
Printer
Printer
Printer
Printer
II
II
II (Model 2)
II (Model 2)
II (Model 2)
IBM
IBM
IBM
IBM
IBM
26
IBM
IBM
IBM
IBM
IBM
InfoPrint
Network
Network
Network
Network
40 Printer
Color Printer
Printer 12
Printer 17
Printer 24
Hewlett-Packard
Hewlett-Packard
Hewlett-Packard
Hewlett Packard
Hewlett-Packard
Hewlett Packard
Hewlett Packard
Hewlett Packard
Hewlett-Packard
Hewlett Packard
Hewlett Packard
Hewlett-Packard
Hewlett-Packard
LaserJet
LaserJet
LaserJet
LaserJet
LaserJet
LaserJet
4V
5000 D640 Printer
5Si/5Si MX
5Si Mopier
8000 Printer
8100 Printer
Lexmark
Lexmark
Lexmark
Lexmark
Optra
Optra
Optra
Optra
LaserPrinter
E310 LaserPrinter
M410 LaserPrinter
Se LaserPrinter
Lexmark
Lexmark
Lexmark
Lexmark
Lexmark
27
128-port controller
Third-party controller
Note: Third-party asynchronous controllers are also supported. When the base operating system
detects that an ASCII terminal was configured with a third-party controller, the terminal-attached
printer is configured as though it was connected to the native port controller. For more information,
see Native, 8-port, 16-port, and third-party controllers on page 29.
For more information about certain Lexmark printers in the preceding list, see the following sections:
v IBM InfoPrint 40 Printer on page 146
v Lexmark Optra E310 Laser Printer on page 166
v Lexmark Optra M410 Laser Printer on page 167
v Lexmark Optra Se Laser Printer on page 169
v Lexmark Optra T Laser Printer Family on page 170
v Lexmark Optra W810 Laser Printer on page 172
terminfo database
The print service relies on the standard interface script and the terminfo database to initialize each
printer and set up a selected page size, character pitch, line pitch, and character set.
Thus, it is usually sufficient to have the correct entry in the terminfo database (/usr/lib/terminfo/
terminfo.lp) to add a new printer to the print service.
The terminfo database identifies each printer by a short name, identical to the kind of name used to set
the TERM shell variable. For example, the name in the terminfo database for the AT&T model 455
printer is 455.
To specify the terminfo type for your printer, use the -T option of the lpadmin command. By default, the
terminfo database includes entries for many popular printers. Select the terminfo type that corresponds
to your printer.
If terminfo does not include an entry for your printer, you might still be able to use the printer with the
print service. However, you will not be able to use automatic selection of page size, pitch, and character
sets, and you might have trouble keeping the printer set to the correct modes for each print request or
using printer forms with the printer. In this case, you can either add an entry to terminfo (Adding a
printer entry to the terminfo database on page 188) for your printer or create a customized interface
program (Creating printer interface scripts on page 185) to use with the printer.
You can define hundreds of items for each terminal or printer in the terminfo database. However, the
print service uses fewer than 50 of these, and most printers need even less than that. You can check items
defined for a specific terminfo entry by entering the following command:
infocmp terminfo_name
28
The virtual printer database is a series of files that describe the way print requests should be processed,
such as the data stream to be delivered to the printer. User-configurable attributes specific to
terminal-attached printers are defined in the virtual printer database and are based upon the
asynchronous communications adapter being used.
The virtual printer attributes are defined when the virtual printer is configured. The naming convention
for attributes unique to terminal-attached printers is yN, where N is an integer greater than or equal
to 0. The value of y0 is reserved. It designates that the virtual printer queue is configured for a
terminal-attached printer and contains the hardware line discipline for the terminal port. The sections
that follow detail the adapter-specific virtual printer attributes for terminal-attached printers.
To change the attribute values on an existing virtual printer, use the Web-based System Manager
Devices fast path. You can also use the smit ps_lsvirprt fast path command.
64-port controller
The 64-port controller provides hardware support for terminal-attached printers.
The 64-port controller has the following virtual printer attribute:
y1
Sets the priority with which printing will be done over terminal activity. The larger the number, the greater the priority the
printer has over the terminal.
128-port controller
The 128-port controller also provides hardware support for terminal-attached printers.
The 128-port controller has the following virtual printer attributes:
29
y1
y2
y3
Sets the maximum characters per second (CPS) rate at which characters are sent to the print device. The rate should be just
below the average print speed for your printer. Consult your printers documentation for print speed.
Sets the maximum number of print characters the device driver places in the output queue. Reducing this number increases
system overhead. Increasing this number delays operator keystroke echo times when the terminal-attached printer is in use.
Sets the device driver estimate of the size of the terminal-attached printers input buffer. After a period of inactivity, the
driver bursts the designated number of characters to the printer. Consult your printers documentation for input buffer size.
30
To start a queue:
1. At the system prompt, type wsm, and then select Printers.
2. In the Web-based System Manager Printer Queues window, select the queue or device that you want
to start.
3. Select Start all Devices for Queue to start a queue. Select Start a Specific Device to start a device.
You can also perform this task with the following commands:
smit qstart
OR
qadm -U QueueName
To stop a queue:
1. At the system prompt, type wsm, and then select Printers.
2. In the Web-based System Manager Printer Queues window, select the queue or device that you want
to stop.
3. Select Stop all Devices for Queue to stop a queue. Select Stop a Specific Device to stop a device.
You can also perform this task with the following commands:
smit qstop
OR
qadm -D QueueName
This command displays a list of all the print jobs you have scheduled. If you have root user authority,
the command lists all currently scheduled print jobs.
v To schedule print jobs:
1. Type the following command at the system prompt:
smit sjat
Printers and Printing
31
2.
3.
v To
1.
32
33
bull1021
parallel Bull Compuprint Page Master 1021
.
.
.
ibm2380
parallel IBM 2380 Personal Printer II
ibm2380
rs232
IBM 2380 Personal Printer II
ibm2380
rs422
IBM 2380 Personal Printer II
.
.
.
opp
parallel Other parallel printer
osp
rs232
Other serial printer
osp
rs422
Other serial printer
Available
Available
Available
00-04-01-06
00-04-01-07
00-00-0P-00
Deleting printers
You can remove a printer from the system.
v A printer must have been added. See Configuring a printer without adding a queue (SMIT) on page
19 and Configuring a printer without adding a queue (qprt command) on page 19.
v You must have root authority.
Deleting a printer does not remove any print queues that send print jobs to that printer. If you want to
also delete the print queues, see Deleting a print queue on page 32.
34
To
1.
2.
3.
You can also perform this task with the SMIT fast path smit rmprt.
DEV_WAIT
Indicates that the queue is waiting for the printer because the printer is offline, out of paper, jammed, or the
cable is loose, bad, or wired incorrectly.
Normal Recovery: To recover from a DEV_WAIT, you must correct the problem that caused it to wait. Check to
see if the printer is offline, out of paper, jammed, or loosely cabled. It might be easier for diagnostic testing to
use the enq command to move all queued jobs from the DEV_WAIT queue to another queue that is either
printing or is DOWN. After the problem is corrected, you can move any unprinted jobs back to the original
queue.
DEV_WAIT can also be caused by improper flow control to the printer, particularly when using XON/XOFF
software control. Use SMIT to see if you are using the proper flow control (XON/XOFF or DTR pacing).
Bad or improperly wired cabling can cause a DEV_WAIT situation. Usually, you cannot recover from this
situation unless you replace the cable.
DOWN
Specifies that the device driver cannot communicate with the printer (CD or CTS dropped or is low) after
TIMEOUT seconds. The TIMEOUT value indicates the amount of time, in seconds, that the queuing system
waits for a printer operation to complete. You can set this value using SMIT.
A queue usually goes into the DOWN state after it has been in the DEV_WAIT state. If a queue goes directly
into the DOWN state, either the TIMEOUT value is too small or there are cabling problems. Usually, this
situation occurs when the printer device driver cannot tell if the printer is there because of the absence of correct
signaling. However, some printers cannot signal the queuing system that they are only offline. These printers
signal that they are off; they drop CTS (if an lp) or drop CD (if a tty).
If the printer device is off, the queue goes into the DOWN state. The system administrator can bring a queue to
the DOWN state for maintenance with the queuing commands (qadm, disable, enq, and others).
Normal recovery: Correct the problem that brought the queue down and bring the queue back up using the
qadm, enable, or enq commands with appropriate flags. The queue must be manually brought up before it can
be used again.
35
HELD
Specifies that the job is held and will not be put on the queue until it is released using the qhld or enq
commands.
OPR_WAIT
Specifies that the backend program is waiting for the operator to perform a task, such as loading paper. This is
usually software-related.
Normal Recovery: To recover from an OPR_WAIT state, respond appropriately to the request that is made by
the queuing system.
QUEUED
READY
Specifies that everything involved with the queue is ready to queue and print a job.
RUNNING
UNKNOWN
Specifies that a user created a queue on a device file that another queue is using and that the status is
DEV_WAIT. The queue cannot get a status from the printer device (lp0) when it is on hold (DEV_WAIT).
Normal recovery: To correct this, bring down the other queue or fix the problem with the printer. Bring the new
queue down and back up so the queue registers as READY.
Specifies
Specifies
Specifies
Specifies
that
that
that
that
the
the
the
the
backend
backend
backend
backend
is
is
is
is
Remote printing
Remote printing allows different computers to share printers.
To use remote printing facilities, the computers must be connected through the Transmission Control
Protocol/Internet Protocol (TCP/IP) and must support the required TCP/IP applications, such as the lpd
daemon.
A remote print request is queued in the same manner as a local print request:
v A front-end print command such as qprt, lpr, or enq initiates the request to the appropriate queue on
the local system.
v The qdaemon on the local system processes the request as it would any locally queued job, with one
exception: the qdaemon passes the request to the rembak backend program rather than the piobe
backend.
v The rembak program transmits the print job to a remote server over the TCP/IP network.
v On the remote server, the lpd daemon monitors port 515 for remote print requests.
v When the lpd receives a remote print request, it places the job in the appropriate local queue.
v The print request is then processed by the qdaemon on the print server.
v The qdaemon passes the request to the piobe backend on the print server.
v The piobe backend formats the data stream for printing on the specified printer.
36
The following sections discuss how to configure, use and manage a remote printing environment:
rembak program
The local queue set up to serve remote print requests must be configured to use rembak, the remote print
backend command.
When you set up the queue, the system prompts for a backend program path name. The entry at this
prompt tells the qdaemon command which backend program to use to process print requests. To set up a
queue to handle remote print requests, type /usr/lpd/rembak.
The rembak command also processes status requests, job cancel requests, and requests to kill a remote
queuing system. Status requests such as qchk -A or lpstat query the status of local print queues and
devices by analyzing the qconfig file and the local print spooling subsystem status files.
In a remote print environment, the qchk -A and lpstat commands use the rembak program to request
queue status information from the print servers. The output of a queue status command shows two
entries for each remote queue. The first entry is the status of the local queue to which remote jobs are
sent. The second entry shows the status of the queue on the remote print server where the jobs are
printed. In the following example, the queue name rq was used for both the queue on the local system
and the queue on the remote print server:
Queue
----Iago
Pro
bsh
ps
rq
rq
Dev
--Iago
asc
bshde
ps
rqd
ps1
Status
-----RUNNING
READY
READY
READY
READY
RUNNING
QUEUED
Job Files
--- --------------284 mileaf
User
PP % Blks Cp
---------- --- -- ---- -ann@arctur 15 13 1
1
22
60
1
1
1
2
As the preceding example shows, any print jobs currently running or queued are displayed in the remote
print server entry for the queue.
The rembak program also sends requests to cancel print jobs to the remote print servers. Each print job is
assigned a number. As shown in the preceding example, print queue status requests display the job
numbers for currently queued or running print requests. To cancel a job on a remote queue, use the same
commands used to cancel local print jobs. For example, to cancel job 298 from the queue rq, you can use
the Web-based System Manager (type wsm and then select Printers) or one of the following commands:
qcan -Prq -x298
OR
lprm -Prq 298
lpd daemon
Although local and remote print jobs are submitted with the same commands, they are processed
differently. After a print job has been transmitted to a remote host, it is no longer managed by the local
print spooling subsystem.
The lpd daemon is part of the TCP/IP system group. Any host on a TCP/IP network can run the lpd
daemon, and any host can send print requests to any other host on the network (if the host is currently
running lpd). As a security measure, the lpd daemon forks a child process that checks each remote print
request against two database files: the /etc/hosts.equiv file and the /etc/hosts.lpd file. If the name of
the host submitting the print request is not in the /etc/hosts.lpd file, the print request is rejected.
37
Note: The /etc/hosts.equiv file defines which computers on a network are allowed to execute certain
commands on a local host without supplying a password. The /etc/hosts.lpd file defines which
computers on a network are allowed to execute print commands on a local host without supplying a
password.
The lpd daemon on the remote print server monitors port 515 for print requests. When the lpd daemon
receives a print request from a valid host, it places the request in the specified queue. The lpd daemon
places files specified in print requests in the directory /var/spool/lpd. The print request is then managed
by the qdaemon and the appropriate backend (usually piobe) on the remote server.
The /etc/locks/lpd file contains the process ID of the currently running instance of the lpd daemon. If a
machine running the lpd daemon becomes inoperable, the ID for the lpd daemon might have to be
removed before the system is restarted. The error messages lpd: lock file or duplicate daemon indicate
that the ID must be removed.
lpd daemon control:
Controlling the lpd daemon includes starting and stopping the lpd subsystem and changing the
characteristics of the lpd subsystem.
You can use the Web-based System Manager (type wsm, and then select Printers), or use the SMIT or
System Resource Controller (SRC) commands to control the lpd daemon.
There are three ways to start the lpd daemon. If it is not currently running, you can start the daemon at
any time. You also have the option of having the lpd daemon start at system restart or to have it start
both at the current time and at system restart. The same options are available to stop the lpd daemon:
stop now, stop at system restart, or stop both now and at system restart. You can run the lpd daemon
with DEBUG, with SYSLOG, with both DEBUG and SYSLOG, or with neither.
To control the lpd daemon with the Web-based System Manager, type wsm and select Printers, and then
select the desired options from the Printer Queues window menus. To control the lpd daemon with
SMIT, type smit lpd, and then select the desired options from the SMIT menus. To control the lpd
daemon with the SRC, use the following SRC commands:
startsrc
stopsrc
lssrc
refresh
traceson
tracesoff
38
Description
host
sys2
Name of the remote host (print server) where jobs will be printed.
rq
q2
s_statfilter
/usr/lpd/aixshort
/usr/lpd/bsdshort
Filter used to translate BSD lpq command output (short form) when
the remote print server is a BSD system.
/usr/lpd/attshort
Filter used to translate ATT lpstat command output (short form) when
the remote print server is an ATT system.
/usr/lpd/aixlong
/usr/lpd/bsdlong
Filter used to translate BSD lpq command output (long form) when the
remote print server is a BSD system.
/usr/lpd/attlong
Filter used to translate ATT lpstat command output (long form) when
the remote print server is an ATT system.
l_statfilter
You can also perform this task with the smit mkhostslpd fast path.
A print request sent from a host that is not defined in the print servers /etc/hosts.lpd file is rejected.
The system displays an error message indicating that the host does not have line printer access.
A host acting as a print server must also have its lpd process running to service print requests. The SRC
lssrc -s lpd command shows the status of the lpd daemon. If the daemon is not active, use the
Web-based System Manager or the startsrc command to start the lpd daemon.
39
40
ruser -a -p HostName
OR
You can use the following SMIT fast path:
smit mkhostslpd
v To start the lpd remote subsystem both now and at the next system restart:
startsrc -s lpd; mkitab "lpd:2:once:startsrc -s lpd"
OR
you can use the following SMIT fast path:
Printers and Printing
41
smit mkitab_lpd
1.
2.
3.
4.
v To stop the lpd remote subsystem both now and at the next system restart:
stopsrc -c -s lpd; rmitab "lpd"
OR
you can use the following SMIT fast path:
smit rmitab_lpd
1. With root authority, at the system prompt, type wsm, and then select Printers.
2. In the Web-based System Manager Printer Queues window, select Overview & Tasks from the
Printers menu.
3. From the Overview & Tasks window, select Start Remote Print Server (lpd) from the Printer menu.
This will open a new window.
4. Select Server Access List from the Printer menu.
5. In the Computer Name: input field, enter the remote client host name.
6. Select Add.
7. When you have added all of the remote client host names you want to add, select OK.
42
The information in this how-to scenario was tested using specific versions of AIX. The results you obtain might vary significantly
depending on your version and level of AIX.
1. With root authority, at the system prompt, type wsm, and then select Printers.
2. In the Web-based System Manager Printer Queues window, select Overview & Tasks from the
Printers menu.
3. From the Overview & Tasks window, select Start Remote Print Server (lpd) from the Printer menu.
This will open a new window.
4. Select Server Access List from the Printer menu.
5. In the Computer Name: input field, select the remote client host name that you want to remove.
6. Select Remove.
7. When you have removed all of the remote client host names you want to remove, select OK.
Print spooler
The job of the spooler, also called the queuing system, is to manage printer use, especially on systems that
have more than one printer.
Spooler backend
Because the backend piobe, used to process print jobs on local queues, is the most commonly used and
possibly the most complex backend shipped with the base operating system, it is used as the primary
example in this section. Using piobe in this fashion will allow a better development of the base operating
system spooler concepts.
The purpose of this section is to demonstrate that the spooler is a real process with a beginning, discrete
points in between (no black boxes), and an end. The spooler is a series of components whose interaction
is completely dependent upon how a specific queue is configured. Recognizing this can have the
following results:
v Problem determination and resolution can become easier.
v Bending the spooler to your specific business needs can become easier.
v You may see opportunities for spooler modification that you had not considered.
Formatter filters
A formatter filter is part of the pipeline created and executed by the default backend for local printer
queues, piobe.
A formatter filter provides the capability of either formatting an input file or passing it through
unmodified, based on an input parameter. Even if the formatter passes the input file unmodified, it still
sends printer commands to initialize the printer before the input file is printed and restores the printer to
its original state after printing is complete.
It is the formatter filter that has the capability of using a virtual printers colon file to perform extensive
manipulation of a spooler print job.
43
Printer devices
A printer/plotter device is a special file in the /dev/directory for a real printer.
This file can be used by redirection (for example, cat FileName > /dev/lp0) or by user-written, compiled
programs. Settings for this device driver can be displayed and changed using the splp command. Before
any of the spooler commands can access a printer device, a print queue must be created for the device.
qdaemon process
The qdaemon tracks both job requests and the resources necessary to complete the jobs, where the
resources may be a real printer, some other real device, or even a file.
The qdaemon is a process that runs in the background under the auspices of the srcmstr process. When
you turn your system on, the startsrc command starts the qdaemon. While the qdaemon can be started
by the startsrc command or stopped by the stopsrc command, the qdaemon supports only signal
communications and thus cannot be queried by the lssrc command.
The qdaemon tracks both job requests and the resources necessary to complete the jobs, where the
resources may be a real printer, some other real device, or even a file. The qdaemon maintains queues of
outstanding requests and sends them to the proper device at the proper time. The qdaemon also records
printer usage data for system accounting purposes. It is the qdaemon that sets the backend for a spooler
queue into execution.
If the qdaemon is aborted, it will be restarted by srcmstr.
Note: Do not attempt to stop the srcmstr daemon; it controls other daemons running on your system.
44
Spooler backends
A spooler backend is a collection of programs (a pipeline) started by the spoolers qdaemon command to
manage a spooler job that is queued for processing.
When the backend is for a print queue, the spooler backend typically performs the following functions:
v Receives from the qdaemon command a list of one or more jobs to be processed.
v For print jobs, uses printer and formatting attributes from the database, overridden by any flags
specified on the command line.
v Initializes the printer before processing a print job.
v Provides filters for simple formatting of ASCII documents.
v
v
v
v
v
v
v
Uses filters to convert print job data stream to a format supported by the printer.
Provides support for printing national language characters.
Passes the filtered data stream of a print job to the printer device driver.
Generates header and trailer pages for print jobs, if requested.
Generates multiple copies of print jobs, if requested.
Reports paper-out, intervention-required, and printer-error conditions.
Reports problems detected by the filters.
Spooler jobs
A spooler job is any job that a user submits to the spooler.
All job submission commands must end with the names of one or more files that require processing. You
cannot, for example, pass a keyword to a backend and have the keyword control the function that
backend will perform; the submitted job must exist in the file system.
The spooler will accept many types of jobs. It is the responsibility of the system administrator to ensure
that the backend for a given queue is capable of processing any job submitted to that queue.
Printer job types include:
v ASCII
v Postscript
v PCL
v HPGL
v GL
v Diablo 630
v ditroff
Printers and Printing
45
Spooler parts
The base operating system spooler can be viewed as a process or a subsystem with a beginning,
points-in-between, and an ending.
To accomplish its tasks, the base operating system spooler has four basic parts:
1. The enq command is the true entry point to the spooler, and as such is the beginning of any spooler
activity. This command accepts requests for job processing.
2. The qdaemon is responsible for accepting and tracking all jobs submitted to the spooler by the enq
command. It is also responsible, after all the necessary resources are available, for allowing a queue
backend to process a job. The qdaemon is one of the points-in-between in the spooler process.
3. The spooler backend is a collection of programs invoked by the spoolers qdaemon command to
process a job in some queue. The backend sends output to a specific device, such as a printer. When
the backend is piobe, it involves a formatter filter, which in turn involves a printer colon file. The
backend is one of the points-in-between as well as the ending because the backend contains the
specific process that will deliver the processed job to its final destination.
4. The configuration file, /etc/qconfig, describes the configuration of available queues and devices. Both
the enq command and the qdaemon command, see the configuration file. This configuration file is
considered as conceptually important as the other three spooler parts due to its critical value to the
correct operation of the base operating system spooler as a whole.
46
When a job is submitted to the spooler, enq processes the job request. If the job request is valid, which
basically means that the command syntax was correct, the job is placed upon a queue. enq creates a job
description file (JDF) and notifies the qdaemon of the existence of the new JDF.
The qdaemon reads each new JDF and reads the job parameters specified by the JDF into an internal data
structure that it maintains to track job requests. The qdaemon uses queue status information to keep
track of the status of each queue and, when circumstances are right, will invoke the backend for the
queue to process the job.
The backend for a queue determines precisely how a job placed on that queue will be processed. The
commands that allow users to submit jobs to the spooler can specify flags requesting certain treatment of
the job, the qdaemon can determine which job gets processed when (shortest-job-next or
first-come-first-served), but the backend is the process that actually does all the work as far as processing
the job is concerned. (A systems administrator can read the stanzas in /etc/qconfig and quickly
determine the function of a given queue simply by examining the backend.)
In the following figure, the two most common backends scenarios are shown: a local printer queue and a
remote printer queue. The local queue uses piobe (Printer Input/Output BackEnd) as a backend. The
remote printer queue uses rembak (REMote BAcKend) as a backend.
piobe, like all backends, is invoked by the qdaemon. piobe sets up and controls a series of programs ( a
pipeline) that can not only perform extensive manipulation of a print job but can also send an extensive
amount of control data to a printer, for example, to initialize the printer to a specific mode before the
processed job is delivered to the printer. It is piobe that makes the initial use of the data stored in printer
colon files. The last program in the pipeline set up and controlled by piobe is responsible for the physical
delivery of the byte stream generated earlier in the pipeline. In the context of a local queue, this program
opens a device driver which will deliver the byte stream to a locally attached printer (attached serial or
parallel), or to a network-attached printer.
rembak is a common backend when the remote printer queue simply points to a queue on another host,
better known as a print server. While piobe can perform extensive manipulation of a print job, rembak
just transfers jobs across TCP/IP networks to print servers. As the Printing with the Base Operating
System figure depicts, if the print server is another base operating system-based machine, rembak
transfers the job across the network to the lpd process, which in turn invokes enq, which creates a JDF,
and so on as described above.
47
This is the argument vector generated by this specific instance of the qprt command. If echo had not
been mounted over enq, the following job submission command would have been executed:
enq -P asc -o -f -o p -o -z -o 1 -o -p -o 12 -o -s courier -C -N 3 /etc/motd
A job submission command must end with the name of one or more real files that exist in a file system
accessible by the base operating system. This is true even when the queue is set up to handle jobs other
than print jobs.
Note: Make sure that you execute step 3. Otherwise, the spooler will be disabled.
When the enq command is executed, either directly or by lp, lpr, or qprt, it assigns a job number to the
job. By default, lp will return the job number. lpr and qprt will not return the job number unless you
specifically request it with a flag.
enq creates a JDF and places it in /var/spool/lpd/qdir, then writes the name of the JDF to a message
queue and signals the qdaemon (by sending it a SIGUSR2) that a new JDF exists. The qdaemon then
reads the name of the JDF from the message queue, accesses the JDF directly, and reads the data
contained in the JDF into an internal data structure it maintains to track all the jobs currently in the
spooler. At this point in time, the job has been accepted by the spooler.
A JDF is created for all spooling system operations other than a queue status query; the structure of a JDF
differs between print requests versus job cancellation requests versus queue control requests, and so on,
but a JDF is created nevertheless. Commands with the same function as lpstat still call enq to do their
work, but neither is a JDF created nor is the qdaemon involved.
When the qdaemon determines that the device upon which the job is queued is available, the qdaemon
invokes the backend for the queue, passing it arguments specified by the JDF. The backend processes the
job.
48
Backend processing
The backend for a queue is begun by qdaemon; the qdaemon determines that a jobs turn to be
processed has arrived, sets up an execution environment for the queue backend, constructs an argument
vector for the backend, and, via fork and exec, causes the backend to begin execution.
The number of simultaneous instances of the backend is controlled by the presence or absence of the file
parameter in the stanza for this queue in the /etc/qconfig configuration file. If the file parameter is
present, then only one instance of the backend can exist for this queue; This is because the qdaemon will
only attempt to set the execution environment for the backend when it has determined that the job can be
processed. Part of setting the backends execution environment involves opening stdout of the backend
onto the file or device specified by the file parameter. If the qdaemon has already performed this action
for a previous job, and that job is still executing, then the qdaemon cannot get a lock on the file or device
specified by the file parameter and hence cannot open stdout of the backend onto that file or device. Thus
the qdaemon holds the job in the queue and waits for the previous job to complete execution and release
the file or device. This is how the spooling system provides and controls serial access to a device.
If the file parameter is absent or set to a value of FALSE, the qdaemon opens stdout of the backend onto
/dev/null and executes the job immediately. In this situation there is no clear file or device to which
serial access should be provided, so jobs will not stack up on the queue. Jobs submitted to this queue will
be processed just as fast as the qdaemon can set up the execution environment. The absence of the file
parameter effectively disables serial access to any local file or device.
A meaningful and common example of a queue lacking the file parameter is a remote printer queue. In
this situation, the resource to which serial access should be provided actually exists on another host; there
is no reason for the local queue to attempt any type of control. The backend for this type of queue, by
default the rembak program under the base operating system, simply sends the job across the network to
the remote queue and lets it handle the serial access control.
The default backend for a local print queue under the base operating system is piobe. Multiple queues
can all specify the same backend. In this situation, multiple simultaneous instances of piobe can exist;
each queue that specifies piobe as its backend can potentially generate an instance of piobe. However if
two or more queues also specify the same value for the file parameter, the serial access restriction is
applied. The qdaemon will not be able to acquire a lock on the specified file or device if the qdaemon
has already acquired the lock for another instance of piobe. A queue that cannot process a job because of
this restriction will show a queue status of DEV_BUSY. The status will change to RUNNING as soon as
the qdaemon can acquire a lock on the file specified by the file parameter.
49
When the device upon which the job is queued becomes available, the qdaemon invokes the backend for
the queue. In the base operating system world, the backend is commonly piobe. The qdaemon invokes
piobe and passes it arguments in the normal C programming language fashion, using argc and argv[].
For example, using the command in step 2 from Spooler data flow (enq command) on page 48 :
qprt -Pasc -z1 -fp -p12 -s courier -C -N3 /etc/motd
argv[3]
argv[4]
argv[5]
argv[6]
argv[7]
argv[8]
argv[9]
=
=
=
=
=
=
=
-z
1
-p
12
-s
courier
/etc/motd
argv[0] is the name of the backend itself, as usual. Note that the -Pasc, which specifies the queue name,
was parsed out of the original argument vector, as were the -C and -N3 flags and arguments.
50
piobe uses the argv[] values to construct a pipeline of filters that must be executed to process the job as
requested. After determining the structure of the pipeline, piobe passes the structure to a shell for
realization. If the file parameter in the /etc/qconfig entry for this queue exists, piobe will open the
stdout of the last process in the pipeline onto the value specified by the file parameter. The last process
in the pipeline is not prevented from re-opening stdout onto some other file or device.
Note the parent-child relationship among these processes, which is not apparent from the figure:
v qdaemon is the parent of piobe.
v piobe is the parent of the shell.
v The shell is the parent of pioout, the last process in the pipeline before the device driver is accessed.
pioout is called the Interface Program for Use With the Device Driver or the device driver interface program.
v pioout is the parent of pioformat.
v pioformat dynamically loads and links the device-dependent code at runtime; hence the
device-dependent code does not appear as a process in the operating systems process table.
v pioformat is the parent of the optional filter (if it exists), such as the pr filter.
An optional filter, such as pr, can be specified on the command-line (or hardcoded in the colon file) to
perform pre-filtering on the job before pioformat processes it.
pioformat is known as a device-independent formatter driver. It will dynamically load, link, and drive
various device-dependent formatters to process jobs of a specific data stream type (for example,
Postscript, ASCII, GL, or PCL).
Device-dependent code is designed to handle the unique properties of combinations of specific data
streams and physical printers. Because combinations of data stream types and printers can be grouped
into classes with common attributes, there are currently less than 20 device-dependent modules. These
modules are loaded, linked, and driven by pioformat at run time.
pioout is the end of the job-processing pipeline, and is called the device driver interface program. The
function of pioout is to take the processed data stream and deliver it to the device for which it was
intended, generally a printer. In the typical local print queue environment, it is pioout that has its stdout
opened onto the character special file in the /dev directory, as specified by the file parameter in
/etc/qconfig.
This is the character special file in the /dev directory that provides access to the device driver for the
printer hardware.
51
when its execution is dependent upon specific hardware, again such as a certain printer. In the base
operating system spoolers formatter filter, it is the device-dependent formatter that contains code
designed to handle all of the properties of a particular physical printer or class of printers, including
supported data stream, escape sequences, and control codes unique to that printer or printer class.
The device-independent pioformat is called a formatter driver because that is precisely what it does. When
pioformat is set into execution, it expects several arguments. One of these arguments is the full path
name to a device-dependent formatter. At run time, pioformat dynamically loads, links, and drives the
device-dependent formatter. The following figure depicts this relationship.
The pioformat command expects to be able to call, if necessary, five subroutines; pioformat by itself does
not contain these subroutines. The subroutines exist in the device-dependent formatter and are supplied
to pioformat at runtime when the loading and linking of the device-dependent formatter by pioformat
occurs.
The formatter driver is invoked by a pipeline and is passed the name of a formatter to be driven. The
formatter driver dynamically loads and links the formatter and calls the formatters setup function which
indicates whether data formatting or data pass-through is requested. After the formatters setup function
performs the necessary functions, it returns to the formatter driver. The formatter driver calls the
initialize function. The initialize function outputs a string of printer commands to initialize the printer
and returns to the formatter driver.
The formatter driver either calls the passthru function once or calls the lineout function for each line in
the print file based on the return code from the setup function. If the lineout function is called, the
formatter driver performs all vertical spacing, including line spacing, vertical tabs, form feeds, and top
and bottom margins. Line spacing and vertical tabs are performed by the lineout function. Other vertical
spacing functions are performed automatically.
52
When processing is complete, the formatter driver calls the restore function. The restore function outputs
a string of printer commands to restore the printer to its default state, defined by the database attribute
values.
For more information about how the print formatter interacts with the printer formatter subroutines, see
the Print formatter example on page 73.
/etc/qconfig is composed of text blocks referred to as stanzas. Each queue is represented by a pair of
stanzas. The first stanza in a pair is referred to as the queue stanza; the second stanza in a pair is referred
to as the device stanza. Stanzas are composed of parameters and parameter values that describe the
queues properties and function.
When the qdaemon parses the ASCII version of /etc/qconfig, the first non-commented line it identifies
must be a word followed by a colon; this line represents the beginning of the queue stanza. This word is
the name of a queue to which a user can submit jobs. There must be one or more lines indented by tabs
following this line. One of these lines must be device = device_name. The value of the device parameter
is a link from the queue stanza to the device stanza; this parameter has no other function. When a queue
is initially setup, the operating system will frequently use the name of a printer, such as lp1, as the value
Printers and Printing
53
of the device parameter. While the queue may actually be setup to use lp1, the use of lp1 as the value of
the device parameter only means that the device stanza will be named lp1. This is not related to the fact
that there is a real printer known to the operating system as lp1.
Following the tab-indented lines, the qdaemon must find the word that is the value of the device
parameter followed by a colon; this line represents the beginning of the device stanza. This word, which
a user normally does not need to know, is the name of a device to which the corresponding queue stanza
provides serial access. There must be one or more lines indented by tabs following this line. One of these
lines must be backend = full_path_name_to_backend. In a local spooling environment, there are two
parameters of critical importance in this stanza.
The file parameter specifies the real device to which the queue provides serial access. It is important to
note that jobs submitted to the spooling system are queued upon this device. If a queue is setup to use a
printer known to the operating system as lp1, then the value of the file parameter would be /dev/lp1.
The operating system routines that create queues use the name of the real device as the name of the
device stanza by default, and this is why there is some confusion as to the meaning of the device
parameter.
The backend parameter specifies the full path to the program that will process the job submitted to the
spooling system, after the qdaemon determines that the jobs turn to be processed has arrived.
54
header = never
trailer = never
access = both
backend = /usr/lib/lpd/piobe
ps:
device = lp1
lp1:
file = /dev/lp1
header = never
trailer = never
access = both
backend = /usr/lib/lpd/piobe
Each of these stanza pairs defines a queue. When the backend for a queue is piobe, each queue also has
an associated virtual printer. While it is possible to create virtual printer definitions the hard way, virtual
printer definitions are typically created at the same time as the queue definition, with SMIT and the
piomkpq command. The virtual printer definition is not contained in /etc/qconfig. Its presence is
implied by the fact the spooler backend for a given queue is piobe, but it is stored elsewhere in the base
operating file system. The name of the queue is used to identify and access the virtual printer definition.
The physical printer known to the base operating system as lp1 clearly supports at least four distinct data
stream types; they are ASCII (asc), Plotter Emulation (gl), Printer Command Language (pcl), and
PostScript (ps). Each queue with its associated virtual printer definition is designed to process a
particular data stream type, hence the four queues. This is the basis for the base operating system notion
of a logical separation of physical and virtual printers.
Dev
--@krik
myps
Status
Job Files
User
PP % Blks Cp Rnk
--------- --- -------- --------- -- - ---- -- --READY
READY
The first line of the output indicates that the local spooler queue named myps, with a device stanza
whose name is listed as @krik, has a status of READY. The second line indicates that the target remote
spooler queue, also named myps, whose device stanza is listed as myps, also has a status of READY. (It
is the authors habit to make a local spooler queue name the same as the print server spooler queue
name. Its then easy to visually group the two lines in the output of a spooler queue status query.)
55
The base operating system printer backend receives and processes print requests from a spooler, usually
the qdaemon command. The printer backend is implemented by the piobe command
The printer backend supports all of the printers installed in the Object Data Manager (ODM) Predefined
database. You can customize the printer backend to assist in the administration of the printing subsystem.
For more information, see Printing administration on page 14. You can also modify the printer backend
to add unsupported printers and National Language Support (NLS) code page translation tables.
Adding a printer to the printer backend involves adding a printer colon file for that printer. In many
cases, the printer colon file of a similar printer can be duplicated with little modification. If modification
of an existing printer colon file is not sufficient, you can write a print formatter. If the modifications
exceed the scope of the print formatter, you may need to write a new printer backend.
See the following sections for more information:
v Adding a printer using the printer colon file on page 94 provides a procedure for duplicating a
printer colon file.
v Printer colon file escape sequences on page 65 provides information useful in modifying a printer
colon file.
v Backend Routines in libqb on page 81 and Backend and qdaemon interaction on page 76 can assist
you in writing a new printer backend.
The procedure for translating NLS code points in the print file to code points for the printers varies
depending upon whether the code sets are single-byte or multibyte. For more information, see:
v Printer code page translation tables on page 82
v Printer code page translation for multibyte code sets on page 83
Third-party vendors may want to customize the printer backend for special purposes.
56
Description
asc
Extended ASCII
pcl
Hewlett-Packard PCL
630
Diablo 630
gl
Hewlett-Packard GL
ps
PostScript
855
kji
Kanji
When you use the mkvirprt or smit virprt command to create a virtual printer, the system prompts you
to select the desired printer from a list of defined printers. If you have just configured a printer port for a
new printer, select the new printer port. When the virtual printer command is executed, the system
creates a print queue and copies the colon file for the selected printer in the predefined database
directory, /usr/lib/lpd/pio/predef/*, to the customized database directory /var/spool/lpd/pio/
custom/*.
Note: If no flags are specified, the mkvirprt command becomes interactive.
Use the chvirpt or smit lsvirprt command to change or further customize the attribute values stored in a
virtual printer definition. To change an attribute value with smit lsvirprt, enter
attribute_name=attribute_value with no spaces on either side of the = (equal) sign.
Printers and Printing
57
Each attribute name in a virtual printer definition must be unique. Attribute names can contain the
characters a through z, A through Z, 0 through 9, and _ (underscore). Attribute names must not begin
with a numeral. All attribute names must be two characters long, except for group header attribute
names, which can be five characters long.
Attribute names for group headers begin with _ _ (two underscores) and must not be longer than five
characters. A group header attribute marks the beginning of a group of related attributes.
Examples show some of the typical attributes for a supported PostScript laser printer (4029 LaserPrinter).
Each example shows how the lsvirprt and smit lsvirprt commands display virtual printer attributes (with
a descriptor for each attribute) and how those same attributes are stored in the printer colon file.
The printer subsystem uses the default _l value of 66 to process the print request. The following print
request uses the -l flag to specify 50 lines of text per page:
qprt -l 50 -P Pro myfile
The -l flag value overrides the default value in the _l attribute of the virtual printer definition for the Pro
printer.
The first character for a default flag value attribute is always the _ (underscore). The second character
corresponds to the command flag for which the default value is stored.
The following example shows some of the attribute values under the _ _FLG group header. These values
are typical for a supported PostScript laser printer.
Name Description
_ _FLG VALUES THAT MAY BE OVERRIDDEN WITH FLAGS
ON THE COMMAND LINE
_1
Page Headings Wanted For Text Converted
to PostScript? (!: no; +: yes)
_2
Use Two Columns for Text Converted to
PostScript? (!: no; +: yes)
_3
Gaudy Mode Wanted for Text Converted to
PostScript? (!: no; +: yes)
_4
Print Garbage File Anyway for Text
Converted to PostScript? (!: no; +: yes)
_5
List Characters Not In Font When Converting
Text to PostScript? (!: no; +: yes)
_6
Font Name for Header Line of Text Converted
to PostScript
_A
stderr returned? 0:no; 1:yes, & pipelines;
2:yes, & values, pipelines
_H
Name To Replace Host Name On Burst Page
_J
Restore the Printer at the End of the ?
Print Job (!: no; +: yes)
_L
Wrap Long Lines (!: no; +: yes)
Value
!
!
!
!
!
300
1
58
+
+
:469:_3::!
:470:_4::!
:471:_5::!
:472:_6::300
:013:_A::1
:022:_H::
:027:_J::+
:030:_L::+
si
sp
st
sw
%Ide/pioburst
%F[H] %Idb/H.p
s | %Ide/piofo
rmat -@%Idd/%I
mm -!%Idf/piof
pt%f[j]
Users, Separated by Commas, to Get Intervention
Messages; Null String Is Job Submitter
Command Line Flags Prohibited For All -d values;
Ignored: cmnrBDMPRT
Pipeline for Trailer Page
%Ide/pioburst
%F[H] %Idb/T.p
s | %Ide/piofo
rmat -@%Idd/%I
mm -!%Idf/piof
pt%f[j]
Width of Attribute Value Area On Header Page
78
(0 means ignore width)
These same attribute values would be stored in the printer colon file as:
:060:_ _SYS::
:321:sh::%Ide/pioburst %F[H] %Idb/H.ps | %Ide/pioformat -@%Idd/%Imm
-!%Idf/piofpt %f[j]
:322:si::
:323:sp::
:324:st::%Ide/pioburst %F[H] %Idb/T.ps | %Ide/pioformat -@%Idd/%Imm
-!%Idf/piofpt %f[j]
:325:sw::78
59
Some of the attributes in this group are the ia attribute that stores the extended ASCII input data stream
pipeline, and the is attribute that stores the PostScript input data stream pipeline. The ip attribute is
another typical attribute in this group. The ip, or pass-through, attribute passes the output from a
formatter filter to the printer unmodified.
The first character for an input data stream attribute is i. The second character designates the input data
stream type.
The following example of _ _IDS attributes shows typical input data stream pipelines for a supported
PostScript laser printer (4029 LaserPrinter).
_ _IDS PIPELINES FOR INPUT DATA STREAMS (2 char, 1st="i",
2nd=data stream name)
ia
Pipeline for Input Data Stream "a" (extended
/usr/bin/enscr
ASCII)
ipt -p- -q%?%G
_2%t -2%;%?%G_
z%t -r%;%?%G_3
%t -G%;%?%G_1%
t%e -B%;%?%G_L
%t%e -c%;%?%Ch
%t%fbh%e%?%L_h
%t -b'%I_h'%;%
; -L%G_l%d -f%
?%Cs%t%f!s%e%I
_s%;%G_p%d %?%
G_1%t-F%Iw7%G_
p%d%;%?%G_4%t
-g%;%?%G_5%t o%;%?%L_f%t%e
%I@1%; | %Iis
il
Command Line Flags Prohibited For Input Data
/interleaf/ile
Stream; Ignored: cmnrBDMPRT
af5/bin/pl2ps
-ppd IBM17521.
PPD -r 1270-nf
-np | %Ide/pio
format -@%Idd/
%Imm-!%Idf/pio
fpt %f[juJZ]
in
Pipeline for Input Data Stream "n" (troff
/usr/bin/psc |
(ditroff) intermediate output)
s%Ii
ip
Pipeline for Input Data Stream "p"
%Iis
(pass-through)
is
Pipeline for Input Data Stream "s" (PostScript) %Ide/pioformat
-@%Idd/%Imm -!
%Idf/piofpt %U
H %f[juJZ]
The colon file stores these same attributes in the following format:
:057:_ _IDS::
:274:ia::/usr/bin/enscript -p- -q%?%G_2%t -2%;%?%G_z%t -r%;%?%G_3%t
-G%;%?%G_1%t%e -B%;%?%G_L%t%e -c%;%?%Ch%t%fbh%e%?%L_h%t -b'%I_h'%;%;
-L%G_l%d -f%?%Cs%t%f!s%e%I_s%;%G_p%d %?%G_1%t-F%Iw7%G_p%d%;%?%G_4%t
-g%;%?%G_5%t -o%;%?%L_f%t%e %I@1%; | %Iis
:001:il::/interleaf/ileaf5/bin/pl2ps -ppd IBM17521.PPD -r 1270 -nf np | %Ide/pioformat -@%Idd/%Imm -!%Idf/piofpt %f[juJZ]
:465:in::/usr/bin/psc | %Iis
:277:ip::%Iis
:273:is::%Ide/pioformat -@%Idd/%Imm -!%Idf/piofpt %UH %f[juJZ]
60
If you use a prohibited command flag in a front-end print request (such as qprt), the system rejects the
flag and returns a message that the flag is prohibited by system administration. The first character of a
prohibited flag attribute name is I and the second character represents the data stream type to be rejected.
To prohibit multiple flags for a data stream type, store the single-character flag names with no spaces,
commas, or other delimiters. For example, to reject the -e (emphasized print) flag and the -E (double-high
print) flag for the extended ASCII input data stream, run the smit lsvirprt command and enter the
following to set this attribute:
Ia=eE
The following example shows the Is attribute that sets the prohibited flag attribute for the PostScript data
stream on a supported PostScript printer. The descriptor for the Is attribute contains the string Ignored:
cmnrBDMPRT. This string indicates that the backend ignores the flags represented by the individual
characters cmnrBDMPRT. These flags are flags that address the spooling subsystem, not the backend.
Thus, listing one of these flags as a prohibited flag has no effect on the backend; the flag is not
prohibited.
_ _PFL FLAGS PROHIBITED FOR INPUT DATA STREAMS (2
char,1st="I",2nd=data str name)
Is
Command Line Flags Prohibited For Input Data
Stream; Ignored: cmnrBDMPRT
The colon file stores the attributes in the preceding example as follows:
:059:_ _PFL::
:001:Is::
pr filter
Formats files containing ditroff (device-independent troff) data
Prints control characters and suppresses page breaks
Formats files containing data produced with troff commands
DVI filter formats files created with tex
Formats standard plot data files (files created with plot)
Formats raster image files
Formats files containing data produced with cifplot
Interprets the first character of each line as a FORTRAN carriage control character.
Determines the locale support for Arabic and Hebrew. Must be /usr/bin/bprt. The width must be set to 80 and the data
stream set to a for extended ASCII. Add the flag - tashkeel to print documents with diacritics.
The value stored in a filter attribute designates the command string for the specified filter. Entries for a
supported PostScript laser printer can include:
_ _FIL COMMAND STRINGS FOR FILTER FLAGS (2 char,
1st="f",2nd=flag)
fn
fp
fb
/usr/bin/psc
%is
/bin/pr -l%G_l
%d -w%G_w%d%F[
h] %I@1%ia
/usr/bin/bprt
-w%I_w -d%I_d
-tashkeel
61
These same attribute values are stored in the colon file as follows:
:055:_ _FIL::
:269:fn::/usr/bin/psc%is
:270:fp::/bin/pr -l%G_l%d -w%G_w%d%F[h] %I@1%ia
The fd attribute is a typical filter attribute. It is used to specify a DVI filter for the virtual printer. Use
SMIT or the chvirprt command to specify this filter. For example, to specify a DVI filter by using SMIT,
enter:
smit lsvirprt
where dvi_to_printer specifies the full pathname of the filter that converts the DVI output from tex to the
format expected by the printer. The %ip designation forces the pass-through pipeline (the ip attribute) to
be used to process the print file instead of the ASCII pipeline (ia attribute). The pass-through pipeline
causes the output from the filter to be passed to the printer unmodified.
After the DVI filter has been specified in the fd attribute, you can send a print command such as lpr -d
DviFile or qprt -fd DviFile. The -d and -fd flags for the respective commands pass DviFile, an output file
produced by tex, through the DVI filter and send the results to the printer.
DIRECTORIES
/usr/lib/lpd/pio/trans1
/usr/lib/lpd/pio/trans2
/usr/lib/lpd/pio/
/var/spool/lpd/pio/@local/flags
The same attribute values are stored in the colon file as:
:053:_ _DIR::
:160:d1::/usr/lib/lpd/pio/trans1
:161:d2::/usr/lib/lpd/pio/trans2
:509:dD::/usr/lib/lpd/pio/dev
:414:dF::/var/spool/lpd/pio/@local/flags
62
Here are some typical miscellaneous attributes for a supported PostScript laser printer:
_ _MIS MISCELLANEOUS
mA
Printer Data Stream Description
mD
Name of message catalog Containing Attribute
Descriptors
mF
Path Name of Font File To Be Downloaded (must
include download commands)
mL
Printer Description
mN
mY
mc
md
mf
mi
mm
mn
mo
mp
mq
PostScript
pioattr1.cat
lp1
%Ide/pioout %v
[ABCDFINOPRS]
%%!,\320OPS
ps1
These same attributes are stored in the colon file in the following format:
:058:_ _MIS::
:330:mA::PostScript
:332:mD::pioattr1.cat
:287:mF::
:331:mL::IBM 4029 LaserPrinter
:295:mN::4029
:516:mY::3
:301:mc::\0
:302:md::ps
:303:mf::%Idf/piofpt
:304:mi::s,l
:305:mm::
:306:mn::lp1
:307:mo::%Ide/pioout %v[ABCDFINOPRS]
:308:mp::%%!,\320OPS
:309:mq::ps1
%?%S_s%"Courie
r"%=%tCourierBold%e%S_s%"Ti
mes-Roman"%=%t
Times-Bold%e%S
_s%"Helvetica"
%=%tHelveticaBold%e%S_s%"Ti
mes-Italic"%=%
Printers and Printing
63
wl
wu
tTimes-BoldIta
lic%e%S_s%"Hel
vetica-Oblique
"%=%tHelvetica
-BoldOblique%e
%Iw8%;
0
3
cr
%Iez\4%?%G_j%{
1}%=%tstatusdi
ct begin%Iat %
Iar %?%Gmw%t%I
aF%; end%;
%o\4%Iex
af
ar
at
64
%?%G_Y%ttrue
duplex %?%G_Y%
{1}%=%tfalse t
umble%etrue tu
mble%;%efalse
duplex%;
showpage
%G_6%d setreso
lution
%G_u%d setpape
rtray
:052:_ _CTL::
:512:aF::%?%G_Y%ttrue duplex %?%G_Y%{1}%=%tfalse tumble%etrue tumble
%;%efalse duplex%;
:113:af::showpage
:119:ar::%G_6%d setresolution
:115:at::%G_u%d setpapertray
\33[K\3\0\4\61
%?%GmY%{2}%>%t
%{8}%c%e%GmY%{
1}%+%c%;
\33[K\5\0\4\61
\10\0\0
Description
%%
65
%d
%[1-9]d
Pops an integer value from the stack and converts it to ASCII, without leading zeros. Produces a
field width large enough to hold the ASCII numeric digits. Similar to %d with the printf
subroutine.
Pops an integer value from the stack and converts it to ASCII. The result is 1 to 9 characters long,
depending on the digit specified before the d. If the value does not fill the specified field width, it
is padded on the left with zeros. If the value will not fit in the field, excess high-order digits are
discarded. For example, with a value of 243 from the stack, %4d produces 0243 and %2d
produces 43. A stack value of -243 would cause %5d to produce -0243.
%c
%h
%a
Input String:
%Ixx
%I[ . . . ]
%Dxx
%sss
%`xx
% String
Includes the string attribute whose name is xx. %I and can be used recursively; that is, the
included string can also contain a %I. Note that the included string does not inherit the current
stack. Instead, it is assigned a new stack.
If multiple, contiguous includes are to be done, the attribute names can be separated by commas
and enclosed with brackets. For example, the string %Icp%Icc%IeW can be specified as
%I[cp,cc,eW].
Downloads to the printer the contents of the file whose full path name is specified by the xx
attribute. The print job must have read access to the file. The primary use of this operator is to
download fonts to a printer.
Pushes a pointer to the sss string constant onto the stack. The only operation that can be
performed on the string pointer is to use %= to compare the string with another string whose
pointer is also on the stack.
Inserts the standard output produced when the command string specified by the xx attribute is
passed to a shell. Note that ` is the grave accent character.
Passes the quoted string as a command to a sub shell. Any double quotes within the quoted
string must be back-quoted to prevent the internal quotes from being read as delimiters for the
string. Note that ` is the grave accent character.
Extracts a selected portion of the string attribute named xx. The selection criteria is defined by the
pattern ...@.... The selection pattern consists of three parts:
1. The string immediately preceding the string to be extracted. If the prefix regular expression is
missing, the extracted string consists of the entire string preceding the pattern specified by the
suffix regular expression.
2. The extracted string replaces the %#xx..@.. operation sequence in the attribute currently
being processed.
3. The string immediately following the string to be extracted. If the suffix regular expression is
missing, the extracted string consists of the entire string following the pattern specified by the
prefix regular expression.
No string is extracted if the value of the string attribute is null. No string is extracted if the prefix
or suffix regular expression is nonnull and does not have a corresponding match in the attribute
value string.
Note: The ampersand (@) and quote ( ) characters need to be surrounded with a separate pair
of quotes if their meaning is to be taken literally. Otherwise, the program reads these symbols as
delimiters.
When embedding a %# operator within a regular expression portion of another %# operator, the
ampersand ( @ ) and quote ( ) characters cannot be used for their literal meaning. To avoid this
situation, place the embedded %# operator in a separate attribute value and include the new
attribute within the regular expression of the outer %# operator.
66
%Gxx
%c
%{nn}
Gets the integer attribute whose name is xx and pushes it onto the stack. If the attribute is a
string instead of an integer, the string is assumed to be an ASCII integer. It is converted to a
binary integer using the atoi subroutine and pushed onto the stack.
Pushes character constant c onto the stack, where it becomes the low-order byte of an integer
value. The high-order bytes are set to 0 (zero).
Pushes integer constant nn onto the stack. The constant is a decimal value and can be either
positive or negative.
Internal Variables:
Internal variables a through z are integer variables for use by %P, %Z, and %g. They are initialized to
zero and their values change only if a %P or %Z changes them. There are two independent sets of these
variables: one set is used by the piobe command for building pipelines, while the other set is used
exclusively by a formatter. The values for a formatters set are maintained for the duration of the
formatters processing.
%P[a-z]
%Z[a-z]
%g[a-z]
Pops an integer value from the stack and stores it in the specified internal variable. For example,
%Pf moves an integer value from the stack to variable f.
Zeroes the specified internal variable. For example, %Zg stores a value of 0 in variable g.
Pushes the value of the specified internal variable onto the stack. The value of the internal
variable is not changed. For example, %gb reads the integer value in variable b and pushes it
onto the stack.
Arithmetic Operators:
%+ %- %* %/ %m
%+
%%*
%/
%m
Note: The first value to be popped off the stack is the last one to be pushed onto the stack, and the
second value to be popped off the stack is the one that was pushed onto the stack first.
Relational and Logical Operators:
%= %> %< %!
%=
%>
%<
%!
Note: The first value to be popped off the stack is the last one to be pushed onto the stack, and the
second value to be popped off the stack is the one that was pushed onto the stack first.
Bitwise Logical Operators:
67
%& %| %^ %~
%&
%|
%^
%~
%t pops a value off the stack and tests it. If the value is TRUE
(nonzero), thenpart is run. Otherwise, elsepart (if present) is run.
else-if construct
%? c1 %t b1 %e c2 %t b2 %e c3 %t b3 %e b4 %;
where c1, c2, c3 denote conditions and b1, b2, b3, b4 denote bodies. For example, %?%{1}%t%{2}%e
%{3}%; pushes a value of 2 onto the stack, and %gx%{6}%?%=%t%{2}%e%{3}%;%d outputs a value of 2 if
the value of the internal variable x is 6. If value of x is not 6, a value of 3 is output.
When developing complex logic, it is sometimes useful to show it in structured form. The preceding
example, in structured form, might look like this:
%gx
%{6}
%?%=%t
%{2}
%e
%{3}
%;
%d
Pass-through:
(Ths piocmdout subroutine call only. See the piocmdout subroutine for more information.) Pass through
from input to output the number of bytes specified by the passthru argument to the piocmdout
subroutine. See the passthru argument to the piocmdout subroutine for more information.
%x
Loops
While loop. Whenever a matching %; is reached, the value of the internal variable x (x can be a
through z) is decremented by one. If the result is greater than 0, execution is transferred to the
character following %wx.
%wx
Mode:
68
%o
%r
Starts using only original default values from the database instead of values that may have been updated from the
command line (or during formatter processing).
Returns to using the values that were being used before %o.
Pipeline Overrides:
%p
%z
%ix
Indicates where to embed the prefix-filter pipeline in the main pipeline. If not present, it is
assumed to be at the beginning of the main pipeline. Ignored if the first character of the attribute
name is not i (that is it is not a main pipeline)
Indicates where to embed the pioout string (device-driver interface routine) in the main pipeline.
If not present, it is assumed to be at the end of the main pipeline. If the first character of the
attribute name is not i (that is, it is not a main pipeline), it is ignored.
Can be specified only in a prefix filter string (that is, the first character of the attributes
two-character name is f). The x variable represents a pipeline identifier character. The %ix
variable specifies that the attribute name for the main pipeline should be ix instead of iy, where y
is the parameter specified (or defaulted) for the -d flag. As a special case %i! specifies that a null
string should be used as the main pipeline.
Pushes a value of 1 (true) onto the stack if flag y was specified on the command line. Otherwise,
pushes a value of 0 (false) onto the stack.
Shorthand for %?%Cy%t-x %I_y%;. If the y flag was specified on the command line, generates -x
yarg, where yarg is the argument specified for the y flag. If ! is specified for x, -x will not be
generated. If yarg contains an unprotected (not immediately preceded by an odd number of back
slashes) single or double quote, an error message will be issued and the print job terminated.
If multiple flags are to be specified using %Fxy, and each flags x and y values are identical, a list
of flag letters can be specified in brackets. For example, %Faa%Fbb%Fcc can be specified as
%F[abc].
The values referenced by y or [ . . . ] have attribute names whose first character is _ (underscore)
and whose second character is y or a character in the string [ . . . ].
%fxy or %f[ . . . ]
%vxy or %v[...]
Similar to %Fxy and %F[ . . . ], except that no space is placed between the flag name and the
argument, unless the argument is a null string.
Similar to %fxy and %f[ . . . ], but used only in the command string for the pioout command, the
Device Driver Interface Program, to generate flags and arguments for override values specified by
the piobe command, the Print Job Manager. Flags are not generated when their arguments are
equal to predefined default values.
With %v, the values referenced by y or [ . . . ] have attribute names whose first character is @ (at
sign) and whose second character is y or a character in the string [ . . . ].
%Ux
or %U[ . . . ]
Indicates to the piobe command that the x flag (or each flag in the string [ . . .]) is actually
referenced even though it is not referenced by a pipeline; for example, the x flag may be
referenced by a printer command instead of by a filter in a pipeline. This prevents the piobe
command from rejecting the flag when specified on the command line.
69
Identifies the message catalog where the attribute description is stored. The message
catalog ID can take any of three forms:
v Null string: The string value for the mD attribute is assumed to be the file name of the
message catalog (for example, mydescriptors.cat).
v One character: An abbreviation for pioattr. x.cat , where x is the one-character catalog ID.
This form of the catalog ID is normally used only by the operating system.
v Catalog file name: The file name of the message catalog (for example,
mydescriptors.cat).
Either the one-character form or the catalog file name form of the catalog overrides the
catalog file name specified with the mD attribute.
Message number
Identifies the message index in the catalog that contains the description of this
attribute. Leading zeros are ignored.
Attribute name
Specifies two characters, except for group header attributes, which are five
characters.
Limits field
Specifies limits for the attributes.
Attribute value string
Specifies zero to 1000 characters.
The attribute name is _w, the attribute value string is 80, and the attribute description is stored in
message number 23 in the message catalog specified by the mD attribute.
Note: All attribute descriptions are stored in message catalogs. If an attribute has the same description
for multiple printers, the attribute in each printers database can reference the same catalog and message
number. If the same attribute name has a different description for different printers, separate message
numbers are used.
70
v Attribute names for group headers begin with _ _ (two underscores) and must not be longer than five
characters. A group header attribute (formerly called a comment attribute) marks the beginning of a
group of related attributes. For example, the group header attribute _ _FLG marks the beginning of a
group of attributes that define the default values for command line flags. The grouping of attributes is
for readability purposes and does not affect how the attributes are processed.
v An attribute name beginning with _ (an underscore), except for group headers, can be overridden by a
command line flag of the same name as the second character of the attribute name. For example, -w
132, specified with the qprt command, overrides with a value of 132 the value specified for the _w
attribute in the colon file.
@2
@3
@4
@5
Always a null string. This attribute name can be used wherever an attribute name for a null string is needed.
A string containing the full path name of the file being printed. This attribute name is available only to attributes that
define pipelines and attributes included by pipelines. The file being printed will be a temporary file if the -c flag is specified
with the qprt command.
An integer containing the number of bytes to be passed through when %x is found in a command string by the piocmdout
subroutine (obtained from the passthru parameter passed to the piocmdout subroutine).
An integer value indicating how the printer is attached:
0
parallel
2
serial
The full path name of the pio directory whose subdirectories (burst, etc, fmtrs, fonts, predef, trans1, and trans2) contain
STATIC data files and utility programs used to configure virtual printers and process print jobs. The directory must be a
subdirectory of the directory containing the piobe command invoked by the qdaemon. The value for @4 is normally the
/usr/lib/lpd/pio directory.
The full path name of the pio directory whose subdirectories (custom, ddi, dev, and flags) contain DYNAMIC data files
used to configure virtual printers and process print jobs. The value for @5 is normally the /var/spool/lpd/pio directory.
The following attribute names are used for communicating from the piobe command (the print job
manager) to the pioout command (the device driver interface program). The attribute values are
referenced by flag arguments passed to the device driver interface program as specified in the pipelines.
@A
@B
@C
@D
@I
@O
@P
@S
71
First
First
First
First
First
First
Default state of the colon file when in the /var/spool/lpd/pio/custom/* directory (+ means expanded, ! means contracted).
Name of the colon files parent colon file. The parent colon file is assumed to be in the /usr/lib/lpd/pio/predef/*
directory.
Current state of the colon file (+ means expanded, ! means contracted).
First character is y
character
character
character
character
character
character
character
character
is
is
is
is
is
is
is
is
s
d
m
w
c
a
e
t and second character is 0-9
Attribute values
Conventions have been established for attribute values.
The following conventions have been established for attribute values:
v Printer names are of the form 4201-3, reflecting the printer name (4201) and model number (3).
v File names in the Predefined Database are of the form PrinterType.DataStreamType; for example,
4216-31.asc indicates a 4216 Model 31 printer and an ASCII data stream.
v File names in the Customized Database are of the form QueueName:QueueDeviceName, such as
proq:mypro.
v Attribute values can contain a \ (backslash) followed by one to three octal digits to represent
non-ASCII values. A \ (backslash) that does not begin an octal sequence should be represented by
either \\ or \134.
v Characters can be represented by hexadecimal notation of the form \xXX, where XX represents a
hexadecimal value.
v Boolean values can be represented by a + (plus sign) for true, and an ! (exclamation point) for false.
v Because attribute values reside in colon files, a colon character must not appear in the attribute value.
Instead, a colon should be represented by \072.
v An attribute value that references an integer attribute requiring translation from a lookup table should
always appear in a colon file after the referenced integer attribute: For example, from the string red to
an equivalent integer value of 2. Integer values are created from a colon file in the same order they are
defined in the colon file. Listing the attribute value first ensures that when the integer attribute is
referenced, it has been converted before it is referenced by the %G escape sequence.
72
op_type
multi_select
disp_values
aix_values
values_msg_file
v values_msg_set
v values_msg_id
v help_msg_id
v help_msg_loc
Validation information
Validation information validates attribute values when the colon file is complete and a print job is
submitted.
73
#include <stdio.h>
#include <piostruct.h>
/* STRING CONSTANTS */
/* Initialize Printer, Restore Printer, Form Feed */
#define INIT_CMD
"ci"
#define REST_CMD
"cr"
#define FF_CMD
"af"
/* INTEGER and STRING VARIABLES */
/* page length, page width, top margin, bottom margin */
#define Pglen
(*(_Pglen + piomode))
#define Pgwidth
(*(_Pgwidth + piomode))
#define Tmarg
(*(_Tmarg + piomode))
#define Bmarg
(*(_Bmarg + piomode))
/* indentation, begin
#define Indent
#define Beginpg
#define Do_formfeed
#define Passthru
74
75
Use an editor to create an exports file named sample.exp. The file should contain the following:
#!
setup
initialize
passthru
restore
lineout
Status file
Each queue and its associated queue has a status file.
When the qdaemon process invokes a backend (see the qdaemon for more information), it passes the
following parameters, in order:
1. The parameters appearing in the /etc/qconfig file. See the /etc/qconfig file for more information.
2. The flags that the enq command (see the enq for more information) did not recognize, in the order
they were given. These flags will be preceded by the -o option on the command line.
3. The names of one or more files to be printed.
There is a status file for each device and its associated queue. These files are found in the
/var/spool/lpd/stat directory.
The status file provides a means of communication for the qdaemon process and the backend. The
qdaemon passes information such as the date of the file, whether to print burst pages, and the number of
copies to be printed. The backend passes back the charge for the job it has just finished running. In
addition, the backend periodically updates the number of pages it has printed and what percent of the
job is finished. This information is read by the qchk command. See the qchk for more information.
Note: Backends should never explicitly write into their status file. They should call the libqb library
routines to do this.
76
This routine should be called to initialize the status file interface. The log_init routine, like all log_
routines in the library, returns a value of -1 if it fails.
The enq command passes the information to the qdaemon process, which puts it into the status file.
Backends should get the information by calling the get_copies routine, which returns the total number of
copies requested. See Backend Routines in libqb on page 81 for more information.
77
For more information about job accounting, see Print spooler on page 43.
Exit codes
When a backend exits, the exit code is examined by qdaemon for information such as whether the job
completed successfully and whether the device is still usable.
When a backend exits, the qdaemon looks at its exit code for such information as whether the job was
completed successfully and whether the device is still usable. Therefore, it is important that backends use
the same convention for their exit codes. The backend should use #include <IN/standard.h> for the
values of the codes given here.
The permissible exit codes are:
EXITOK
EXITBAD
EXITERROR
EXITFATAL
EXITSIGNAL
EXITWARN
No problems encountered.
The parameters could not be acted upon. Two common examples are a flags not being valid or a file that
could not be opened. The qdaemon sets the state of the device (displayed by qchk) to OFF, sends a message
to the console, and does not run any further jobs on that device until someone has explicitly set its state to
ON again (with an enq -Pqueuename -U command).
The backend could not finish printing the job. The qdaemon restarts the same job from the beginning on the
same device. The qdaemon enforces a limit on the number of times the job will be restarted.
The job could not be finished because of a problem in the device that requires manual intervention. The
qdaemon sets the state of the device (displayed by qchk) to OFF, sends a message to the console, and does
not run any further jobs on that device until someone has explicitly set its state to ON again (with an enq
-Pqueuename -U command).
The backend was interrupted by a SIGTERM signal (#include <signal.h>).
The backend has issued a warning to the qdaemon. The job may or may not be completed successfully, but
in either case, when the qdaemon receives an EXITWARN from the backend, qdaemon returns a message
explaining the problem.
sysnot routine
The backend can send messages directly to the user with the sysnot routine.
The sysnot routine can either mail the message to the user or write the message to the users terminal.
The sysnot routine is called with the following syntax:
sysnot(user, host, message, pref)
char *user;
char *host;
char *message;
unsigned int *pref;
The value of the pref parameter should be DOMAIL or DOWRITE. DOMAIL mails the error message to
the user. DOWRITE writes the message to the users terminal if the user is logged on. If the user is not
logged on, the message is mailed to the user. The DOMAIL and DOWRITE constants are defined in the
/usr/include/IN/backend.h file.
78
Pipes
The backend can send messages to the user by sending the message to a print supervisor by way of a
pipe. This mechanism provides a one-way communication path between the printer backend and the
print supervisor.
The print supervisor must open an unnamed pipe and obtain two file descriptors, one for read operations
and one for write operations. The print supervisor must export the write end in the PIO_IPCWRITEFD
environment variable before calling the printer backend with the fork and exec subroutines. If the
PIO_IPCWRITEFD environment variable is set, the printer backend writes any messages to the write end
of the pipe.
The print supervisor typically calls the select subroutine to poll the read side of the pipe for incoming
messages. In addition to checking for exit status of the printer backend using the waitpid subroutine, the
print supervisor polls for I/O on the pipe. The print supervisor sets up a signal handler for the
SIGCHLD signal and performs a block read on the pipe. The signal handler examines the exit status of
the printer backend and performs any action necessary. When no unread messages remain on the pipe,
the print supervisor closes the pipe and proceeds to other cleanup work.
Message Format
Each message sent by the printer backend consists of a message header frame, zero or more parameter
header frames, a fully expanded message, and text consisting of zero or more parameters.
The message header specifies the message type, message catalog information, length of expanded
message text, and the number of variable message parameters. The variable message parameters are used
to build the expanded message text from the basic message text that is extracted from the message
catalog. The structure formats for the message header and the message parameter header frames are
defined in the /usr/include/piostruct.h file.
When extracting messages from the pipe, the print supervisor reads the message header frame, then
reads the message parameter header frames (0-9, as specified by the number of parameters specified in
the message header frame). The print supervisor reads the expanded message text, the length of which is
specified in the message header frame, followed by the parameters (if any). The type and length of any
parameters are specified in the individual message parameter header frames.
The type of message is specified in the message header frame. The message types are as follows:
v ID_VAL_EVENT_ABORTED_BY_SERVER
v ID_VAL_EVENT_WARNING_RESOURCE_NEEDS_ATTENTION
The actual message text is in expanded format. The parameters are placed in the message text after the
parameters are extracted from the message catalog file in the servers locale. The print supervisor can use
the message text or build its own message text from the supplied message catalog information and the
message parameters. However, the printer backend cannot provide message catalog information (message
number, set number, and catalog name) and variable message parameters in all cases. Therefore, the print
supervisor must check for the catalog name field (pm_catnm field) to determine if the catalog name is a
null string. If the catalog name is a null string, the print supervisor must use the supplied expanded
message text.
If a catalog name is provided, the print supervisor can extract the message from the catalog and place
any supplied message parameters in the message. The message parameters can be integer or string type.
However, message parameters are passed from the printer backend as strings concatenated to the
expanded message text. If the print supervisor extracts the message from the specified catalog and places
the parameters in the message, the following conventions apply:
79
v Parameters can be integer or string type, but are always passed in the pipe as strings with a trailing
NUL character. The length of each parameter in string format is supplied in the parameters associated
header frame.
v Extracted messages can contain escape sequences recognized by the printf subroutine. Therefore, while
populating the message, the print supervisor checks for escape sequences such as %s, %d, and %c, and
converts the parameters accordingly. Positional parameters are sometimes specified by using %n$s or
%n$d. In such cases, the print supervisor fills in the parameters in the specified order.
v A maximum of nine parameters can be specified. Therefore, the print supervisor can use nine variables
of *char type and assign the variables to the appropriate supplied parameter strings. After replacing all
positional specifiers and integer specifiers, the parameters can be passed to the printf subroutine. For
example, the extracted message text might contain the following:
Error %8$d in opening %6$s file
The print supervisor assigns the first variable parameter pointer to the eighth parameter, the second
variable parameter pointer to the sixth parameter, and the remaining variable parameter pointers to
null strings. The print supervisor then calls the sprintf subroutine or a similar subroutine and passes the
nine variable parameter pointers as parameters to the function.
v The printer backend specifies the correct type (integer or string) for each parameter, even though all
parameters are passed in the pipe as strings. The appropriate type must be used for handling field
width and precision when placing a parameter in an extracted message.
v The printer backend may or may not pass message catalog information and parameters for a message.
Therefore, the print supervisor must be able to accept the expanded message itself, or accept the
catalog information and parameters and then build the message accordingly.
Queue states
The qchk command displays the status of a particular device.
One of the entries in the table that is displayed shows the current state of the queue. This information is
taken from the status file. See /usr/include/IN/backend.h in your status file for a list of valid queue
states and their explanation.
Normally, the qdaemon keeps the status file updated. However, some backends may want to set
explicitly the state to WAITING (#include <IN/backend.h>) if they can no longer send output to the
device, and set it back to RUNNING when output resumes. For example, a backend that paused at the
end of each page, waiting for user response, might want to set the status to WAITING during this time.
The log_status(status) routine can be used to change the status of the job from RUNNING to
WAITING and back again. For more information, see Backend Routines in libqb on page 81. The
parameter is the new status.
In the case of a DEV_WAIT state on a queue device, issue enq -U -Pqueue to attempt to get the queue to
a state of readiness. If this does not work move all the jobs in that queue and issue enq -G in order to
flush the other queues and bring down the qdaemon. Then restart the qdaemon.
80
First, the backend cannot do anything special about SIGTERM, in which case the signal stops the backend
process immediately. This option is the simplest, but it does not allow the backend to do any cleanup
(reset line speeds, put paper at top-of-form, hang up the phone) before it terminates.
Second, the backend can catch SIGTERM, carry out whatever cleanup tasks are required, and exit
EXITSIGNAL (#include <IN/standard.h>). The special exit code tells the qdaemon that the job was
canceled.
Backends that decide to catch SIGTERM should exit very soon after receipt of the signal.
See the qcan command and the qdaemon command for more information.
get_cmd_line()
get_copies()
get_device_name()
get_feed()
get_from()
get_header()
get_job_number()
get_mail_only()
get_qdate()
get_queue_name()
get_title()
get_trailer()
get_to()
get_was_idle()
81
put_header(fnaddr,width)
Prints a header page with no following form-feed and returns the number of lines
printed. The fnaddr and width parameters are optional.
int (*fnaddr);
The fnaddr parameter defines the format subroutine used to display
characters on the header page. The default is the putchar subroutine.
put_trailer(user,fnaddr,width)
int *width;
The width parameter defines the width of the form. The default value for
the width parameter is 80.
Prints a trailer page for user with no following form-feed and returns the number of
lines printed. The fnaddr and width parameters are optional.
char *user;
int (*fnaddr);
The fnaddr parameter defines the format subroutine used to display
characters on the header page. The default is the putchar subroutine.
sysnot(user,host,message,pref)
int *width
The width parameter defines the width of the form. The default value for
the width parameter is 80.
Sends a message to the user if the backend cannot run a job.
char *user;
char *host;
char *message;
unsigned int *pref;
The value of thepref parameter indicates whether to mail the message to the
user or to write the message on the users terminal. The valid values
defined in the /usr/include/IN/backend.h file are:
DOMAIL
Mails the error message to the user.
DOWRITE
Writes the message to the users terminal if the user is logged on.
If the user is not logged on, the message is mailed to the user.
82
The To attribute specifies the combination of the process and output code:
Process_code_set [Output_code_set0, Output_code_set1,
Output_code_set2, Output_code_set3,... ], ...
All characters of the character set ID (CSID) are printed using ROM fonts when an output code set is
specified for each CSID. Otherwise, bitmap images from the Xwindows font are used. The type of
Xwindows font files, including the font image of each CSID, is selected by reading a file from the
/usr/lib/X11/nls directory.
83
The CP at code point 252 means that the code point should be copied with no change. The SC at code
point 253 means the character is not defined in the intermediate code page and so a substitute character
should be printed instead. The 126 at code point 254 means that code point 254 should be translated to
code point 126.
The -X flag in the qprt command specifies the print files code page name. When this value is 123, the
formatter reads the table from the /usr/lib/lpd/pio/trans1/123 file and uses it for stage-1 translation.
84
The {63} at code point 252 means that code point 252 should be translated to code point 63 before being
sent to the printer. The {CP} at code point 253 means that code point 253 should be sent to the printer
with no translation. The {94,1} at code point 254 means that code point 254 should be translated to code
point 94 before it is sent to the printer. The ,1 in {94,1} indicates that the printer command string whose
2-character attribute name is at index 1 in the Command Names array should be sent to the printer
before sending the code point. The SC at code point 255 indicates that the character at code point 255 in
the intermediate code page cannot be printed by the printer code page described by this stage-2
translation table.
iconv
When an input or an output code set is not supported by the iconv subroutine, the unsupported code set
translates one of the code sets that are supported or directly to a process code set using the translation
tables found in the /usr/lib/lpd/pio/transJP directory. Users with root authority can add new code sets
for printers by creating translation tables.
The naming convention for new translation tables is FromCodeSetName_ToCodeSetName. All translation
tables must be defined in the trans_dir file. The f_cp from code point in a translation table must be
sorted in alphabetical order in advance.
The trans_dir and codeset.alias files are in the /usr/lib/lpd/pio/transJP directory. The trans_dir file
format is:
FromCodeSetName ToCodeSetName NameofTranslationFile
Code set aliases are defined in the codeset.alias file. The codeset.alias file format is:
CodeSetName AliasName ...
For example, to print an MBCS file that was written with a new code set on an IBM-943 printer, use the
following steps:
1. Create a translation table in the /usr/lib/lpd/pio/transJP directory. The naming convention for the
new file is NewCodeSetName_IBM-943.
2. Define the translation table in the trans.dir file. The format to define a new code set named
NewCodeSet is:
newcodeset IBM-943 newcodeset_IBM-943
85
The -I flag follows a font path to find the Xwindow fonts and creates the _I attribute entry. The colon file
format for the _I attribute is:
::_I::/usr/lib/X11/fonts/JP,/usr/lib/X11/fonts
If you specify another font path with the qprt -I command, the printer backend looks in the specified
font path not in the default paths listed in the _I colon file. If the -I option has a null value, the backend
assumes the default /usr/lib/X11/fonts directory.
To specify a specific Xwindows font file using a full path name, font alias, or XLFD, enter:
$ qprt -F '*-27-*-ibm_udcjp' foo.txt
$ qprt -F IBM_JPN17
The following example directs the MBCS printer backend to look in the fonts.alias and fonts.dir files
to find the appropriate fonts for the code set specified with the -X option of the qprt command.
*/
*/
*/
*/
*/
*/
*/
*/
86
For example, when the Add a Print Queue menu option is selected from a SMIT dialog screen, the first
information required from the user is which attachment type is being used. The user selects the desired
attachment type, and SMIT searches the attachment type file to discover which SMIT object ID file to
branch to.
SMIT selectors and dialogs for new printer attachments must create dialogs that add, change, and remove
a print queue for the new attachment type. The names of the new SMIT dialogs are placed in the
attachment file. The dialog names in the file are automatically branched to when creating, changing, or
removing queues for the new attachment type.
The Attachment_type string must contain a unique string that identifies the attachment. All attachment
files must be located in the /usr/lib/lpd/pio/etc directory. The following attachment files are supplied:
local.attach
ascii.attach
file.attach
remote.attach
The following field names have special meanings in the attachment file:
v description
v seq_num
v supported
v unsupported
The following field names define SMIT selector IDs. The Value variable must contain a SMIT selector ID.
The selector ID value of each field specifies the target of the branch. The SMIT fields are:
v submit_job
v add_queue
Printers and Printing
87
v
v
v
v
v
add_printer
remove_queue
printer_conn
change_queue
change_filters
Every attachment file should contain the description, add_queue, and remove_queue fields. All other
fields are optional. Fields with a null value are treated as if the field were missing. There is no restriction
on the other contents of an attachment file.
The following example attachment file is named term_serv.attach:
description = term_serv.cat,1,3; Printer Attached to Terminal Server
seq_num = 2
submit_job = term_serv_start_job
add_queue = term_serv_add
add_printer = term_serv_printer
remove_queue = term_serv_remove
printer_conn = term_serv_printer_conn
change_queue = term_serv_change
change_filters = term_serv_change_filters
unsupported = ibm6252,ibm6262
Specifies the description string that appears on the SMIT Attachment type menu. The SMIT
Attachment type menu lists all supported attachment types on the system. This field is required
in order for the attachment type to appear on any list of supported types.
The format of the description field value is:
Message_catalog,Set,Message_#; DefaultTextString
Values for Message_catalog, Set, and Message_# are not required. For example, the two following
example entries create the same menu item in SMIT. The first example uses the term_serv.cat
message catalog, set number 1, and message number 3. If the message cannot be found, SMIT
uses the default text in quotes. In the second example, no message catalog is designated, and the
quoted message is used in the menu automatically:
description = term_serv.cat,1,3; Printer Attached to Terminal Server
seq_num
supported/unsupported
submit_job
88
add_queue
add_printer
remove_queue
printer_conn
change_queue
change_filters
Specifies the name of the SMIT selector ID to branch to in order to add a print queue. For
example, to branch to the term_serv_add selector ID from the Add a Print Queue menu option,
enter:
add_queue = term_serv_add
Specifies the name of the SMIT selector ID to branch to in order to add a printer to an existing
queue. Functionally, this adds an additional queue device to an existing queue. To branch to the
term_serv_printer selector ID from the SMIT Existing Print Queue menu option, enter:
add_printer = term_serv_printer
Specifies the name of the SMIT selector ID to branch to in order to remove a print queue. The
Remove dialog screen removes any other queues, queue devices, virtual printers, and printer
devices that were created at the time the print queue was created. To branch from the Remove a
Print Queue menu option to the term_serv_remove selector ID, enter:
remove_queue = term_serv_remove
Specifies the name of the SMIT selector ID to branch to in order to change the printer connection
characteristics of a print queue. The port communication characteristics would typically be baud
rate, parity, stop bits, and so on. To branch to the term_serv_printer_conn selector ID from the
SMIT Printer Port Communication Characteristics menu option, enter:
printer_conn = term_serv_printer_conn
Specifies the name of the SMIT selector ID to branch to in order to change the characteristics of a
printer queue. To branch to the term_serv_change selector ID from the SMIT Change/Show Print
Queue Characteristics menu option, enter:
change_queue = term_serv_change
Specifies the name of the SMIT selector ID to branch to in order to change the pre-processing
filters defined for a print queue. To branch to the term_serv_change_filters selector ID from the
SMIT Change/Show Pre-Processing Filters menu option, enter:
change_filters = term_serv_change_filters
entry_type
cmd_to_list_mode
required
op_type
multi_select
cmd_to_list_mode
disp_values
v aix_values
v values_msg_file
v values_msg_get
v help_msg_id
v help_msg_loc
Printers and Printing
89
These attributes can be set to be displayed always, never, or only if the attribute is referenced in the
pipeline. For detailed descriptions of these fields, seesm_cmd_opt (SMIT Dialog/Selector Command
Option) Object Class in AIX 5L Version 5.3 General Programming Concepts: Writing and Debugging Programs.
The validation information is used to validate attribute values when the colon file is digested and when a
print job is submitted.
Information in the limits field has two components. The first component is a single letter operator
specifying an action. The letter value can be one of the following values: C, D, E, F, G, H, I, L, M, Q, R,
S, T, or V. The second component is the data. If the data is more than one character, it should be
enclosed in square brackets ( [ ] ).
For example, if the limits field contained E#, the sm_cmd_opt object class entry_type field equals the
numeric value assigned to #. The entry_type field with a E# value takes only numeric input.
In another example, when the limits field contains [none,full,emulator=0,1,2] then the sm_cmd_opt
object class contains the following values:
Field Name
Values
disp_values
aix_values
0,1,2
The limits field operators provide the following types of control in SMIT:
v Attribute display
v Characteristics of the field representing the attribute
v Attribute validation and the type of auxiliary operations (for example, pop-up menus or ring lists)
For example, in the qprt and admvirprt SMIT dialogs, the following rules apply:
v If Dy (the limits operator D with a value of y for yes) is specified in a limits field for an attribute,
then that attribute is always displayed.
v If Dn (the limits operator D with a value of n for no) is specified in a limits field for an attribute, then
that attribute is never displayed.
In qprt SMIT dialogs, the following additional rules apply:
v All attributes defined in the printer colon file that begin with a _ (underscore; for example, _j and _i)
that are referenced in the pipeline are displayed.
v All attributes defined in the printer colon file that begin with a C combination flag (for example, Cs
and Ca) and have their combination value referenced in the pipeline are displayed.
Rules specific to the admvirprt SMIT dialog are as follows:
v All attributes defined in the printer colon file beginning with either an _ (underscore) or a C
combination flag are displayed, unless Dn is specified in their limits field.
90
multi_select
cmd_to_list_mode
disp_values
aix_values
values_msg_file
v values_msg_get
v help_msg_id
v help_msg_loc
These attributes can be set to be displayed always, never, or only if the attribute is referenced in the
pipeline. For detailed descriptions of these fields, seesm_cmd_opt (SMIT Dialog/Selector Command
Option) Object Class in AIX 5L Version 5.3 General Programming Concepts: Writing and Debugging Programs.
The validation information is used to validate attribute values when the colon file is digested and when a
print job is submitted.
Display operators:
Display operators define how multiple flags relate within the SMIT dialog, how the options for the flags
are displayed, and what flags and options are available.
C
To support interdependent flags (for example, flags that affect typestyle and pitch), combinations of flags must be used.
Typically, there is a single match between a SMIT dialog field and a command line flag. The combination flag operator
allows one field in a SMIT dialog to represent more than one command line flag. Referenced flags should be marked as
non-display (Dn) type for SMIT dialogs, so that only the combination flag is displayed instead of the individual flags.
The C operator syntax is:
C[xx,yy,...]
The xx and yy values are flag attributes. When a C attribute is defined, the limits field must also contain an R ring
operator to define the popup list that is displayed to SMIT users. The R operator also defines how the options on the list
map to command-line flags.
:111:Cs:C[_s,_p]R[Courier 10, Prestige 12= -s Courier
-p10, -s Prestige -p12]):-s %I_s -p %I_p
:999:_s:Dn:Courier
:222:_p:Dn:10
In this example, the C operator defines that the -s and -p flags are combination attributes. The R ring defines that when
the Courier 10 option is chosen from the pop up menu, the flags on the command line are -s Courier -p10. The -s %I_s
-p%I_p attribute value is resolved when the SMIT dialog is built and determines which item in the ring is displayed as the
default.
91
Designates the display mode. If the value is y, an object is built in the sm_cmd_opt object class. If the value is n, no object
is built. The D operator allows programmers to suppress certain flags from being displayed in SMIT. If this operator is not
specified, the object is built if the flag is referenced in the input pipeline.
Designates the sequence number in the id_seq_num field of the sm_cmd_opt object class. The sequence number controls
the position of the item in relation to other items in the dialog screen. If no S operator is specified, the dialog starts with
the ID number 100, and items are numbered in the sequence they are found in the colon file.
The value for the S operator can be a string with a maximum length of 16 characters. For example, the following S
operator entry places the item in position 100:
:100:_1:S[100]:60
Controls the entry_type field of the sm_cmd_opt object. The possible values for the E option are:
#
Indicates that a file entry is allowed. A valid file name must be specified.
To allow numerical entry into the SMIT dialog field, enter the following:
Q
:100:_L:E#:60
Controls the value of the required field of the sm_cmd_opt object. The required field determines if the field value should
be sent to the cmd_to_exec command for this dialog.
A single character specifies the value type. The default value is n which means that the flag and value for the sm_cmd_opt
object is passed only if the field value is changed. The following are the possible values for the required field:
n
Represents no. Do not send flag unless user changes the initially displayed value. The n value is the default.
Represents yes. Always sends the prefix field and value of the entry field even if it is null.
Send the prefix field and value. The value must contain 1 non-blank character.
Always send the prefix field and values except when the value is null.
To ensure that the prefix field and the value of the entry field is always sent to cmd_to_exec, enter the following:
:100:_L:Qy:60
92
Allows control of the cmd_to_list_mode field of the sm_cmd_opt object. The cmd_to_list_mode field specifies how much of
an item from a list should be used. The list is produced by the command specified in the cmd_to_list field object. For
example, if the cmd_to_list field produced the following list:
60 (6 line per inch)
80 (8 line per inch)
66
Possible values for the F operator are:
a
To instruct SMIT to retrieve the first field from the list, enter:
G
:100:_l:F1:60
Specifies a range list. The G operator gives the cmd_to_list_mode an r value. The r value specifies that the information
displayed by the cmd_to_list field is a range of information rather than a list.
Validity checking is always done on a range. The data in a range list is in the form of x..y (1..30) or ..y (..30) or x.. (1..)
where x and y are integers and specify the upper and lower bounds of a range. Validity checking ensures that the attribute
value is in the range specified. The integer can be negative; however the upper bound (y value) must be greater than or
equal to the lower boundary (x value). To designate that the field list operation is a range between 50 and 100, enter:
:100:_l:G[50..100]:60
Specifies the message catalog specification for help text for a corresponding attribute. The message catalog specification
includes message catalog name, set number, and message number. The help text is used in SMIT dialog that use the
attributes for which help is assigned.
To assign help to a flag, -b, from the pioattrl cat dialog, enter:
:100:_b:H[pioattr1.cat,5,123]:60
Specifies the publication specification for help text for a corresponding attribute. The publication specification includes
values for the help_msg_id, help_msg_base, and help_msg_book fields in the sm_cmd_opt SMIT object class. The help text
is used in the SMIT dialog that uses the attributes for which help is assigned.
To assign help to a flag, -b, from the publication specification, enter:
:100:_b:I[100145]:60
Specifies that a pop-up list is displayed when the user selects F4. The pop up list allows users to select only one option
from a given list of options. The pop up list is constructed from the cmd_to_list field values. The op_type field value for a
pop up menu is l (lowercase L).
Validity checking is done only when typed user input is prohibited. The entry type for a field that does not allow direct
user input is n. The cmd_to_list field returns a newline-separated list. The values from that list are compared with the
attribute value.
The possible values for the L operator are the shell command strings for the cmd_to_list field. The list generated from the
command is a list of output values separated by newline characters. For example:
:100:_l:L[print "50\n55\n60\n65"]:60
Specifies a multi-select list which allows users to select more than one value from a given list of options. The M operator
works exactly like the L operator list except that the multi-select field must be set to an m value.
An example of a multi-select list operator entry is:
:100:_l:M[print "50\n55\n60\n65"]:60
93
Specifies an option ring type of list. The op_type field is set to r. A ring list differs from a regular list in that the user can
continue to display list options by pressing either the tab (forward) or backtab (reverse) keys. When a ring list reaches the
bottom of the options, it recycles to the top of the list. The ring list recycles in forward or reverse. A ring list becomes a
regular list when the F4 key is pressed.
The option ring operator can control the disp_values, aix_values, values_msg_file, values_msg_set, and value_smg_id
fields. The no message ID, just a message ID, message set and ID, or message set, catalog and ID are valid in a ring option
list.
Validity checking is done if direct entry by the user is prohibited with the entry type value set to n. The ring has hardcoded
values that are either stand-alone or are mapped to the base operating system values.
An example of stand-alone values would include a list of possible baud rates (1200,2400,9600,19200) where the rate values
themselves are used as the flag arguments.
An example of mapped values would be an attribute to designate which paper drawer on the printer is to be used. In this
example, the three possible display values are lower drawer, upper drawer, and envelope feed. These possibilities are
mapped to the base operating system flag operands 0,1,2. The base operating system values are passed to the executed
command.
Validity checking verifies that the attribute value is within the set of hardcoded values. The following examples illustrate
several types of option ring lists:
:100:_l:R[0,1,2]:0
:100:_l:R[none,full,emulator=0,1,2]:0
:100:_l:R[;none,full,emulator=0,1,2]:0
:100:_l:R[21,none,full,emulator=0,1,2]:0
:100:_l:R[1,21;none,full,emulator-0,1,2]:0
:100:_l:R[pioattr9.cat,1,21;none,full,emulator=0,1,2]:0
Allows multiple selections to be made from a pop up list and works identical to the R operator. The multi-select field
equals m.
To allow multiple choices to be made from a pop up menu, enter:
:100:_l:T[none,full,emulator=0,1,2]:0
Specifies additional validation for any attribute. The V operator does not affect how an ODM stanza is built for an attribute.
The data specified with the V operator is colon file type code (% operators). The % operators do the validation. The colon
file code resolves to one value. The value is either 0 or non-zero. If the resolved value is 0, then the attribute value is valid.
If the value is non-zero, then the attribute value is invalid.
To verify that the value of _l is in the range 0 to 100, enter:
:100:_l:V[%?%G_l%{100}%>%t1%e%?%G_l%{0}%<%tl%e0%;%;]:60
94
4. Display the output from the lsvirprt command, either in another window or as a hardcopy printout,
and compare the attribute descriptions and values to those of the printer you are adding. Determine
the changes to be made.
5. Copy the printer colon file from the Predefined Database directory (/usr/lib/lpd/pio/predef) to the
Customized Database directory (/var/spool/lpd/pio/@local/custom).
6. Change the attribute values in the colon file as described in Adding a New Printer Type in AIX 5L
Version 5.3 Kernel Extensions and Device Support Programming Concepts. These will include the printer
type (mt attribute), the printer description (mL attribute), and the printer-emulation mode (ep
attribute).
7. Run the chvirprt command, specifying the queue name and the queue device name with no attribute
values. This action causes a digested version of the virtual printer definition to be built.
8. Verify that the newly defined printer prints correctly.
9. If you want to create a predefined virtual printer definition, do so with the piopredef command.
%Sxx
%Lxx
Pushes a pointer to the current string value for the xx attribute onto the stack. The only operation that can be performed
on the string pointer is to use %= to compare the string with another string whose pointer is also on the stack.
Pushes the length of the xx constant or variable string onto the stack. For example, if the value of attribute ss is IJKLMN,
the sequence ABC%Lss%dDEFG produces the string ABC6DEFG. However, if xx is the attribute that contains the %Lxx
sequence, the length will be the length of that part of the string that has been constructed when the %Lxx is encountered.
For example, if the value of the st attribute is ABC%Lst%dDEFG, the constructed string for attribute st is ABC3DEFG.
If your printer is not supported, you can configure it as a supported printer that is functionally similar to
your printer. Otherwise, you can configure your printer as a generic printer. To do this, do one of the
following:
v Select Other as the printer manufacturer or printer model when adding a print queue for the printer.
v Select Other serial printer or Other parallel printer when adding a printer device definition for the
printer.
Supported printers:
The following is a list of supported printers.
v Bull Compuprint 4/51
v Bull Compuprint 4/54
v Bull Compuprint 914
v
v
v
v
v
v
v
Bull
Bull
Bull
Bull
Bull
Bull
Bull
Compuprint
Compuprint
Compuprint
Compuprint
Compuprint
Compuprint
Compuprint
914 N
922
923
924
924 N
956
970
95
v
v
v
v
v
Bull
Bull
Bull
Bull
Bull
Compuprint
Compuprint
Compuprint
Compuprint
Compuprint
PageMaster
PageMaster
PageMaster
PageMaster
PageMaster
200
201
411
413
422
v
v
v
v
v
v
v
Bull
Bull
Bull
Bull
Bull
Bull
Bull
Compuprint
Compuprint
Compuprint
Compuprint
Compuprint
Compuprint
Compuprint
PageMaster
PageMaster
PageMaster
PageMaster
PageMaster
PageMaster
PageMaster
721
815
825
1015
1021
1025
1625
v
v
v
v
v
v
Bull PR-88
Bull PR-88 VFU Handling
Bull PR-90
Canon LASER SHOT LBP-B404PS/Lite on page 147
Canon LASER SHOT LBP-B406S/D/E/G, A404/E, A304E on page 147
Dataproducts LZR 2665 Laser Printer on page 147
96
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
v
Lexmark
Lexmark
Lexmark
Lexmark
Lexmark
Optra
Optra
Optra
Optra
Optra
97
pass-through?
-c +
-l 64
-n +
-w 80
-r +
-i 0
indentation (columns)
-t +
-W !
-b +
send backspaces?
-C !
-f +
-e !
return on error?
-s 8
-N !
enable parity?
-S !
-P !
odd parity?
The -p parameter determines whether the printer device driver, /dev/lp0, will default to a pass-through
mode of operation; the mode of operation can be overridden for a specific data stream. By default, the
value of the -p parameter is !, or no. It is important to note that the question asked by the -p parameter is
Will the mode of operation be pass-through mode?
If the value of the -p parameter is !, then all of the other parameters listed are honored by the device
driver during data stream processing. Likewise, if the value of the -p parameter is +, or yes, then all of
the other parameters are ignored during data stream processing.
Using the splp command to change the parameter values of the printer device driver does not affect the
operation of the spooler. The splp command affects commands such as cat when they are used to access
the device driver directly, bypassing the spooler. For example, the command
cat /etc/motd > /dev/lp0
98
opens /dev/lp0 and writes the contents of the message of the day directly to the printer. The output on
the printer is formatted similar to the following example:
This is a test version of /etc/motd, used to demonstrate
what happens when a printer device driver, such as
/dev/lp0, is placed into or taken out of passthru mode.
Printers will print either exactly what they are sent,
if you set the job conditions up correctly, or, on the
most current printers, you may be able to direct the
printer to perform certain mappings for you.
There are no carriage returns in
this file, and the only blank line occurs
immediate before this one.
Notice that the -r parameter dictates the mapping of each linefeed to a linefeed and carriage return if the
value of -p is !. This is necessary as most UNIX-based operating systems only use linefeeds; unlike DOS
or OS/2 or other operating systems, in UNIX-based operating systems a linefeed implies a carriage
return. While this works well with text editors and in other similar situations, it does not work with
printers. Printers print only the data which they are sent. For example, issuing the two commands
splp -p+ lp0
cat /etc/motd > /dev/lp0
In the first example, all of the device driver settings are honored. In particular, the mapping of a linefeed
to a linefeed and a carriage return is turned on. When the device drivers are writing characters to the
physical printer, it sends a carriage return after each linefeed. It also honors the settings for page width.
In the second example, the device driver is limited to simply writing each single-byte character of
/etc/motd to the physical printer, without any mapping or other modification of the data stream
occurring. When the first sentence of /etc/motd ends, the linefeed drops the printhead straight down one
line; there is no carriage return to move the printhead back to the left margin. The first four letters of the
word printer, prin, are printed. At that point the printer itself, not the device driver, determines that the
right margin has been reached and so prints a carriage return, returning the printhead to the left margin.
Printing continues with the next character in the data stream.
In the second example, the job does not even print until the reset button on the printer is pressed. This is
because the printer has not received enough date (characters) to automatically eject a page, and no
formfeeds were sent to the printer to cause it to eject the page; the -f parameter on the device driver is
ignored.
Formatter filter pass-through mode:
After a job is submitted to the spooler it eventually passes to the formatter filter for processing and
delivery to the printer device driver. The formatter filter always opens the printer device driver in
pass-through mode.
After a job is submitted to the spooler it eventually passes to the formatter filter for processing and
delivery to the printer device driver. The formatter filter always opens the printer device driver in
Printers and Printing
99
pass-through mode.Jobs submitted to the spooler, as opposed to data streams that are sent directly to the
printer device driver, are always processed or otherwise modified by a formatter filter and not by the
printer device driver.
Like the printer device driver, the formatter filter also has two modes of operation: pass-through and
non-pass-through. Again, the mode of operation selected for a given job determines how or even if a data
stream is processed.
The _d attribute in a virtual printer definition (a digested colon file) specifies the input data stream type
for the queue associated with that virtual printer. The virtual printer definition also specifies the
formatter filter for that input data stream type. When the formatter filter is invoked to process a job, the
process that runs the formatter (pioformat) filter checks the value of the _d attributes and decides
whether to invoke the formatter filter in pass-through mode. If pass-through mode is selected, the
formatter filter uses the passthru() subroutine to read the input stream and send it unmodified to the printer
device driver. If pass-through mode is not selected, the formatter filter uses the lineout subroutine to
process the input data stream line by line. In either case, the printer device driver was opened for writing
in pass-through mode and performs no processing on the output data stream.
Note that input data streams such as PostScript are pass-through by definition; the processing is
performed by the Postscript interpreter hardware on the printer.
Most of the printer device driver parameters that one can display or modify using the splp command
also exist in the formatter filter. These parameters are stored in the digested version of the colon file for a
given virtual printer. For example, the mapping between the printer device driver parameters and the
corresponding parameters in the colon files for an ASCII queue on an IBM 4029 LaserPrinter is as
follows:
pass-through?
-p
_d
-l
_l
-w
_w
indentation (columns)
-i
_i
-W
_L
convert to uppercase?
-C
N/A
-c
_x
send linefeeds ?
-n
_x
-r
_x
-t
N/A
send backspaces?
-b
N/A
send formfeeds?
-f
_Z
The values of the parameters in the right column can be permanently set in the virtual printer definition.
They can also be overridden at the time a job is submitted by using certain flags on either the qprt or
enq commands.
Virtual printer definitions:
An IBM 4029 LaserPrinter supports four distinct data streams.
The root user can use the mkvirprt command to create both a queue and a virtual printer definition for
each of the four data stream types. The root user can further use the lsvirprt command to view and
modify the colon file underlying the virtual printer definition. For a system on which a queue of each
type has been defined, issuing of the lsvirprt command results in the following list and query being
displayed (queue names and device are chosen by the root user at queue creation time):
100
No. Queue
Device
Description
1
2
3
4
lxx
lxx
lxx
lxx
4029
4029
4029
4029
asc
gl
pcl
ps
(IBM ASCII)
(Plotter Emulation)
(HP LaserJet II Emulation)
(PostScript)
->
From this list, the root user enters the number corresponding to the virtual printer that he wants to view,
format, or modify. The following message and prompt are then displayed.
To
To
To
To
To
There are several options at this point, one of which is to press Enter and terminate the lsvirprt
command. The other options are as follows:
v Enter an asterisk (*) to view a list of all attributes in the colon file along with their text descriptions
from the message catalog.
v Enter the name of an attribute to view that attribute only, along with its text description from the
message catalog.
v Enter the name of an attribute, an =, and a value to assign the attribute that value.
v Enter a ~v to engage in a vi session with the raw colon file.
v Enter the name of an attribute, immediately followed (no blank spaces) by a ~v to engage in a vi
session with a heavily formatted version of the attribute.
Each of these five options will be discussed in the context of the asc queue and the associated virtual
printer definition with its underlying colon file.
Entering an asterisk (*) and pressing Enter will result in the following being displayed:
Name
__FLG
_0
_1
_2
_3
_4
_5
_6
_7
_8
_9
_A
_E
_F
_G
_H
_I
_J
_K
_L
_O
_Q
Description
VALUES THAT MAY BE OVERRIDDEN WITH FLAGS ON THE
COMMAND LINE
(not used)
(not used)
(not used)
(not used)
(not used)
(not used)
(not used)
(not used)
(not used)
(not used)
stderr returned? 0: no; 1: yes, & pipelines; 2:
yes, & values, pipelines
Double-High Print. (!: no; +: yes)
(not used) Font file name
Page format (!: use only printable page
+: use
entire addressable area)
Name To Replace Host Name On Burst Page
Font ID (overrides pitch and type style)
Restore the Printer at the End of the Print Job?
(!: no; +: yes)
(not used)
Wrap Long Lines (!: no; +: yes)
Type of Input Paper Handling (1: manual, 3:
sheetfeed)
Paper or Envelope Size For the Paper Source
Value
+
+
3
%IwQ
Printers and Printing
101
_S
_U
_V
_W
_X
_Y
_Z
!
IBM-850
0
+
The output is formatted by the pg command, hence the full colon (:) at the bottom of the display. The
output above is only the first full screen. The rest is available through the normal pg subcommands but
will not be displayed here for reasons of brevity. This output is view-only; the attributes cannot be
modified.
Entering the name of an attribute, such as _w (page width in columns), and pressing Enter will result in
something like the following being displayed.
Name
_w
To
To
To
To
To
Description
Page Width (characters); Default Value: %IwX
(value based on paper size specified with s0 s5 attributes)
Value
%IwX
The name of the attribute is displayed, along with its text description from the message catalog and its
current value. The prompt is also displayed again. Note that you do not have to type the underscore for
attributes whose name begin with an underscore. For example, the results above could have been
obtained by entering w. This output is view-only; the attribute cannot be modified.
Other attributes may be much harder to read in this form. For example, entering ia at the prompt and
pressing Enter will result in output similar to the following being displayed:
Name
ia
To
To
To
To
To
Description
ASCII
Value
%Ide/pioformat -@%
Idd/%Imm -!%Idf/pi
of5202 -l%IwL -w%I
wW %f[begijpqstuvx
yzEGIJLOQWXZ] %Uh
Entering the name of an attribute, an =, and a value, and pressing Enter will result in the attribute being
assigned that value, and the new value being displayed. For example, entering _w=60 and pressing Enter,
or entering w=60 and pressing Enter, will result in something like the following being displayed:
To
To
To
To
To
Name
_w
102
Description
COLUMNS per page
AIX Version 6.1: Printers and Printing
Value
60
To
To
To
To
To
The new value of w is displayed. (This example would result in the page width for this queue being
permanently set to 60 columns.)
Entering ~v and pressing Enter will result in something like the following being displayed:
:056:__FLG::
:625:CB:S[B]DyEn:
:626:CC:S[C]DyEn:
:627:CD:S[D]DyEn:
:628:CE:S[E]DyEn:
:629:CF:S[F]DyEn:
:630:CG:S[G]DyEn:
:622:Ca:DyS[G500]I[1810532]EnR[pioattr1.cat,1,631;(diag1) - do not print job; di
splay main pipeline and pre-processing filter,(diag2) - do not pr
int job; displa
y all pipelines and filters,(display) - print job; display all pi
pelines and fil
ters,(ignore) - print job; ignore stderr produced by filters,(nor
mal) - print jo
b; exit if filters produce stderr=-a1,-a0\x27 \x27-A3,-a0\x27 \x2
7-A2,-a0\x27 \x
27-A0,-a0\x27 \x27-A1]:%?%G_a%t-a%I_a%e-a%I_a\x27 \x27-A%I_A%;
:674:Cs:S[B005]I[1810500]EnC[_s,_p]R[%`W0]:-s%I_s\x27 \x27-p%I_p
:013:_A:DnEnR[0,1,2,3]:1
:789:_E:S[B020]I[1810501]%IWY:!
:790:_G:S[E025]I[1810502]%IWY:!
:621:_H:S[F350]I[1810503]Dy:
:024:_I:Dn:
:791:_J:S[C950]I[1810533]%IWY:+
:792:_K:Dn:
:793:_L:S[D020]I[1810504]%IWY:+
:697:_O:DnEnR[1,3]:3
:683:_Q:S[E020]I[1810505]En%IW6:%IwQ
:794:_W:S[B025]I[1810506]%IWY:!
:795:_X:S[D030]I[1810507]EtL[/usr/bin/ls -1 /usr/lib/lpd/pio/tran
s1 | /usr/bin/s
ed '/^850$/d']V[%`WX]:ISO8859-1
:808:_Y:Dn:
:614:_Z:Dn%IWY:+
:063:_a:DnEnR[0,1]:0
:635:_b:S[D010]I[1810508]E#G[0..%?%G_l%{0}%=%t%e%G_l%G_t%-%{1}%-%
d%;]:0
:658:_d:S[C925]I[1810509]EnL[%IW2]F1:a
:615:_e:S[B010]I[1810510]%IWY:!
:659:_f:S[C930]I[1810535]EtL[%IW3]F1V[%`W7]Dy:
:623:_g:S[C250]I[1810511]E#G[1..]:1
"/var/spool/lpd/pio/@local/custom/asc:lp1" 318 lines, 15318 chara
cters
As is indicated by the last line of this sample, this is a vi session with the raw, unformatted version of the
undigested printer colon file for this queue. If a write command is issued in this vi session, the definition
is digested by the piodigest command and a new version of the digested printer colon file is created.
The most powerful option in lsvirprt is to type an attribute name followed by a ~v. For example,
entering ia~v will result in something like the following being displayed:
ASCII
ia = %Ide/pioformat -@%Idd/%Imm -!%Idf/piof5202 -l%IwL -w%IwW %f[
begijpqstuvxyzEGIJLOQWXZ] %Uh
103
%Ide
INCLUDE: (Directory Containing Miscellaneous Modules)
'/pioformat -@'
%Idd
INCLUDE: (Directory Containing Digested Data Base Fil
es)
'/'
%Imm
INCLUDE: (File Name Of (Digested) Data Base; Init. By
"piodigest" (mt.md.mn.mq:mv))
' -!'
%Idf
INCLUDE: (Directory Containing Loadable Formatter Rou
tines)
'/piof5202 -l'
%IwL
INCLUDE: (Page Length In Chars, Using Length From Dat
a Base (used in pipelines))
' -w'
%IwW
INCLUDE: (Page Width In Characters, Using Width From
Data Base (used in pipelines))
' '
%f[begijpqstuvxyzEGIJLOQWXZ] For Each Flag x on Command Line: "
-xArgument" -> OUTPUT
' '
%Uh
Indicate to piobe: Pass the Following Attributes to s
ubsequent printer commands
/tmp/asc:lp1.ia" 24 lines, 1001 characters
As is indicated by the last line of the sample, this is again a vi session, but this time the attribute
definition has been formatted and annotated. Here the root user can modify the attribute definition; if a
write command is issued in this vi session, the definition is digested by the piodigest command and a
new version of the digested printer colon file is created.
The formatted sample is divided into three parts. The first part is the ia=, followed by the attribute
definition strung out horizontally. The second part is the annotations on the right-hand side of the vi
session, the comments that describe the function of each particular printer colon file escape sequence. The
third part is the formatted printer colon file escape sequences aligned on the left margin of the vi session.
These escape sequences also have a horizontal formatting component; indentations are used to clarify the
flow of if-then-else statements, nested or otherwise.
The first and second parts can be edited, but the editing changes have no effect and should therefore not
be performed. Any changes made to the initial definition of the attribute or to the annotations will be
ignored by piodigest if you write the file. It is the third part, the formatted attribute definition, that can
be edited. If this part is edited and written, piodigest will issue an error message if any syntax errors are
found. As with normal programming languages, you can make logic errors, but not syntax errors.
For practical examples of modifying printer colon files, see Modification of the mi, mp, and _d attributes
on a PostScript queue.
Modification of the mi, mp, and _d attributes on a PostScript queue:
The root user can modify the mi, mp, and _d attributes in the virtual printer definition so that the queue
backend can determine the file type (PostScript or non-PostScript ASCII) and set the print environment
accordingly.
Input data stream attributes store the pipelines for different input data stream types. For more
information, see Virtual printer input data stream attributes on page 59. The definition for a generic
PostScript printer has four input data stream pipelines: ia (extended ASCII), in (troff), ip (passthru), and
is (PostScript). The _d attribute in the colon file controls which of the four input data stream processing
pipelines will, by default, be used. The default value for _d on a generic PostScript queue is s
(PostScript), so the pipeline defined by is will be used.
104
The mi attribute uses single, comma-separated characters to name input data stream types. The mp
attribute uses comma-separated strings to identify input data stream types. There is a one-to-one pairing
between the characters of mi and the strings of mp.
The default value of mi for a generic PostScript virtual printer is s. The default value for mp is %%!; the
first two characters of a PostScript file are %!. (Recall that printer colon file escape sequences all begin
with a % so, to use a literal % in an attribute definition, it must be escaped with another %.) The virtual
printer will interpret all files beginning with %! as being of data stream type s, and use the is pipeline.
Because non-PostScript ASCII file do not begin with a %!, they will not be printed by this queue.
Submitting a non-PostScript ASCII job to a PostScript queue with a generic PostScript virtual printer
definition will result in the loss of the job. To enable ASCII printing on this queue, the root user can use
the lsvirprt command to modify the referenced attributes as follows:
v mi=a,s
v mp=,%%!
v _d=%mi
Use the lsvirprt command to select the generic PostScript queue. The following prompt will appear:
To
To
To
To
To
At the prompt:
v Enter mi=a,s.
v Enter mp=,%%!.
v Enter d=%mi.
After each attribute redefinition is entered, the attributes new value will be displayed, followed by the
prompt.
This new value sets up a pairing of input data stream type a (extended ASCII) with any string at all, and
input data stream type s (PostScript) with the string %!. Input data streams that do not being with a %!
will be processed by the ia pipeline, and all input data streams that do begin with a %! will be processed
by the is pipeline.
Note: With a generic PostScript virtual printer without the modifications described above, it is possible to
print non-PostScript ASCII files by overidding the input data stream type from the command line. For
example, the d flag of qprt can be used as follows:
qprt -Pqueue_name -da /etc/motd
This command requests that the file named /etc/motd be printed on the queue named queue_name and
that the input data stream be treated as ASCII (the ia pipeline will be used).
Printer colon file and the piobe command:
The piobe command is a spooler backend program called by the qdaemon program to process a print
job.
The piobe command can generate diagnostic output. A specific example of this diagnostic output is used
in the following discussion to examine these points:
v How piobe uses printer colon files.
v How printer colon file escape sequences are evaluated to resolve path names.
Printers and Printing
105
v How printer colon file escape sequences are evaluated to resolve page length.
v How printer colon file escape sequences are evaluated to resolve page width.
This discussion is intended for readers who need to understand printer colon file escape sequences at a
low level, perhaps because they want to write their own colon file for a unique and unsupported printer.
Before reading this discussion, you should be familiar with these topics:
v Printer colon file escape sequences on page 65
v Virtual printer definitions on page 100
The following command uses the -a1 flag/argument to request diagnostic data from the piobe backend.
The remainder of the command specifies that the job be processed by the queue named asc, that three
copies of the file named /etc/motd be printed in a 12-point Courier font rotated 90 degrees, that the job
be preprocessed by the pr filter, and that any messages generated by the job should be mailed to the user
that submitted the job.
qprt -a1 -Pasc -fp -z1 -p12 -scourier -C -N3 /etc/motd
Issuing this command results in mail similar to the following being sent to the user that issued the
command:
Message from qdaemon:
=====> MESSAGE FROM PRINT JOB 31 (/etc/motd) <=====
0782-034 Below is the preview information requested with the -a1
flag.
No files will be printed.
PRINTER:
[devices.cat,71,66;IBM 4029 LaserPrinter] (ASCII)
FLAG VALUES:
a=1, b=0, d=a, e=!, f=p, g=1, h=, i=0, j=1, l=48, p=12, q=, s=cou
rier, t=0,
u=1, v=6, w=128, x=2, y=!, z=1, A=1, B=nn, C=+, E=!, G=!, H=, I=,
J=+, L=+,
N=3, O=3, P=ascx:lxx, Q=1, W=!, X=ISO8859-1, Z=+
PIPELINE OF FILTERS:
/usr/bin/pr
-l48
-w128 /etc/motd |
/usr/lib/lpd/pio/etc/pioformat
-@/var/spool/lpd/pio/@local/ddi/ibm4029.asc.lp1.asc:lp1
-!/usr/lib/lpd/pio/fmtrs/piof5202
-l48
-w128
-p12
-scourier
-z1
106
This is a good place to examine how piobe uses the virtual printer definition associated with the spooler
queue named asc. The colon file (which contains the virtual printer definition for this queue) uses the
attribute ia to specify the input data stream pipeline (the PIPELINE OF FILTERS section above) for ASCII
jobs. The value of ia for this queue is:
%Ide/pioformat -@%Idd/%Imm -!%Idf/piof5202 -l%IwL -w%IwW
%f[begijpqstuvxyzEGIJLOQWXZ] %Uh
The %Id resolves to /usr/lib/lpd/pio/etc, the directory that contains miscellaneous modules. The
'/pioformat -@' is appended, without the single quotes, to the previous string, becoming
/usr/lib/lpd/pio/etc/pioformat, otherwise known as the full path name to the formatter driver. The -@
after pioformat is a flag to the pioformat command which, in this instance, specifies the full path name
of the digested database file to be accessed.
The value of the -@ flag is specified by the concatenation of %Idd, /, and %Imm. The value of %Idd is
defined in the colon file as %I@5/ddi. The @5 is an automatic variable whose value is
/var/spool/lpd/pio/@local, so %Idd resolves to /var/spool/lpd/pio/@local/ddi. The /, without the
single quotes, is appended to that path. %Imm is defined in the colon file as mt.md.mn.mq.mv, and
other virtual printer attributes. These attributes define:
v mt - Printer type
v md - Output data stream type
v mn - Device name
v mq - Queue name (name of a queue stanza in /etc/qconfig)
v mv - Virtual printer name (name of a corresponding device stanza in /etc/qconfig)
These file virtual printer attributes are initialized by the piodigest command at the time the queue and
virtual printer are created. The combination of the five is unique in the virtual printer database.
For this queue, the value of mt.md.mn.mq.mv is ibm4029.asc.lp1.asc.lp1. Thus the value of the -@ flag
to pioformat becomes /var/spool/lpd/pio/@local/ddi/ibm4029.asc.lp1.asc.lp1, the full path of the
digested database file defining the virtual printer associated with this queue (asc).
Printers and Printing
107
The -! is a second flag to pioformat, specifying the full path name of the device-dependent formatter to
be loaded, linked, and driven at runtime by the formatter driver, pioformat. It is here that you can see
how and where the runtime connection between these two modules occurs.
The value of the -! flag is specified by the concatenation of the remainder of the printer colon file escape
sequences shown in the formatted form of the ia attribute, beginning with %Idf and /piof5202 -l.
The value of %Idf in defined in the colon file as %I@4/fmtrs. The @4 is an automatic variable whose
value is /usr/lib/lpd/pio, so %Idf resolves to /usr/lib/lpd/pio/fmtrs. The piof5202 -l, without the
single quotes, is appended to this string, so the value of the -! flag to this point becomes
/usr/lib/lpd/pio/fmtrs/piof5202 -l. The -l is a flag to piof5202, the device-dependent formatter for an
ASCII data stream on an IBM 4029 LaserPrinter, that specifies page width in characters.
For information on the calculation of the argument to the -l flag, %IwL, see Calculation of page length
using printer colon file escape sequences.
Calculation of page length using printer colon file escape sequences:
You can use printer colon file escape sequences to calculate page length.
The printer colon file for an ASCII queue on an IBM 4029 LaserPrinter defines page length, in lines, with
the work attribute wL. Obtaining a numeric value for wL involves evalutating embedded references in
the definition of wL. As formatted by the lsvirprt commmand, wL is defined as follows:
Page Length In Chars, Using Length From Data Base (used in
pipelines)
wL = %?%Cl%t%f!l%e%I_l%;
%?
%Cl
%t
%f!l
OUTPUT
%e
%I_l
%;
<IF>
PUSH: (1 If -l Flag on Command Line; Otherwise 0)
<THEN>
For Each Flag x on Command Line: "-xArgument" ->
<ELSE>
INCLUDE: (LINES per page)
<END>
The %Cl checks to see if the l flag was used on the command line; if it was, then a 1 is pushed onto the
stack, else a 0 is pushed onto the stack. In this case, the l flag was not used on the command line so a 0
is pushed onto the stack. The %t checks for a true (non-zero) value on the stack and, not finding one,
executes the %e (else) construct %I_l.
_l is defined as %IwY, shown below as formatted by the lsvirprt command.
Default Page Length (lines)
wY = %?%G_z%{1}%&%t%GwJ%e%GwK%;%G_v%*%{300}%/%d
%?
%G_z
%{1}
%&
%t
%GwJ
%e
%GwK
%;
%G_v
%*
%{300}
%/
%d
108
<IF>
PUSH: (Page ORIENTATION)
PUSH: (Integer Constant 1)
PUSH: (pop2 & pop1) -- Bitwise AND
<THEN>
PUSH: (Primary Page Width (-z 0) or Secondary Page
Length (-z1), in pels)
<ELSE>
PUSH: (Primary Page Length (-z 0) or Secondary Page
Width (-z1), in pels)
<END>
PUSH: (LINE DENSITY (lines per inch))
PUSH: (pop2 * pop1)
PUSH: (Integer Constant 300)
PUSH: (pop2 / pop1)
POP -> ASCII String -> OUTPUT
The calculation of _l begins by pushing the value of _z, page orientation, onto the stack. The job
submission command being used in this example, qprt -a1 -Pasc -fp -z1 -p12 -scourier -C -N3
/etc/motd, specifies a z value of 1, so a 1 is pushed onto the stack. The %{1} pushes another 1 onto the
stack, after which the %& pops the top two values (both 1s) off the stack and performs a bitwise AND
with the two values. The result of the bitwise AND, a 1, is pushed onto the stack.
Note: The test is a bitwise AND instead of a simple test for equality because the legal values for the
z flag are 0, 1, 2, and 3, corresponding to the legal number of 90 degree rotations that can be
applied to a printed page.
The next %t finds a 1 on the stack and so the then clause, %GwJ, is resolved before any more work is
done on resolving _l.
As formatted by lsvirprt, wJ is defined as follows:
Primary Page Width (-z 0) or Secondary Page Length (-z1), in pels
wJ = %G_Q%Pq%?%GWu%{3}%<%t%?%gq%{1}%=%t%{2400}%e%gq%{2}%=%t%{2400
}%e%gq%{3}%=%t%{1999}%e%gq%{4}%=%t%{2330}%e%{2025}%;%e%?%gq%{1}%=
%t%{1012}%e%gq%{2}%=%t%{1012}%e%gq%{3}%=%t%{1087}%e%gq%{4}%=%t%{1
149}%e%gq%{5}%=%t%{1763}%e%{1928}%;%;%d
%G_Q
%Pq
%?
%t
%e
109
%=
%t
%e
%t
%e
%t
%e
%t
%e
%;
%;
%d
The calculation of wJ begins by pushing the value of _Q, the paper size override for the input paper
source, onto the stack. The value of _Q is defined as %IwQ. As formatted by the lsvirprt command, wQ
is defined as follows:
Paper or Envelope Size For the Paper Source Selected By the -O
and -u Flag Values (Refer to the s0, s1, s2, s3, and s4
attributes)
wQ =
%?%GWu%{0}%=%t%Gs0%e%GWu%{1}%=%t%Gs1%e%GWu%{2}%=%t%Gs2%e%GWu%{3}%
=%t%Gs3%e%Gs4%;%d
%?
%GWu
_O and _u.)
%{0}
%=
%t
%Gs0
%e
%GWu
_O and _u.)
%{1}
%=
%t
%Gs1
%e
%GWu
_O and _u.)
%{2}
%=
%t
%Gs2
%e
%GWu
_O and _u.)
%{3}
%=
%t
%Gs3
110
<IF>
PUSH: (Calculate value for paper source based on
PUSH: (Integer Constant 0)
PUSH: (pop2 = pop1 ?)
<THEN>
PUSH: (PAPER SIZE for manual paper feed)
<ELSE>
PUSH: (Calculate value for paper source based on
PUSH: (Integer Constant 1)
PUSH: (pop2 = pop1 ?)
<THEN>
PUSH: (PAPER SIZE for tray 1 (upper))
<ELSE>
PUSH: (Calculate value for paper source based on
PUSH: (Integer Constant 2)
PUSH: (pop2 = pop1 ?)
<THEN>
PUSH: (PAPER SIZE for tray 2 (lower))
<ELSE>
PUSH: (Calculate value for paper source based on
PUSH: (Integer Constant 3)
PUSH: (pop2 = pop1 ?)
<THEN>
PUSH: (ENVELOPE SIZE for envelope feeder)
%e
%Gs4
%;
%d
<ELSE>
PUSH: (ENVELOPE SIZE for manual envelope feed)
<END>
POP -> ASCII String -> OUTPUT
The calculation of wQ begins by pushing the value of Wu, onto the stack. As formatted by the lsvirprt
command, the value of Wu is defined as follows:
Calculate value for paper source based on _O and _u.
Wu =
%?%CO%t%?%G_O%{1}%=%t%?%Cu%t%?%G_u%{2}%>%t%{4}%e%{0}%;%e%{0}%;%e%
G_u%;%e%G_u%;%d
%?
<IF>
PUSH: (1 If -O Flag on Command Line; Otherwise 0)
%t
<THEN>
%?
<IF>
%G_O PUSH: (Type of INPUT PAPER HANDLING (backward
compatibility
purpose only))
%{1} PUSH: (Integer Constant 1)
%=
PUSH: (pop2 = pop1 ?)
%t
<THEN>
%?
<IF>
%Cu PUSH: (1 If -u Flag on Command Line; Otherwise 0)
%t
<THEN>
%? <IF>
%G_u PUSH: (Input PAPER SOURCE)
%{2} PUSH: (Integer Constant 2)
%> PUSH: (pop2 > pop1 ?)
%t <THEN>
%{4} PUSH: (Integer Constant 4)
%e <ELSE>
%{0} PUSH: (Integer Constant 0)
%; <END>
%e
<ELSE>
%{0} PUSH: (Integer Constant 0)
%;
<END>
%e
<ELSE>
%G_u PUSH: (Input PAPER SOURCE)
%;
<END>
%e
<ELSE>
%G_u
PUSH: (Input PAPER SOURCE)
%;
<END>
%d
POP -> ASCII String -> OUTPUT
%CO
The calculation for the value of Wu begins by evaluating %CO, which pushes a 1 onto the stack if the O
flag was specified on the command line, else it pushes a 0 onto the stack. The job submission command
being used in this example did not use the O flag, so a 0 is pushed onto the stack. The next %t, finding a
0 on the stack, skips the next 23 lines of printer colon file escape sequences and evaluates the %e (else)
clause on the fourth line from the bottom of the formatted form of the Wu attribute. The else clause is
%G_u, which pushes the value of _u, the input paper source, onto the stack. The default value for _u for
this virtual printer is 1, so a 1 is pushed onto the stack. The next %; terminates the original %?. The only
remaining escape sequence, %d, pops the top value (a 1) off the stack and returns it in ASCII format to
the in-progress calculation of wQ.
The 1 returned to the in-progress calculation of wQ is the value of Wu, and is pushed onto the stack. The
next %{0} pushes a 0 onto the stack. %= pops the top two values (a 0 and a 1) off the stack and, checking
them for equality, fails; a 0 is pushed onto the stack.
The next %t finds the 0 and so skips the %Gs0 and instead evaluates the %e (else) clause. Wu (a 1) is
again pushed onto the stack. The %{1} pushes another 1 onto the stack. The %= again pops the top two
values ( two 1s) off the stack and, checking them for equality, succeeds; a 1 is pushed onto the stack.
111
The next %t finds the 1 and so evaluates the %Gs1. The s1 attribute is a number representing the paper
size for paper tray 1, the upper paper tray, and its default value in this virtual printer definition is 1. This
1 is pushed onto the stack. All but the very last of the remaining printer colon escape sequences in the
evaluation of wQ are skipped. The %d pops the top value (a 1) off the stack and returns it in ASCII
format to the in-progress calculation of wJ.
The 1 returned to the in-progress caclulation of wJ is the value of _Q, and is pushed onto the stack. It is
immediately popped back off the stack and stored in the internal variable q. Wu, already determined to
be 1, is again pushed onto the stack. %{3} pushes a 3 onto the stack, then the %< pops the top two values
off the stack and checks to see if the second value popped is less than the first value popped. 1 is less
than 3, so a 1 is pushed onto the stack. The %t finds the 1 and so enters the if-then-else-then-else-thenelse... sequence looking for an integer to pair with the paper size value calculated for _Q.
The %gq fetches the stored value of _Q from the internal variable q, and pushes it onto the stack. The
%{1} pushes another 1 onto the stack. The %= pops the top two values (two 1s) off the stack and,
checking them for equality, succeeds; a 1 is pushed onto the stack. The %t finds the 1 and so evaluates
the %{2400}, which pushes 2400 onto the stack. The calculation of wJ then falls through all but the last
line of the remaining printer colon file escape sequences defining wJ. The last escape sequence, %d, pops
the top value, 2400, off the stack and returns it, in ASCII format, to the in-progress calculation of wY.
The 2400 returned to the in-progress calculation of wY is the value of wJ, and is pushed onto the stack.
The %GwK in the else clause is skipped and the %; terminates the if-then-else sequence. The %G_v
fetches the line density (in lines per inch), 6, and pushes it onto the stack. The %* pops the top two
values (a 6 and a 2400) off the stack, multiplies them together, and pushes the result (14400) back onto
the stack. The %{300} pushes a 300 onto the stack. The %/ pops the top two values (a 14000 and a 300) off
the stack, divides the second value popped off the stack by the first value popped off the stack, and
pushes the result (48) onto the stack. The %d pops the top value (48) off the stack and returns it to the
in-progress calculation of wL.
The 48 returned to the in-progress calculation of wL is the value of _l. The value of wL was originally
referenced in the determination of the value of the ia attribute, the input datastream pipeline for ASCII
jobs. The number 48 replaces the %IwL in that determination, so the value of the -! flag to pioformat
becomes /usr/lib/lpd/pio/fmtrs/piof5202 -l48. The -l48 can be seen in the original diagnostic message
from piobe that was the basis of this discussion; it is part of the PIPELINE OF FILTERS section of the
mail sent by the qdaemon on behalf of piobe.
The calculation of the value associated with the -w flag to piof5202 is described in Calculation of page
width using printer colon file escape sequences on page 116.
The following Calculation of Page Length figure depicts the stack operations (as described above) used
to obtain a final numeric value for page length in lines. The following numbered steps correspond to the
numbers on the left side of the columns in the figure, and provide a step-by-step description of the
evaluation of the printer colon file escape sequences defining page length, in lines, for this particlular
queue (asc), colon file, and command line.
112
1. %Cl - Pushes a 0 onto the stack because the l flag was not used on the command line.
2. %I_l - Calls for the evaluation of _l.
3. %G_z - Pushes a 1 onto the stack.
4. %{1} - Pushes a 1 onto the stack.
5. %& - Pops the top two values (two 1s) off the stack, performs a bitwise AND on the two values, and
pushes the resultant 1 onto the stack.
6. %t - Pops the 1 off the stack and, because it is a TRUE (non-zero) value, calls for the evaluation of
%GwJ. The stack labeled _l is now empty.
7. %GwJ - Calls for the evaluation of wJ.
8. %G_Q - Calls for the evaluation of wQ.
9. %GwQ - Calls for the evaluation of %GWu.
10. %GWu - Calls for the evaluation of Wu.
11. %CO - Pushes a 0 onto the stack because the O flag was not used on the command line.
12. %t - Pops the 0 off the stack and, because it is a FALSE (zero) value, calls for the evaluation of
%G_u. The stack labeled Wu is now empty.
13. %G_u - Pushes a 1 onto the stack.
14. %d - Pops the 1 off the stack and returns it, in ASCII format, to the in-progress calculation of wQ.
15. %{0} - Pushes a 0 onto the stack.
16. %= - Pops the 0 and 1 off the stack, compares them for equality, and pushes the resultant 0 onto the
stack.
17. %t - Pops the 0 off the stack and, because it is a FALSE (zero) value, calls for the evaluation of
%GwU.
18. %GWu - This value is already known, so a 1 is pushed onto the stack.
19. %{1} - Pushes a 1 onto the stack.
20. %= - Pops the two 1s off the stack, compares them for equality, and pushes the resultant 1 onto the
stack.
Printers and Printing
113
21. %t - Pops the 1 off the stack and, because it is a TRUE (non-zero) values, calls for the evaluation of
%Gs1.
22. %Gs1 - Pushes a 1 onto the stack.
23. %d - Pops the 1 off the stack and returns it, in ASCII format, to the in-progress calculation of wJ.
24. %Pq - Pops the 1 off the stack and stores it in the internal variable q.
25. %GWu - This value is already known, so a 1 is again pushed onto the stack.
26. %{3} - Pushes a 3 onto the stack.
27. %< - Pops the 3 and the 1 off the stack and, because 1 is less than 3, pushes a 1 onto the stack.
28. %t - Pops the 1 off the stack and, because it is a TRUE (non-zero) values, calls for the evaluation of
%gq.
29. %gq - Pushes the value of the internal variable q, a 1, onto the stack.
30. %{1} - Pushes a 1 onto the stack.
31. %= - Pops the two 1s off the stack, compares them for equality, and pushes the resultant 1 onto the
stack.
32. %t - Pops the 1 off the stack and, because it is a TRUE (non-zero) values, calls for the evaluation of
%{2400}.
33. %{2400} - Pushes a 2400 onto the stack.
34. %d - Pops the 2400 off the stack and returns it, in ASCII format, to the in-porgress calculation of _l.
35. %G_v - Pushes a 6 onto the stack.
36. %* - Pops the 6 and the 2400 off the stack, multiplies them together, and pushes the resultant 14400
onto the stack.
37. %{300} - Pushes a 300 onto the stack.
38. %/ - Pops the 300 and the 14400 off the stack, divides 14400 by 300, and pushes the resultant 48 onto
the stack.
39. %d - Pops the 48 off the stack and returns it, in ASCII format, to the in-progress determination of ia,
the input data stream pipeline for ASCII jobs.
How the stack language describing page length works:
The IBM LaserPrinter 4029 Series Technical Reference contains a figure and a table that together describe
the printable and unprintable areas on a page, and the paper and envelope dimensions, in pels, for
standard paper and envelope sizes.
For example, the printable area on an 8.5 x 11 (width by length) inch page is 2400 x 3200 pels (width by
length). Note that if the page is rotated either 90 or 270 degrees for landscape printing, the dimensions
are swapped and become 3200 x 2400 pels (width by length).
The evaluation of %IwL begins by checking to see if the l flag was used on the command line; if it was,
then there are no calculations to perform. The requested value will be used. (That is not a promise that it
will work, just that it will be used.) If the l flag was not used on the command line, then piobe has to
figure out how long the page is under the current job environment, as determined by other command
line flags and by colon file defaults.
The first item checked in the evaluation of _l (page length) is page orientation (_z). As noted above,
rotating the page by odd multiples of 90 degrees flips the page dimensions. Looking at the if-then-else
statement that is the beginning of the definition of wY, it can be seen that the value of _z is a switch that
controls which of wJ and wK will be used for page length. If the page has a portrait orientation, then wK
is length. If the page has a landscape orientation, then wJ is length. After the page length in pels is
resolved, the remainder of the escape sequences in the definition of wY just take vertical line density into
account while converting the number of pels to the number of lines.
114
The wJ attribute is selected because the page orientation is landscape. Thus far all that is known is that
the dimensions have been flipped; what the dimensions actually are is still unknown. The evaluation of
wJ begins by fetching the value (if any) of a command line usage of the Q flag, which is a
printer-dependent value requesting a specific paper size. If the Q flag was used on the command line,
then that value will be used to select the paper length in pels, otherwise a value for Q will be determined
by evaluating Wu, which is a value for the paper source based on the attributes _O (type of input paper
handling) and _u (input paper source). Note that _Q is defined as %IwQ, whose definition begins with
%IWu.
Because Q was not used on the command line, the evaluation of Wu determines that the O flag wasnt
used either, and so executes the else clause in the outer if-then-else statement in the definition of Wu,
returning the default colon file value of _u, 1, to the evaluation of wQ.
Because this is as deep as the nesting of escape sequences goes for the evaluation of _l, it is worth taking
a closer look at the logic defining Wu. Keep in mind the definitions and legal values for O, u, and Q,
which are:
v O - type of input paper handling - 1 (manual), 2 (continuous forms), 3 (sheet feed) - default is sheet
feed.
v u - input paper source - 1 (primary), 2 (alternate), 3 (envelope) - default is primary.
v Q - paper size for input paper source - values are printer-dependent - defined by combination of O
and u.
The escape sequences defining Wu say this:
v Case 1: If the O flag was not used on the command line, then return the colon file default value for _u.
For example, if the user did not specify a type of input paper handling, then return the input paper
source (either from the command line or the default from the colon file) to the evaluation of %IwQ.
v Case 2: If the O flag was used on the command line but its value was not 1, then return the colon files
default value for _u. For example, if the user specified a type of input paper handling other than
manual, then return the input paper source (either from the command line or the default from the
colon file) to the evaluation of %IwQ.
v Case 3: If the O flag was used on the command line and its value was 1, and the u flag was not used
on the command line, then return a 0. For example, if the user-specified manual paper handling but
did not specify an input paper source, then return a 0 to the evaluation of %IwQ.
v Case 4: If the O flag was used on the command line and its value was 1, and the u flag was used on
the command line and its value was not greater than 2, then return a 0. For example, if the user
specified manual paper handling and also specified either the primary or alternate input paper source,
then return a 0 to the evaluation of %IwQ.
v Case 5: If the O flag was used on the command line and its value was 1, and the u flag was used on
the command line and its value was greater than 2, then return a 4, For example, if the user specified
manual paper handling and also specified an input paper source of envelope, then return a 4 to the
evaluation of %IwQ.
The definition of wQ is an if-then-else-then-else-then-else-then-else statement that repeatedly compares
the value of Wu to the integers 0, 1, 2, and 3, looking for a match. The match selects the value of one of
the attriubes s0, s1, s2, s3, or s4, respectively (s4 is selected when there is no other match). The items
these attributes define are as follows:
v s0 - paper size for manual paper feed
v s1 - paper size for tray 1 (upper)
v s2 - paper size for tray 2 (lower)
v s3 - envelope size for envelope feeder
v s4 - envelope size for manual envelope size
115
In the virtual printer definition for an ASCII queue on an IBM 4029 LaserPrinter, there are only two
unique values for these five attributes: s0, s1, and s2 are all 1, while s3 and s4 are both 3.
Looking back up the nested escape sequences, you can see that the definition of wJ is composed of an
outer if-then-else statement. Both the if and the else pieces of this statement contain a chain of
if-then-else-then-else... statements. The value of Wu (which is a value for paper source, based on O and
u) determines whether the if or the else piece of the outer statment executes; if Wu is 1 or 2 (less than 3),
then the if piece executes; otherwise the else piece executes. It is in the final determination of wJ that the
page length, in pels, is fixed.
The if piece of the outer if-then-else statement defining wJ selects a pel value from a range of
non-envelope paper sizes; the else piece of the outer if-then-else statement selects a pel value from a
range of envelope paper sizes. Wu controls which piece of the if-then-else statement executes but, after
either the if or else piece has been chosen, it is the value of Q that causes a pel value to be selected. The
five cases listed above work like this:
Case 1: Either the command line value of u or the default from the colon file (1, primary paper tray) is
returned to the evaluation of wQ. The remaining escape sequences in the definiton of wQ test the value
of Wu and select the value of one of s0, s1, s2, s3, or s4. That value is in turn returned to the evaluation
of wJ. If u is 1 or 2 , then Q will be 1 (non-envelope paper size). If u is 3, then Q will be 3 (envelope
paper size). When the evaluation of wJ is resumed, a u value of 1 or 2 will direct the process into the if
piece of the outer if-then-else statement, and the Q value of 1 will select a page length of 2400 pels. A u
value of 3 will direct the process into the else piece of the outer if-then-else statement, and the Q value of
3 will select an envelope page length of 1087 pels.
Case 2: Same as case 1.
Case 3: The user-specified manual paper handling on the command line but did not specify a paper
source so Wu is assigned the value 0, and that value is returned to the evaluation of wQ. The 0 will
cause wQ to be assigned the value of s0 (the paper size for manual paper feed, a 1). When the evaluation
of wJ is resumed, the u value of 0 will direct the process into the if piece of the outer if-then-else
statement, and the Q value of 1 (s0) will select a page length of 2400 pels.
Case 4: The user specified manual paper handling on the command line and also used the u flag to
specify either the primary or alternate paper source (but definitely not envelopes). As with case 3, a page
length of 2400 pels will be chosen.
Case 5: The user-specified manual paper handling on the command line and also used the u flag to
specify an envelope paper source so Wu is assigned the value 4, and that value is returned to the
evaluation of wQ. The 4 will cause wQ to be assigned the value of s4 (the envelope size for manual
envelope size, a 3). When the evaluation of wJ is resumed, the u value of 4 will direct the process into
the else piece of the outer if-then-else statement, and the Q value of 3 will select an envelope length of
1087 pels.
Our example is case 1: neither the O nor the u flags were used on the command line, so Wu is assigned a
value of 1, the default _u value for this colon file. When the evaluation of wQ resumes, the match occurs
on s1, and a 1 is returned to the evaluation of wJ. The u value of 1 direct the process into the if piece of
the outer if-then-else statement, and the Q value of 1 selects a page length of 2400 pels. This value is
returned to the evaluation of _l.
The remaining printer colon file escape sequences defining _l reason that if there are 2400 pels available
(vertically), and if we want six lines per inch, and if there are 300 pels per inch (the resolution of the
printer), then 48 lines can be printed on a page. The value 48 is returned to the evaluation of ia. Thats
basically where the -l48 in the PIPELINE OF FILTERS came from.
Calculation of page width using printer colon file escape sequences:
116
You can use printer colon file escape sequences to calculate page width.
The printer colon file for an ASCII queue on an IBM 4029 LaserPrinter defines page width, in characters,
with the work attribute wW. As formatted by the lsvirprt (see Virtual printer definitions on page 100
for more information) command, wW is defined as follows:
Page Width In Characters, Using Width From Data Base (used in
pipelines)
wW = %?%Cw%t%f!w%e%I_w%;
%?
%Cw
%t
%f!w
OUTPUT
%e
%I_w
%;
<IF>
PUSH: (1 If -w Flag on Command Line; Otherwise 0)
<THEN>
For Each Flag x on Command Line: "-xArgument" ->
<ELSE>
INCLUDE: (COLUMNS per page)
<END>
The %Cw checks to see if the w flag was used on the command line; if it was, then a 1 is pushed onto
the stack, else a 0 is pushed onto the stack. In this case, the w flag was not used on the command line so
a 0 is pushed onto the stack. The %t checks for a true (non-zero) value on the stack and, not finding one,
executes the %e (else) construct %I_w.
The _w attribute is defined as %IwX, shown below as formatted by the lsvirprt command.
Default Page Width (characters)
wX =
%?%G_z%{1}%&%t%GwK%e%GwJ%;%?%G_p%{17}%=%t%{171}%e%G_p%{10}%*%;%*%
?%G_W%t%{6000}%e%{3000}%;%/%d
%?
%G_z
%{1}
%&
%t
%GwK
Page Width (-z
%e
%GwJ
Length (-z
%;
%?
%G_p
%{17}
%=
%t
%{171}
%e
%G_p
%{10}
%*
%;
%*
%?
%G_W
%t
%{6000}
%e
%{3000}
%;
%/
%d
<IF>
PUSH: (Page ORIENTATION)
PUSH: (Integer Constant 1)
PUSH: (pop2 & pop1) -- Bitwise AND
<THEN>
PUSH: (Primary Page Length (-z 0) or Secondary
1), in pels)
<ELSE>
PUSH: (Primary Page Width (-z 0) or Secondary Page
1), in pels)
<END>
<IF>
PUSH: (PITCH (characters per inch))
PUSH: (Integer Constant 17)
PUSH: (pop2 = pop1 ?)
<THEN>
PUSH: (Integer Constant 171)
<ELSE>
PUSH: (PITCH (characters per inch))
PUSH: (Integer Constant 10)
PUSH: (pop2 * pop1)
<END>
PUSH: (pop2 * pop1)
<IF>
PUSH: (DOUBLE-WIDE print?)
<THEN>
PUSH: (Integer Constant 6000)
<ELSE>
PUSH: (Integer Constant 3000)
<END>
PUSH: (pop2 / pop1)
POP -> ASCII String -> OUTPUT
Printers and Printing
117
The calculation of _w begins by pushing the value of _z, page orientation, onto the stack. The job
submission command being used in this example, qprt -a1 -Pasc -fp -p12 -scourier -C -N3
/etc/motd, specifies a z value of 1, so a 1 is pushed onto the stack. The %{1} pushes another 1 onto the
stack, after which the %& pops the top two values (both1s) off the stack and performs a bitwise AND
with the two values. The result of the bitwise AND, a 1, is pushed onto the stack.
Note: The test is a bitwise AND instead of a simple test for equality because the legal values for the
z flag are 0, 1, 2, and 3, corresponding to the legal number of 90 degree rotations that can be
applied to a printed page.
The next %t finds a true (non-zero) value on the stack and so the then clause, %GwK, is resolved before
any more work is done resolving _w.
As formatted by lsvirprt, wK is defined as follows:
Primary Page Length (-z 0) or Secondary Page Width (-z 1), in pels
wK =
%G_Q%Pq%?%GWu%{3}%<%t%?%gq%{1}%=%t%{3200}%e%gq%{2}%=%t%{4100}%e%g
q%{3}%=%t%{2935}%e%gq%{4}%=%t%{3407}%e%{3050}%;%e%?%gq%{1}%=%t%{2
150}%e%gq%{2}%=%t%{2562}%e%gq%{3}%=%t%{2750}%e%gq%{4}%=%t%{2498}%
e%gq%{5}%=%t%{2604}%e%{2852}%;%;%d
%G_Q
%Pq
%?
%GWu
_O and _u.)
%{3}
PUSH: (Integer Constant 3)
%<
PUSH: (pop2 < pop1 ?)
%t
<THEN>
%?
<IF>
%gq PUSH: (Internal Variable q)
%{1} PUSH: (Integer Constant 1)
%=
PUSH: (pop2 = pop1 ?)
%t
<THEN>
%{3200} PUSH: (Integer Constant 3200)
%e
<ELSE>
%gq PUSH: (Internal Variable q)
%{2} PUSH: (Integer Constant 2)
%=
PUSH: (pop2 = pop1 ?)
%t
<THEN>
%{4100} PUSH: (Integer Constant 4100)
%e
<ELSE>
%gq PUSH: (Internal Variable q)
%{3} PUSH: (Integer Constant 3)
%=
PUSH: (pop2 = pop1 ?)
%t
<THEN>
%{2935} PUSH: (Integer Constant 2935)
%e
<ELSE>
%gq PUSH: (Internal Variable q)
%{4} PUSH: (Integer Constant 4)
%=
PUSH: (pop2 = pop1 ?)
%t
<THEN>
%{3407} PUSH: (Integer Constant 3407)
%e
<ELSE>
%{3050} PUSH: (Integer Constant 3050)
%;
<END>
%e
<ELSE>
%?
<IF>
%gq PUSH: (Internal Variable q)
%{1} PUSH: (Integer Constant 1)
%=
PUSH: (pop2 = pop1 ?)
%t
<THEN>
%{2150} PUSH: (Integer Constant 2150)
%e
<ELSE>
118
%gq
%{2}
%=
%t
%e
%t
%e
%t
%e
%t
%e
%;
%;
%d
The calculation of wK begins by pushing the value of _Q, the paper size override for the input paper
source, onto the stack. The value of _Q is defined as %IwQ. At this point in the calculation of Wk, we
are exactly where we were in the calculation of wJ, that is, trying to determine a value for wQ and Wu.
Within the context of a single job submission command, the final values of wQ and Wu are not going to
change just because a final value was requested from a different attribute calculation. Thus well use the
previously calculated values of 1 for wQ and 1 for Wu.
The 1 returned to the in-progress calculation of wK is the value of _Q, and is pushed onto the stack. It is
immediately popped back off the stack and stored in the internal variable q. Wu, already determined to
be 1, is again pushed onto the stack. %{3} pushes a 3 onto the stack, then the %< pops the top two values
(a 3 and a 1) off the stack and checks to see if the second value popped is less than the first value
popped. 1 is less than 3 today, so a 1 is pushed onto stack. The %t find the 1 and so enters the
if-then-else-then-else-then-else... sequence looking for an integer to pair with the paper size value
calculated for _Q.
The %gq fetches the stored value of _Q from the internal variable q, and pushes it onto the stack. The
%{1} pushes a 1 onto the stack. The %= pops the top two values (two 1s) off the stack and, checking
them for equality, succeeds; a 1 is pushed onto the stack. The %t finds the 1 and so evaluates the %{3200},
which pushes a 3200 onto the stack. The calculation of wK then falls through all but the last line of the
remaining printer colon file escape sequences defining wK. The last escape sequence, %d, pops the top
value, 3200, off the stack and returns it, in ASCII format, to the in-progress calculation of wX.
The 3200 returned to the in-progress calculation of wX is the value of wK, and is pushed onto the stack.
The %GwJ in the else clause is skipped and the %; terminates the if-then-else sequence. At this point in
the calculation of wJ, the remainder of the attribute definition dealt with factors that affected page length
(in lines), such as vertical line density. In the calculation of page width, however, we will be interested in
pitch and in whether or not double-wide printing was selected.
The next escape sequence evaluated is %G_p. This fetches the value of the _p attribute, which defines the
pitch in characters per inch for this queue. The default value for this queue is 10 but the command line
being used in this example specified a pitch of 12 (-p12), so a 12 is pushed onto the stack. The %{17}
pushes a 17 onto the stack. The %= pops the top two values (a 17 and a 12) off the stack and, checking
Printers and Printing
119
them for equality, fails; a 0 is pushed onto the stack. The %t finds the 0 (a false value) and the following
else clause is evalutated. %G_p again pushes a 12 onto the stack. The %{10} pushes a 10 onto the stack.
The %* pops the top two values (a 12 and a 10) off the stack and multiplies them together; the resulting
120 is pushed onto the stack. The %; terminates this if-then-else sequence.
The following %* pops the top two values (a 120 and a 3200) off the stack and multiplies them together;
the resulting 384000 is pushed onto the stack. The %G_W fetches the value of _W and pushes it onto the
stack; _W is a yes (1) or no (0) question concerning whether or not double-wide printing is needed. The
default value is 0 and we did not override it on the command line, so a 0 is pushed onto the stack. The
%t finds the 0 and so executes the else clause. The %{3000} pushes a 3000 onto the stack. The %;
terminates this if-then-else sequence. The following %/ pops the top two values (a 3000 and a 384000) off
the stack and divides the second value popped by the first value popped; the resulting 128 is pushed
onto the stack. The %d pops the top value, 128, off the stack and returns it, in ASCII format, to the
in-progress calculation of wW.
The 128 returned to the in-progress calculation of wW is the value of _w. The value of wW was
originally referenced in the determination of the value of the ia attribute, the input datastream pipeline
for ASCII jobs. The number 128 replaces the %IwW in that determination, so the value of the -! flag to
pioformat becomes /usr/lib/lpd/pio/fmtrs/piof5202 -l48 -w128. The -w128 can be seen in the original
diagnostic message from piobe that was the basis of this discussion; it is part of the PIPELINE OF
FILTERS section of the mail sent by the qdaemon on behalf of piobe.
The following Calculation of Page Width figure depicts the stacks operations (as described above) used
to obtain a final numeric value for page width in characters. The following numbered steps correspond to
the numbers on the left side of the columns in the figure, and provide a step-by-step description of the
evaluation of the printer colon file escape sequences defining page width, in characters, for this particular
queue (asc), colon file, and command line.
120
1. %Cw - Pushes a 0 onto the stack because the w flag was not used on the command line.
2. %I_w - Calls for the evaluation of _w.
3. %G_z - Pushes a 1 onto the stack.
4. %{1} - Pushes a 1 onto the stack.
5. %& - Pops the top two values (two 1s) off the stack, performs a bitwise AND on the two values, and
pushes the resultant 1 onto the stack.
6. %t - Pops the 1 off the stack and, because it is a TRUE (non-zero) value, calls for the evaluation of
%GwK.
7. %GwK - Calls for the evaluation of wK.
8. %G_Q - Calls for the evaluation of _Q.
9. %GwQ - Calls for the evaluation of wQ.
10. %GWu - Calls for the evaluation of Wu.
11. %CO - Pushes a 0 onto the stack because the O flag was not used on the command line.
12. %t - Pops the 0 off the stack and, because it is a FALSE (zero) value, calls for the evaluation of
%G_u. The stack labeled Wu is now empty.
13. %G_u - Pushes a 1 onto the stack.
14. %d - Pops the 1 off the stack and returns it, in ASCII format, to the in-progress calculation of wQ.
15. %{0} - Pushes a 0 onto the stack.
16. %= - Pops the 0 and 1 off the stack, compares them for equality, and pushes the resultant 0 onto the
stack.
Printers and Printing
121
17. %t - Pops the 0 off the stack and, because it is a FALSE (zero) value, calls for the evaluation of
%GWu.
18. %GWu - This value is already known, so a 1 is pushed onto the stack.
19. %{1} - Pushes a 1 onto the stack.
20. %= - Pops the two 1s off the stack, compares them for equality, and pushes the resultant 1 onto the
stack.
21. %t - Pops the 1 off the stack and, because it is a TRUE (non-zero) values, calls for the evaluation of
%Gs1.
22. %Gs1 - Pushes a 1 onto the stack.
23. %d - Pops the 1 off the stack and returns it, in ASCII format, to the in-progress calculation of wK.
24. %Pq - Pops the 1 off the stack and stores it in the internal variable q.
25. %GWu - This value is already known, so a 1 is pushed onto the stack.
26. %{3} - Pushes a 3 onto the stack.
27. %< - Pops the top two values off the stack (a 3 and a 1) and, because 1 is less than 3, pushes a 1
onto the stack.
28. %t - Pops the 1 off the stack and, because it is a TRUE (non-zero) value, calls for the evaluation of
%pq.
29. %pq - Pushes the value of the internal variable q, a 1, onto the stack.
30. %{1} - Pushes a 1 onto the stack.
31. %= - Pops the top two values (two 1s) off the stack, compares them for equality, and pushes the
resultant 1 onto the stack.
32. %t - Pops the 1 off the stack and, because it is a TRUE (non-zero) value, calls for the evaluation of
%{3200}.
33. %{3200} - Pushes a 3200 onto the stack.
34. %d - Pops the 3200 off the stack and returns it to the in-progress calculation of _w.
35. %G_p - Pushes a 12 onto the stack.
36. %{17} - Pushes a 17 onto the stack.
37. %= - Pops the top two values (a 17 and a 12) off the stack, compares them for equality, and pushes
the resultant 0 onto the stack.
38. %t - Pops the 0 off the stack and, because it is a FALSE (zero) value, calls for the evaluation of
%G_p.
39. %G_p - Pushes a 12 onto the stack.
40. %{10} - Pushes a 10 onto the stack.
41. %* - Pops the top two values (a10 and a 12) off the stack, multiplies them together, and pushes the
resultant 120 onto the stack.
42. %* - Pops the top two values (a 120 and a 3200) off the stack, multiplies them together, and pushes
the resultant 384000 onto the stack.
43. %G_w - Pushes a 0 onto the stack.
44. %t - Pops the 0 off the stack and, because it is a FALSE (zero) value, calls for the evaluation of
%{3000}.
45. %{3000} - Pushes a 3000 onto the stack.
46. %/ - Pops the top two values (a 3000 and a 384000) off the stack, divides the second value popped
by the first value popped, and pushes the resultant 128 onto the stack.
47. %d - Pops the 128 off the stack and returns it, in ASCII format, to the in-progress calculation of ia,
the input data stream pipeline for ASCII jobs.
How the stack language describing page width works:
122
The IBM LaserPrinter 4029 Series technical reference contains a figure and a table that together describe
the printable and unprintable areas on a page, and the paper and envelope dimensions, in pels, for
standard paper and envelope sizes.
For example, the printable area on an 8.5 x 11 (width by length) inch page is 2400 x 3200 pels (width by
length). Note that if the page is rotated either 90 or 270 degrees for landscape printing, the dimensions
are swapped and become 3200 x 2400 pels (width by length).
The evaluation of %IwW begins by checking to see if the w flag was used on the command line; if it
was, then there are no calculations to perform. The requested value will be used. (That is not a promise
that it will work, just that it will be used.) If the w flag was not used on the command line, then piobe
has to figure out how wide the page is under the current job environment, as determined by other
command line flags and by colon file defaults.
The first item checked in the evaluation of _w (page width) is page orientation (_z). As noted above,
rotating the page by odd multiples of 90 degrees flips the page dimensions. Looking at the if-then-else
statement that is the beginning of the definition of wK, it can be seen that the value of _z is a switch that
controls which of wJ and wK will be used for page width. If the page has a portrait orientation, then wJ
is width. If the page has a landscape orientation, then wK is width. After the page width in pels is
resolved, the remainder of the escape sequences in the definition of wK just take pitch and
character-width (double wide or not) into account while converting the number of pels to the number of
characters.
The wK attribute is selected because the page orientation is landscape. Thus far all that is known is that
the dimensions have been flipped; what the dimensions actually are is still unknown. The evaluation of
wK begins by fetching the value (if any) of a command line usage of the Q flag, which is a
printer-dependent value requesting a specific paper size. If the Q flag was used on the command line,
then that value will be used to select the paper width in pels, otherwise a value for Q will be determined
by evaluating Wu, which is a value for the paper source based on the attributes _O (type of input paper
handling) and _u (input paper source). Note that _Q is defined as %IwQ, whose definition begins with
%IWu.
Because Q was not used on the command line, the evaluation of Wu determines that the O flag wasnt
used either, and so executes the else clause in the outer if-then-else statement in the definition of Wu,
returning the default colon file value of _u, 1, to the evaluation of wQ.
Because this is as deep as the nesting of escape sequences goes for the evaluation of _w, it is worth
taking a closer look at the logic defining Wu. Keep in mind the definitions and legal values for O, u, and
Q, which are:
v O - type of input paper handling - 1 (manual), 2 (continuous forms), 3 (sheet feed) - default is sheet
feed.
v u - input paper source - 1 (primary), 2 (alternate), 3 (envelope) - default is primary.
v Q - paper size for input paper source - values are printer-dependent - defined by combination of O
and u.
The escape sequences defining Wu say this:
v Case 1: If the O flag was not used on the command line, then return the colon file default value for _u.
For example, if the user did not specify a type of input paper handling, then return the input paper
source (either from the command line or the default from the colon file) to the evaluation of %IwQ.
v Case 2: If the O flag was used on the command line but its value was not 1, then return the colon files
default value for _u. For example, if the user-specified a type of input paper handling other than
manual,then return the input paper source (either from the command line or the default from the colon
file) to the evaluation of %IwQ.
123
v Case 3: If the O flag was used on the command line and its value was 1, and the u flag was not used
on the command line, then return a 0. For example, if the user-specified manual paper handling but
did not specify an input paper source, then return a 0 to the evaluation of %IwQ.
v Case 4: If the O flag was used on the command line and its value was 1, and the u flag was used on
the command line and its value was not greater than 2, then return a 0. For example, if the
user-specified manual paper handling and also specified either the primary or alternate input paper
source, then return a 0 to the evaluation of %IwQ.
v Case 5: If the O flag was used on the command line and its value was 1, and the u flag was used on
the command line and its value was greater than 2, then return a 4. For example, if the user-specified
manual paper handling and also specified an input paper source of envelope, then return a 4 to the
evaluation of %IwQ.
The definition of wQ is an if-then-else-then-else-then-else-then-else statement that repeatedly compares
the value of Wu to the integers 0, 1, 2, and 3, looking for a match. The match selects the value of one of
the attriubes s0, s1, s2, s3, or s4, respectively (s4 is selected when there is no other match). The items
these attributes define are as follows:
v s0 - paper size for manual paper feed
v s1 - paper size for tray 1 (upper)
v s2 - paper size for tray 2 (lower)
v s3 - envelope size for envelope feeder
v s4 - envelope size for manual envelope size
In the virtual printer definition for an ASCII queue on an IBM 4029 LaserPrinter, there are only two
unique values for these five attributes: s0, s1, and s2 are all 1, while s3 and s4 are both 3.
Looking back up the nested escape sequences, you can see that the definition of wK is composed of an
outer if-then-else statement. Both the if and the else pieces of this statement contain a chain of
if-then-else-then-else... statements. The value of Wu (which is a value for paper source, based on O and
u) determines whether the if or the else piece of the outer statement executes; if Wu is 1 or 2 (less than 3),
then the if piece executes, otherwise the else piece executes. It is in the final determination of wK that the
page width, in pels, is fixed.
Case 1: Either the command line value of u or the default from the colon file (1, primary paper tray) is
returned to the evaluation of wQ. The remaining escape sequences in the definiton of wQ test the value
of Wu and select the value of one of s0, s1, s2, s3, or s4. That value is in turn returned to the evaluation
of wK. If u is 1 or 2 , then Q will be 1 (non-envelope paper size). If u is 3, then Q will be 3 (envelope
paper size). When the evaluation of wK is resumed, a u value of 1 or 2 will direct the process into the if
piece of the outer if-then-else statement, and the Q value of 1 will select a page width of 3200 pels. A u
value of 3 will direct the process into the else piece of the outer if-then-else statement, and the Q value of
3 will select an envelope page width of 2750 pels.
Case 2: Same as case 1.
Case 3: The user-specified manual paper handling on the command line but did not specify a paper
source so Wu is assigned the value 0, and that value is returned to the evaluation of wQ. The 0 will
cause wQ to be assigned the value of s0 (the paper size for manual paper feed, a 1). When the evaluation
of wK is resumed, the u value of 0 will direct the process into the if piece of the outer if-then-else
statement, and the Q value of 1 (s0) will select a page width of 3200 pels.
Case 4: The user-specified manual paper handling on the command line and also used the u flag to
specify either the primary or alternate paper source (but definitely not envelopes). As with case 3, a page
width of 3200 pels will be chosen.
124
Case 5: The user-specified manual paper handling on the command line and also used the u flag to
specify an envelope paper source so Wu is assigned the value 4, and that value is returned to the
evaluation of wQ. The 4 will cause wQ to be assigned the value of s4 (the envelope size for manual
envelope size, a 3). When the evaluation of wK is resumed, the u value of 4 will direct the process into
the else piece of the outer if-then-else statement, and the Q value of 3 will select an envelope width of
2498 pels.
v Our example is case 1: neither the O nor the u flags were used on the command line, so Wu is
assigned a value of 1, the default _u value for this colon file. When the evaluation of wQ resumes, the
match occurs on s1, and a 1 is returned to the evaluation of wK. The u value of 1 direct the process
into the if piece of the outer if-then-else statement, and the Q value of 1 selects a page width of 3200
pels. This value is returned to the evaluation of _w.
The remaining printer colon file escape sequences defining _w reason that if there are 3200 pels available
(horizontally), and if we want 12 characters per inch, and if the resolution of printer is 300 pels per inch,
then 128 characters can be printed across the page. Both the pitch and the printer resolution are
multiplied by 10 to account for the possibility of a 17-pitch being specified. A 17-pitch is actually 17.1, so
multiplying both the numerator and the denominator by 10 causes the .1 to be accounted for in the final
calculation of page width. The value 128 is returned to the evaluation of ia. Thats basically where the
-128 in the PIPELINE OF FILTERS came from.
Spooler job header and trailer pages:
The pipelines for generating header and trailer pages are defined by the system administration attributes
sh (header pages) and st (trailer pages).
The printing of header and trailer pages are separate processes from the spooler print jobs they
accompany, even though they are not shown in the output of queue status queries.
Header and trailer page pipelines:
The sh attribute is used to define the pipeline for header and trailer pages.
Below is the sh attribute used to define the pipeline for header page generation and printing for an
extended ASCII queue on an IBM 4029 LaserPrinter. The attribute is shown as formatted by the lsvirprt
command. See Virtual printer definitions on page 100 for a further explanation.
Pipeline for Header Page
sh = %Ide/pioburst %F[H] %Idb/H.ascii | %Ide/pioformat
-@%Idd/%Imm -!%Idf/piof52
02 -L! -J! %IsH -u%IuH
%Ide
INCLUDE: (Directory Containing Miscellaneous
Modules)
'/pioburst '
%F[H]
If "-H] Argument" on Command Line, "-# Argument"
-> OUTPUT
' '
%Idb
INCLUDE: (Directory Containing Header and Trailer
Text Files)
'/H.ascii | '
%Ide
INCLUDE: (Directory Containing Miscellaneous
Modules)
'/pioformat -@'
%Idd
INCLUDE: (Directory Containing Digested Data Base
Files)
'/'
%Imm
INCLUDE: (File Name Of (Digested) Data Base; Init.
By
"piodigest" (mt.md.mn.mq:mv))
' -!'
%Idf
INCLUDE: (Directory Containing Loadable Formatter
Printers and Printing
125
Routines)
'/piof5202 -L! -J! '
%IsH
INCLUDE: (FORMATTING FLAGS for header page)
' -u'
%IuH
INCLUDE: (Input PAPER TRAY for header page)
During spooler job processing, the value of the sh attribute is determined to be:
/usr/lib/lpd/pio/etc/pioburst /usr/lib/lpd/pio/burst/H.ascii |
/usr/lib/lpd/pio/etc/pioformat
-@/var/spool/lpd/pio/@local/ddi/ibm4029.asc.lp1.asc:lp1
-!/usr/lib/lpd/pio/fmtrs/piof5202 -L! -J! -u1
The pioburstcommand processes the header page template and pipes its output to the
device-independent formatter, pioformat, which in turn loads the digested version of the colon file for
this virtual printer (the argument to the -@ flag) and the device-dependent formatter, piof5202 (the
argument to the -! flag). There are three flags to piof5202:
1. -L! - Long lines should not be wrapped.
2. -J! - The printer should be restored to the state it was in before the header page was printed.
3. -u1 - The header page should be drawn from paper tray 1.
The value of the st definition is similar to the value of the sh definition.
Custom header pages:
The root user can create custom header pages for users by modifying the definition of the sh attribute.
Because the spooler processes have access to the environment of the user that submitted the job to the
spooler, the root user can modify the portion of the sh attribute definition that specifies which header
page template to process.
For example, H.ascii specifies which header page template should be processed and printed. It can be
replaced with a user environment variable of your choice, such as $MYHEADER, as shown below.
%Ide
INCLUDE: (Directory Containing Miscellaneous
Modules)
'/pioburst '
%F[H]
If "-H] Argument" on Command Line, "-# Argument"
-> OUTPUT
' '
%Idb
INCLUDE: (Directory Containing Header and Trailer
Text Files)
'/$MYHEADER | '
%Ide
INCLUDE: (Directory Containing Miscellaneous
Modules)
'/pioformat -@'
%Idd
INCLUDE: (Directory Containing Digested Data Base
Files)
'/'
%Imm
INCLUDE: (File Name Of (Digested) Data Base; Init.
By
"piodigest" (mt.md.mn.mq:mv))
' -!'
%Idf
INCLUDE: (Directory Containing Loadable Formatter
Routines)
'/piof5202 -L! -J! '
%IsH
INCLUDE: (FORMATTING FLAGS for header page)
' -u'
%IuH
INCLUDE: (Input PAPER TRAY for header page)
To enable the user susan to get custom header pages with this queue, the root user could use the
following procedure:
126
127
%Imm
By
"piodigest" (mt.md.mn.mq:mv))
' -!'
%Idf
INCLUDE: (Directory Containing Loadable Formatter
Routines)
'/piof5202 -L! -J! '
%IsH
INCLUDE: (FORMATTING FLAGS for header page)
' -u'
%IuH
INCLUDE: (Input PAPER TRAY for header page)
'; fi; } '
The original st definition is repeated twice in the new st definition. The shell code checks to see if
MYHEADER is defined; if MYHEADER is not defined, then the header page template H.ascii is used,
else the header page template $MYHEADER is used.
Modification of the mo virtual printer attribute:
All virtual printer definitions contain an attribute named mo.
The mo attribute specifies the command string to invoke the device driver interface program. The device
driver interface program is the last process in the input data stream processing pipeline and, in the case
of local spooler queues with piobe as the backend, is usually pioout. It is named the device driver
interface program because, as the last process in the pipeline, it generally opens the device driver for
writing and then writes the processed input data stream to the device driver. See Datastream flow for
common print jobs on page 49 for additional information.
The design of the base operating system spooler allows the root user to replace pieces of the input data
stream processing pipeline with user-written code. In this article an example of redefining the mo
attribute, whose default value is the full path of pioout, to the full path of a user-written delivery
program will be discussed. See Backend processing on page 49 for more information.
Unsupported IP-addressable terminal servers:
You can use the formatter filterss ability to manipulate the printers mode and the input data stream to
create a queue on a print server to which users can submit ASCII jobs.
Suppose that you have an IP-addressable terminal server attached to your Ethernet network. The terminal
server has some number of asynchronous ports to which you can attach ASCII terminals, modems,
printers, or other asynchronous devices. Further suppose that the terminal server vendor supplied you
with a program, named ts_print, that has the following properties:
v It will read from standard input.
v It accepts a -A flag to specify an IP address.
v It accepts a -P flag to specify a port number.
To turn this into a specific example, suppose that you have an IBM 4029 LaserPrinter that you want to
attach to port 11 on the terminal server and that the terminal servers IP address is 9.19.129.101. Your goal
is have a queue on a print server to which users can submit ASCII jobs and have them printed on the
4029 on the terminal server. Though you can use ts_print from the command line, you would prefer to
make use of the formatter filters ability to perform extensive manipulation of both the printers mode
and the input data stream. Providing true serial access to the printer is also a goal.
There is more than one way to accomplish this goal. The easiest way involves making a local ASCII
queue on a normal file, instead of on a character-special file in the /dev directory. After you create the
queue and the associated virtual printer, you can modify the virtual printer to use ts_print.
128
To begin the queue creation process, enter the SMIT fast path smit mkquedev. A menu similar to the
following displays:
Add a Print Queue
Move cursor to desired item and press Enter. Use arrow keys to scroll.
# ATTACHMENT TYPE
local
remote
ascii
hpJetDirect
file
other
DESCRIPTION
Printer Attached to Local Host
Printer Attached to Remote Host
Printer Attached to ASCII Terminal
Network Printer (HP JetDirect)
File (in /dev directory)
User Defined Backend
Choose the file option, then choose a printer type. After you choose the IBM 4029 LaserPrinter (or
whatever is correct for your situation), provide the name of an existing file in the /dev directory. This is
the file to which processed jobs submitted to the queue you are creating are written. The name of the file
can be anything that adheres to the base operating system naming conventions. A reasonable action is to
create a file just for the purpose of being the target of file queues. For example, the root user can issue
the command touch /dev/lxx to create a file named lxx in the /dev directory.
After you provide the name of a file in the /dev directory, choose a queue name for each input data
stream supported by the printer type you selected earlier. In this example, suppose the name asc was
chosen for an ASCII queue. An entry like the following would appear in /etc/qconfig:
asc:
device = lxx
lxx:
file = /dev/lxx
header = never
trailer = never
access = both
backend = /usr/lib/lpd/piobe
Any print job submitted to the spooler queue asc is processed by the pipeline set up by piobe. The
processed data stream is written to /dev/lxx. This is not what you want to happen. Because the goal is to
have ts_print write the output to port 11 on the terminal server, there should in fact not even be a file
associated with this queue. To this end, edit the new stanza pair in /etc/qconfig and change the value of
the file parameter to FALSE, like this:
asc:
device = lxx
lxx:
file = FALSE
header = never
trailer = never
access = both
backend = /usr/lib/lpd/piobe
If you use this queue in this state, you do not see anything written to a file or printed anywhere, except
maybe for error messages. When the qdaemon sets the backend, piobe, into execution, it passes piobe an
open file descriptor based on the value of the file parameter in /etc/qconfig. When that value is set to
FALSE, the file descriptor is not passed. The eventual recipient and user of the file descriptor is whatever
program is pointed to by the mo attribute. The default program pointed to by the mo attribute is pioout
and, when jobs are put on the queue when it is in this state, pioout will not have a valid value for
stdout, and the processed job will simply vanish.
At this point, you can use lsvirprt to select the asc virtual printer definition for modification (see Virtual
printer definitions on page 100 for more information). A prompt similar to the following displays:
129
To
To
To
To
To
Assuming the ts_print program was installed in /usr/bin, enter the following at the prompt:
mo=/usr/bin/ts_print -A 9.19.129.101 -P 11
Jobs submitted to the asc queue will now be processed as if they were local jobs but, when the end of the
pipeline is reached, the ts_print program will deliver the output data stream to port 11 on the terminal
server instead of pioout delivering it to a device driver.
In general, the mo attribute in the virtual printer definition for a queue with piobe as the backend can be
redefined to deliver a processed data stream to any file or device the user chooses, provided the you can
write the code to do it.
Filters:
Virtual printer definitions contain predefined and open (undefined) filter attributes.
For example, an AIX Version 4 ASCII queue on an IBM 4029 LaserPrinter offers the following filter
attributes:
v f1, f2, f3, f4, and f5 - open, user-defined filters
v fb - bidi filter for Hebrew/Arabic.
v fc - cifplot filter
v fd - TeX (DVI) filter
v
v
v
v
v
v
ff - FORTRAN filter
fg - plot filter
fl - passthru filter
fn - ditroff filter
fp - pr filter
fv Raster image filter
The filter attribute that selects the pr filter is named fp, so the argument to the -f flag is just p, the second
letter.
To permanently select the pr filter, use the lsvirprt command to edit the virtual printer definition and set
the value of the _f attribute to p. The _f attribute selects a filter that will be used to pre-process any job
submitted to the queue associated with this virtual printer definition.
130
Because lp, lpr, and qprt are all just front ends to the enq command, the true entry point to the spooler,
you would suppose that enq must support the -f flag. If you issue the enq command with the -f flag,
however, you will receive an error message; enq does not support the -f flag. This is a situation where
the previously described technique (see Spooler data flow (enq command) on page 48) of mounting
/bin/echo over /bin/enq proves useful.
The root user can issue these commands from a shell prompt:
1. mount /bin/echo /bin/enq
2. qprt -Pasc -fp /etc/motd
3. umount /bin/enq
After the second command is issued, the following appears in the display element defined by your TERM
environment variable:
-P asc -o -f -o p /etc/motd
These are the arguments qprt tried to pass to enq. You see them because qprt found echo instead of enq.
The following command is equivalent to the command shown in step 2 above:
enq -P asc -o -f -o p /etc/motd
The -o option specifies that flags specific to the backend should be passed to the backend. The -o option
can be thought of as a free pass through the syntax checking that occurs before the enq command builds
a job description file and notifies the qdaemon of the existence of a new job.
Suppose that you want to set up a queue that will print a range of lines from an ASCII file. For example,
suppose you read /usr/lpp/bos/README and find 35 lines that you want to print so you can fax them to
someone or tack them to your wall for reference. You could edit /etc/qconfig and add the following
lines:
partial:
device = partial
partial:
file = FALSE
backend = /usr/bin/partial
The file /usr/bin/partial could be a shell script with ownership of root.printq and with permissions of
755. Its contents could be as follows:
#!/bin/ksh
BEGIN=$1
END=$2
let DIFF=END-BEGIN+1
FILE=$3
/usr/bin/head -${END} ${FILE} | tail -${DIFF} | /usr/bin/qprt -Pasc
If you wanted to print lines 189 through 223 of /usr/lpp/bos/README, you could use the partial queue as
follows:
qprt -Ppartial -o 189 -o 223 /usr/lpp/bos/README
When the backend executes, BEGIN is assigned 189, END is assigned 223, and DIFF is assigned 35,
which is the number of chosen lines. FILE is assigned /usr/lpp/bos/README. The head command
truncates /usr/lpp/bos/README immediately after the last requested line. The output is piped to the tail
command, which selects the last 35 lines of the truncated file and pipes them to the qprt command,
which will take input from stdin. The qprt command submits the lines to the queue named asc.
Filter for mapping linefeeds to carriage returns and linefeeds:
131
Many users have written or purchased applications that prepare data streams to fill in the blanks on
pre-printed checks, invoices, bills-of-lading, or other forms. Printing these data streams requires precise
control of the physical printer.
It is often the case that the job processing pipeline created by piobe inserts or deletes enough data from
the original data stream that the output data no longer falls at the proper position on the pre-printed
form.
The root user can frequently use the lsvirprt command to set the value of the _d attribute in the virtual
printer definition to p. On an ASCII queue on an IBM 4029 LaserPrinter, this would cause piobe to select
the ip pipeline to process the job. The ip pipeline is for passthru printing, which means the formatter
filters uses the passthru() routine to simply pass the input data stream through to the printer without
modification.
This frequently removes all the printer control problems that existed, but adds one new one. When the
formatter filter operates in passthru mode, the mapping of linefeeds to carriage returns and linefeeds is
disabled. The forms still do not print correctly.
Suppose that the application does not allow the insertion of carriage returns into the data stream, you can
fix this problem with a simple filter, as follows:
#include <stdio.h>
main(int argc, char **argv)
{
int ch ;
while (EOF != (ch = fgetc(stdin)))
{
switch (ch)
{
case 10: fputc(ch,stdout) ;
fputc(0x0D,stdout) ;
break ;
default: fputc(ch,stdout) ;
break ;
}
}
}
Compile your program and name it cr_mapper. and install it in an accessible location, such as
/usr/lib/lpd. Assign it ownership of root.printq and permissions 555.
Assuming you have an ASCII queue named asc on an IBM 4029 LaserPrinter, you can use lsvirprt to
select the asc queue and then format the f1 filter attribute. You should see something like the following:
User defined filter 1
f1 =
When you save the new definition of f1, you can again format it with lsvirprt; you should see something
like the following:
User defined filter 1
f1 = /usr/lib/lpd/cr_mapper
'/usr/lib/lpd/cr_mapper'
132
The f1 filter can now be used from the command line by using commands such as:
qprt -Pasc -f1 filename
enq -Pasc -o -f -o 1 filename
If the _d attribute was not set to p, the -dp flag and argument would have to be added to the commands.
qprt -Pasc -dp -f1 filename
enq -Pasc -o -d -o p -o -f -o 1 filename
The cr_mapper program reads characters from stdin and writes them to stdout. Whenever it reads and
writes a linefeed (a hex A, or decimal 10), it writes out a carriage return (a hex D).
/etc/qconfig File:
The /etc/qconfig configuration file can be edited with your text editor of choice.
There are unenforced rules concerning when you can and cannot edit the /etc/qconfig file without
halting or otherwise corrupting the operation of the spooler.
The /etc/qconfig file should never be edited when jobs are processing. This is especially true when your
system has a large number (greater than 25) of printers that are generally pretty busy. When the
qdaemon receives notification from enq that a new Job Description File (JDF) exists, the qdaemon
examines the dates on both /etc/qconfig and /etc/qconfig.bin, the binary version of /etc/qconfig. If
/etc/qconfig is younger than /etc/qconfig.bin, the qdaemon does not accept any new jobs, including
the one that caused it to examine the aforementioned files, until all currently running jobs have finished
processing. When the jobs have finished processing, the qdaemon creates a new version of
/etc/qconfig.bin.
If you cause the qdaemon to go into this state while jobs are processing, it is possible for the spooler to
hang. If you modify /etc/qconfig under these conditions, and if any printers are still generating output,
your best option is to leave the system alone and see if it comes back to life after all the jobs have
finished processing. If zero printers are producing output or the spooler appears to be hung, see
Cleaning up and starting over on page 234.
Note: Do not cause a change to /etc/qconfig while jobs are processing. Aside from editing /etc/qconfig
and writing a new version of the file to disk with a text editor, you can cause the same effect by using
the smit command to change a queue property or a parameter value.
Creation of queues with a text editor
The root user can edit /etc/qconfig and define queues with a text editor. One situation where this
should not be done is when the backend for the spooler queue is piobe. Queues that use piobe as
backend must have an associated virtual printer definition. In this situation, the root user should use the
smit command to create the queue. Using the smit command will run several programs that create the
virtual printer definition.
Transparent printing
Most terminals have an auxiliary port that can be connected to a serial printer. These terminals support
two print modes, Auxiliary and Transparent.
If both print modes are OFF, data received by the terminal is simply displayed on the screen. With
Auxiliary print mode ON, data received by the terminal is displayed on the screen and is also
transmitted to the printer. With Transparent Print Mode ON, the terminal transmits data received directly
to the printer, without displaying it on the screen.
133
Transparent printing allows you to use your terminal in a normal manner, while information is also being
sent over the same serial connection from the host to the printer connected to the terminals auxiliary
printer port. This is transparent printing. The transparent printing software determines whether packets
of data are bound for the screen or for the printer, and precedes data bound for the printer with the
Transparent Print Mode ON command, and follows it with the Transparent Print Mode OFF command.
Data for the terminal screen has the highest priority, and data is sent to the printer only when there is a
break in information being sent to the screen. If continuous data is being transmitted to the terminal
device, nothing gets sent to the printer.
Whenever an auxiliary printer port is used, flow control to the printer becomes an issue. If the printer
falls behind and invokes flow control, output to both the printer and the terminal is stopped. The
transparent print feature provides three parameters, accessible through SMIT, to limit printer output and
avoid this situation.
The SMIT Transparent Print Maximum Characters per Second parameter limits the maximum printer port
character-per-second data rate. This number should be set to the minimum character rate the printer can
sustain in typical use.
The SMIT Transparent Print Maximum Character Packet Size parameter limits the number of characters
queued to the printer ahead of terminal output. Lower numbers increase system overhead, higher
numbers result in keystroke echo delays. Specify a value of 50 for 9600 baud.
The SMIT Transparent Print Printer Buffer Size parameter should be set to a value just below the printers
buffer size. After a period of inactivity, the driver will burst up to this many characters to the printer to
fill the print buffer before slowing to the maxcps rate.
The printer on/off strings are also set using SMIT. A cable must be connected between the auxiliary port
of the terminal and the printer. The baud rate on the terminal auxiliary port and the printer must be the
same, and the printer and the auxiliary port of the terminal must use the same handshaking mode. The
auxiliary port must also be enabled. If your terminal is not one of those directly supported, you must
know the escape sequence of your terminal.
See your terminal and printer manuals for connection information, escape codes, and to see what
handshaking modes are supported (for example, busy/ready or RTS/CTS). Printer devices (xtty1, for
example) must not be in either the /etc/inittab or /etc/ttys files and must not be enabled.
For information about activating transparent printing, see: Configuring a Terminal-Attached Printer.
134
3. Select the appropriate printer device from the list of printer and plotter types shown on the screen
and press the Enter key. For this example, the following selection was made:
osp
6. In the displayed dialog fields, you can add or change the desired printer/plotter device attributes.
7. When you have finished, select Do.
135
Dev
--lp0
lp1
tty0
Status
-----READY
READY
READY
Job Files
---------
User
----
PP %
----
Blks
----
Cp
--
Rnk
---
2. Use the following enq command to send an ASCII file to the printer:
enq -P tty0asc /etc/qconfig
The file should be printed without altering the display or functionality of the terminal.
Printer-specific information
The format and content of the header and trailer pages can be customized by editing the files containing
the prototype text.
The files that contain the prototype text are in the /usr/lib/lpd/pio/burst directory. The file names are
in the format X.yyy, where X is either H to indicate header pages or T to indicate trailer pages. yyy
indicates the type of data stream: ascii for ASCII, ps for PostScript, or gl for plotter emulation. For
example, the file named H.ascii is the prototype text for header pages to be printed in ASCII, and T.ps
is the prototype text for trailer pages to be printed in PostScript. The escape sequences used in the text
files begin with the % (percent) character and are described with the pioburst command. See the
pioburst command for more information.
The following sections give you information specific to certain printers that you might need to configure
and set up your printer and queue systems:
IBM Personal Printer II Models 2380, 2381, 2390, 2391, 2380-2, 2381-2,
2390-2, 2391-2
Product specific information for each printer and queue system is provided.
136
Printers purchased in Greece or Turkey have the Greek or Turkish code pages available with the printer.
To print Greek or Turkish characters, you must notify the system that the code pages are available. To do
this:
1. As the root user, enter smit chpq.
2. Select the appropriate print queue and select Printer Setup on the Change/Show Characteristics
menu.
3. Change COUNTRY to the appropriate country selection.
137
The LaserPrinter can print on paper other than the default 8-1/2 by 11 inch size and on envelopes other
than the default #10 envelope. The paper or envelope size can be changed using SMIT and described in
Specifying paper size on page 33. To change paper or envelope size for a single print job, specify the
-Q flag with the qprt command.
If a font card is installed, the system must be alerted. To handle this, do the following:
1. As the root user, enter smit chpq.
2. Select the appropriate print queue and select Printer Setup on the Change/Show Characteristics
menu.
v Specify which font card is installed in the top card slot.
v Specify which font card is installed in the bottom card slot.
Note: The value of the nn variable is the font card identifier, which is the two-digit number just
above the arrow on the font card.
If a PostScript option is installed in your 4019 LaserPrinter and the PostScript option supports automatic
emulation/mode switching, the printer can be configured to switch automatically between PostScript
mode and emulation modes, as well as switching between emulation modes. To determine if the
PostScript option installed in your printer supports this, check the guide to operations manual that came
with your PostScript option. Or, verify that the PostScript interpreter is version 52.3 or later, by checking
the PostScript startup page that is printed when the printer is powered on in PostScript mode (unless it
has been disabled). If automatic emulation/mode switching is indicated, notify the system as follows:
1. As the root user, enter smit chpq.
2. Select the appropriate print queue and select Printer Setup on the Change/Show Characteristics
menu. Specify yes in the AUTOMATIC MODE SWITCHING for PostScript attribute.
Note:
a. The Japanese Base System Locale Package must be installed to print Japanese characters.
b. Japanese characters cannot be printed with PostScript option.
c. To print multibyte characters, specify 16x16 or 32x32 dot font with the -F option using the qprt
command. For example:
qprt -Pkji -F'RomanKn23,Kanji23,IBM_JPN23' file
138
If support for Greek or Turkish characters is needed and an NLS I font card is installed, the system needs
to know that the font card is installed:
1. As the root user, enter smit chpq.
2. Select the appropriate print queue and select Printer Setup on the Change/Show Characteristics
menu.
v Specify which font card is installed in the left card slot.
v Specify which font card is installed in the right card slot.
Note: The value of the nn variable is the last two digits of the font card part number.
where xxx is the device name of the printer, such as lp0. This instructs the system to download the Greek
or Turkish font to the printer.
139
The system selects the PostScript, Proprinter XL emulation, PCL emulation, or Diablo 630 emulation
without manual intervention.
ASCII files can also be printed using the PostScript data stream.
If you attach the printer to a serial port, you may need to send a special PostScript file to the printer to
establish the baud rate, parity, and protocol for the printer. The Personal Page Printer II Model 031 Guide to
Operations manual contains a sample file.
Print queues for the Proprinter XL, PCL emulation, and Diablo 630 emulations check the first two
characters of each print file. If the first two characters are %!, the file is assumed to be a PostScript file,
and the virtual printer for PostScript is used instead of the virtual printer implied by the print queue
name. If you have not configured a print queue for PostScript, the print job will fail.
If you want to print a PostScript file as an ASCII file instead of a PostScript file, specify the -da flag and
parameter with the qprt command when you submit the print job for the IBM Proprinter XL, PCL
emulation, or Diablo 630 emulations.
2. Select the appropriate print queue, and then select Printer Setup on the Change/Show Characteristics
menu.
3. Select the character set for the PRINTED LANGUAGE attribute.
140
2. Select the appropriate print queue and select Printer Setup on the Change/Show Characteristics
menu.
3. Specify yes for the CODE PAGE 850 attribute.
Specifies
0
1
2
3
4
5
6
7
brightness level.
Default Printer Setting
Lightest
Lighter
Light
Normal
Dark
Darker
Darkest
141
-E #
-k #
-K #
-S #
Specifies
0
1
2
3
Specifies
0
1
2
Specifies
0
1
2
3
4
5
6
Specifies
0
1
2
the finish.
Default Printer Setting
Normal
Matte
Glossy
the color model.
Default Printer Setting
CMYK
Grayscale
the color rendering dictionary.
Default Printer Setting
Scanner
Highlight
Photographic
Presentation
Monitor
Solid Color
the print mode.
Default Printer Setting
Photo Quality
Business Graphics
The following valid queue names are located on the IBM Network Color Printer:
ibmcolor_direct
ibmcolor_print
ibmncp_direct
ibmncp_print
Note: To determine the controller code level and amount of memory on your IBMNetwork Color Printer,
print a configuration page from the printer operator panel. See the configuration page under GENERAL
INFO. Memory is the second item, and the third item is version of the controller code. The predefined
files on AIX 4.2.1 or later only supports the IBM Network Color Printer 2.0 or higher controller code
level.
142
courier
courier-bold
courier-italic-bold
lettergothic
lettergothic-bold
lettergothic-italic
lineprinter
10, 12, or
10, 12, or
10, 12, or
10, 12, or
10, 12, or
10, 12, or
17 pitch
17
17
17
17
17
17
pitch
pitch
pitch
pitch
pitch
pitch
For example, entering the following command qprt -s Lineprinter -p 17 FileName causes the file
FileName to be printed in lineprinter font at 17 pitch (17 characters per inch).
The following are the type styles for Arabic, Greek, and Hebrew:
Arabic Type Styles
narkisstam narkisstam-bold
narkisstam-italic narkisstam-bold-italic
grtimesnr grtimesnr-bold
grtimesnr-oblique grtimesnr-bold-oblique
Note: Be sure to download the fonts to the Flash SIM or to a hard disk drive on the printer when using
the Arabic, Greek, or Hebrew type styles.
The IBM Network Printer 12, 17, and 24 support the following output bins. The output bins can be
accessed using the (-=) flag of the qprt command. The following table shows the possible values and the
corresponding output bin destination.
-= value (#)
10
50
Offset Bin
143
-= value (#)
The following additional qprt option flags are valid using the PS or PCL queue of the Network Printer 24
only:
-e #
Specifies staple and collation. The -e #option flag only works if a face-down finisher bin is selected. See -= option flag for
more information.
0
Default Printer Setting
1
Portrait Staple
2
Landscape Staple
3
Two Portrait Staples
4
Two Landscape Staples
5
Offset Jog at end of Job
6
Offset Jog at end of Set
7
No Stapling or Collating
Valid queue names located on the IBM Network Printer 12, 17, and 24 include:
TEXT
PASS
IBM InfoPrint 20
Product specific information for the printer and queue system is provided.
-q #
-u #
-= #
144
Specifies print quality options. The -q options for the InfoPrint 20 are:
600
Specifies 600 dpi
1200
Specifies 1200dpi. This produces prints that appear to have twice the actual printer resolution. 1200dpi
print quality is recommended for printing data such as images that were created at 1200dpi.
Sets the paper source. The -u options for the InfoPrint 20 are:
0
Use current input source selected on printer
1
Tray 1
2
Auxiliary tray - manual feed for paper
3
Auxiliary tray - manual feed for envelopes
4
Auxiliary tray - automatic
5
Tray 2
6
Envelope tray
7
Tray 3
9
2000 sheet input drawer
Sets type of output paper handling. The -= options for the InfoPrint 20 are:
0
Main
1
Main with Offset Option set
-Q #
-s Name
Specifies
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Specifies
paper size for the print job. The -Q options for the InfoPrint 20 are:
Letter
Legal
Folio
11 x 17
A4
B4
A3
Universal paper size
B5-JIS
A5
Executive
Statement
Hagaki
Monarch envelope
COM10 envelope
C5 envelope
DL envelope
Universal envelope size
a type style with the Name variable. Typestyles for the InfoPrint 20 are:
v courier
v courier-bold
v courier-italic
v courier-bold-italic
v gothic
v lineprinter
v gothic-bold
v gothic-italic
v prestige elite
v prestige elite-bold
v prestige elite-italic
v prestige elite-bold-italic
-e #
-k #
-s #
145
-u #
-z #
-Q #
-e #
-k #
-s #
146
-u #
-Q #
Queue Names
Hewlett-Packard LaserJets II, III, IIISi, 4, 4Si, 4Plus, 4V, 4000, 5Si/5Si
MX, 5Si Mopier, 8000 Color, and 8500 Color
Product specific information for each printer and queue system is provided.
147
Hewlett-Packard LaserJet printers can print on paper other than the default 8-1/2 by 11 inch size. The
paper size can be changed using SMIT as described in Specifying paper size on page 33. To change
paper size for a single print job, specify the -Q flag with the qprt command.
To print more lines per page than the line space allows (6 or 8 lines per inch), specify the number of lines
per page. The line spacing is compressed to allow the larger number of lines to fit on a page. For
example, if the lines spacing is 6 lines per inch, entering the command qprt -l 66 FileName causes the
file FileName to print at 66 lines per page instead of the default 60 lines per page.
The HP LaserJet III, IIISi, and 4 support the following fonts and pitches:
courier
courier-bold
courier-italic
lineprinter
For example, entering the command qprt -s Lineprinter -p 17 FileName causes the file FileName to be
printed in lineprinter font at 17 pitch (17 characters per inch).
Attaching a Hewlett-Packard LaserJet printer to an RS-422A serial port requires a special cable. You can
construct the cable using the following pin-out information:
Socket Connector (System End)
Signal
shell
Shield Ground
TxA
RxA
TxB
18
RxB
10
Signal Ground
148
LaserJet 5Si:
-= value (#)
50
HC0 face-up
50
The output bins can be accessed using the (-=) flag of the qprt command. The following table shows the
possible values and the corresponding output bin destination for the LaserJet 5Si Mopier:
LaserJet 5Si Mopier:
-= value (#)
50
HC0 face-up
50
51
Stapler bin
149
50
HC0 face-up
50
LaserJet 8000:
-= value (#)
50
HC0 face-up
50
51
Stapler bin
Number of copies:
The LaserJet 8000 and 8500 Color printers support printing copies internal. With the -W flag, only one
copy of the print job is sent to the printer and the copies are then produced by the printer. The basic
format is: -W #
Paper size:
Specifies paper size for the print job.
-Q
-Q
-Q
-Q
-Q
1
2
4
5
8
Letter
Legal
A4
Exec
A3
150
Paper Source
Paper source selection is supported by using the -u flag of the qprt command.
-u 1
tractor 1
-u 2
tractor 2
The banner and trailer pages use the same source as the print job. It is suggested that the printer be
attended when switching between tractors.
Pitch selection is supported by using the -p flag for the pitch, the -s flag for the font name, and the -q
flag of the qprt command for print quality. The default values supported include:
10
pitch
courier font
quality 1 or draft
The valid font values include:
Font Name
-s
fast draft
-s
draft
-s
courier
-s
gothic
The valid quality values include:
Quality (-q flag)
0
fast draft
1
draft
2
near letter quality
The valid pitch values are 10, 12, 17, and 20.
Note:
1. Selection of draft or fast draft will override the selected font.
Page Width
2. Bold font is supported using the -e flag and emphasized print. Italic font is supported using the -k
flag and italic print.
The -w flag controls the width of the printable page in characters. The default is 136.
Paper source selection is supported for both the enhanced PCL (R) 5 emulation and the PostScript Level 2
emulation by using the -u flag of the qprt command. There are several optional input sources. The input
source number is the same for both PCL and PostScript:
-u 0
manual feed
-u 1
tray 1
-u 2
tray 2
-u 3
tray 3
-u 4
feeder or feeder 1
-u 5
feeder 2
By default the banner and trailer pages come from the top tray. To change the default, change the values
for the uH and/or uT attributes, respectively, in the colon file to the value for the desired paper source
(s0-S5). Use the lsvirprt command.
151
Paper Size
Paper Type
Print Resolution
Pitch
Duplex Mode
Paper size selection is supported by using either one or both of the qprt command flags, -O and -Q. The
-O flag controls paper versus envelopes. A value of 3 indicates a paper size and 4 an envelope size.
Envelopes are only valid for manual feed, feeder, or feeder 2. The default for -O is 3 or paper. The default
for -Q is 1 or Letter for paper sizes and Com 10 for envelope sizes.
Paper Sizes (-0 3)
Envelope Sizes (-0 4)
-Q 1 Letter
7 3/4 Monarch
-Q 2 Legal
9 (Com 9)
-Q 3 B5 paper
10 (Com 10)
-Q 4 A4 DL
-Q 5 Executive
C5
-Q 6 A5 B5 Envelope
-Q 7
Other Envelope
The Optra printer supports paper types: rough, normal (default), transparency, labels, and cardstock using
the -y parameter of the qprt command or the _y attribute in the colon file.
-y 1
Rough
-y 2
Normal (default)
-y 3
Transparency
-y 4
Labels
-y 5
Cardstock
The Optra plus printer supports print resolution of 300, 600, and 1200 dpi using the -q flag of the qprt
command. The default is 600 dpi.
-q
300
-q
600
-q
1200
Pitch selection is supported for the PCL 5 emulation by using the -p flag for pitch and the -s flag for font
name with the qprt command. Pitch values between 1 and 100 characters per inch (cpi) in whole integers
are supported. The condensed print flag, -K, is not supported.
Font Name
Pitch
-s courier
-p (1 to 100)
-s courier-bold
-p (1 to 100)
-s courier-italic
-p (1 to 100)
-s courier-bold italic
-p (1 to 100)
-s gothic
-p (1 to 100)
-s gothic-bold
-p (1 to 100)
-sgothic-italic
-p (1 to 100)
-s lineprinter
-p 17
Note: To format ASCII for other font styles, use the base operating system enscript utility or the qprt
command with the -da, -s, and -p flags to a PostScript queue. For postscript queues, -p stands for point
size and the valid list of fonts are located in /usr/lib/ps/fontmap. Valid point sizes are any integer from 1
to 1008. Also, only a pitch of 17 is supported for the lineprinter font style.
The optional duplex feature is supported by the -Y flag of the qprt command.
-Y 0
simplex
-Y 1
duplex, long-edge binding
-Y 2
duplex. short-edge binding
152
Paper Source
Paper Size
Paper Type
Print Resolution
Pitch
Paper source selection is supported for both the enhanced PCL (R) 5 emulation and the PostScript Level 2
emulation by using the -u flag of the qprt command. There are several optional input sources. The input
source number is the same for both PCL and PostScript:
-u 0
manual feed
-u 1
tray 1
-u 2
tray 2
-u 3
tray 3
-u 4
feeder or feeder 1
-u 5
feeder 2
By default the banner and trailer pages come from the top tray. To change the default, change the values
for the uH and/or uT attributes respectively in the colon file to the value for the desired paper source (s0
- S5). Use the lsvirprt command.
Paper size selection is supported by using either one or both of the qprt command flags, -O and -Q. The
-O flag controls paper versus envelopes. A value of 3 indicates a paper size and 4 an envelope size.
Envelopes are only valid for manual feed, feeder, or feeder 2. The default for -O is 3 or paper. The default
for -Q is 1 or Letter for paper sizes and Com 10 for envelope sizes.
Paper Sizes (-0 3)
Envelope Sizes (-0 4)
-Q 1 Letter
7 3/4 Monarch
-Q 2 Legal
9 (Com 9)
-Q 3 B5 paper
10 (Com 10)
-Q 4 A4 DL
-Q 5 Executive
C5
-Q 6 A5 B5 Envelope
-Q 7
Other Envelope
The Optra Plus printer supports paper types: rough, normal (default), transparency, labels, and cardstock
using the -y parameter of the qprt command or the _y attribute in the colon file.
-y 1
Rough
-y 2
Normal (default)
-y 3
Transparency
-y 4
Labels
-y 5
Cardstock
The Optra Plus printer supports print resolution of 300, 600, and 1200 dpi using the -q flag of the qprt
command. The default is 600 dpi.
-q
300
-q
600
-q
1200
Pitch selection is supported for the PCL 5 emulation by using the -p flag for pitch and the -s flag for font
name with the qprt command. Pitch values between 1 and 100 characters per inch (cpi) in whole integers
are supported. The condensed print flag, -K, is not supported.
Font Name
Pitch
-s courier
-p (1 to 100)
-scourier-bold
-p (1 to 100)
-scourier-italic
-p (1 to 100)
-scourier-bold italic
-p (1 to 100)
-sgothic -p (1 to 100)
-s gothic-bold
-p (1 to 100)
-sgothic-italic
-p (1 to 100)
-s lineprinter
-p 17
Note: To format ASCII for other font styles, use the base operating system enscript utility or the qprt
command with the -da, -s, and -p flags to a PostScript queue. For PostScript queues, -p stands for point
size and the valid list of fonts are located in /usr/lib/ps/fontmap. Valid point sizes are any integer from 1
to 1008. Also, only a pitch of 17 is supported for the lineprinter font style.
153
Duplex Mode
Collation
Separator Pages
The optional duplex feature is supported by the -Y flag of the qprt command.
-Y 0
simplex
-Y 1
duplex, long-edge binding
-Y 2
duplex, short-edge binding
The Optra Plus printer supports collation of multiple copies of a print job internally. This feature is
controlled by the -W and -S flags of the qprt command.
-S !
collation off
-S +
collation on
-S #
number of copies
Note: This function is independent of the -N flag of the qprt command. The -N# flag will cause the
printer job to be sent to the printer # times. The -W# will send the print job once, and # copies of the job
will be printed.
The Optra Plus printer supports internally generated separator pages. This feature is controlled by the -E
flag of the qprt command.
-E 0
None
-E
Between Copies
-E 2
Between Jobs
-E 3
Between Pages
The paper source defaults to Feeder. To change the default, the uS attribute must be changed in the
virtual printer. The valid values for uS are the same as the paper source flag -u except that manual feed is
not a valid source.
Note: This function is independent of the -B flag of the qprt command.
Paper source selection is supported for both the PCL 5 emulation and the PostScript Language by using
the -u flag of the qprt command.
-u 0
manual feed
-u 1
tray 1
-u 2
tray 2
-u 3
tray 3
-u 4
multipurpose feeder
By default the banner and trailer pages come from the tray 1. To change the default, change the values for
the uH and/or uT attributes, respectively, in the colon file to the value for the desired paper source. Valid
values are the same as for the -u flag. Do this by editing the virtual printer colon file by using the
chvirprt command.
154
Paper Size
Pitch
Collation
Paper size selection is supported by using the qprt command flags, -O and -Q. The -O flag controls paper
versus envelope. A -O value of 3 indicates a paper size and 4 an envelope size. The values 1 and 2 were
skipped for backward compatibility. The first five paper sizes are also numbered for backward
compatibility. Whenever an invalid value for the input source is selected, it will be ignored.
Note: Envelopes are available through Manual and MP Tray only.
The default for -O is 3 or paper. The default for -Q is 1 or Letter for paper sizes and Monarch for
envelope sizes.
Paper Sizes (-0 3)
Envelope Sizes (-0 4)
-Q 1 Letter
7 3/4 Monarch
-Q 2 Legal
9 (Com 9)
-Q 3 B5 10 (Com 10)
-Q 4 A4 DL
-Q 5 A5 C5
-Q 6 B4 B5 Envelope
-Q 7 A3 Other Envelope
-Q 8 11 X 17
Note: The printer file (lexOptraC1200.pcl) for PCL 5 defaults the paper size to letter. To change the
default size, change the values for the s0-s3 attributes in the file respectively for the _u (paper source)
attributes. For example, to make legal the default size for tray 2, change the s2 attribute value to 2.
Note: For PCL queues, if the selected size is not in the selected input source, a search sequence will be
used to find the size requested. If the size is found that source will be used. For PostScript queues, if the
selected size is not in the selected input source, the printer will prompt the user to load the source with
the appropriate size. This may result in an unexpected paper source being used or an op-panel message
that may not make sense at first. See the manual to determine appropriate responses.
Pitch selection is supported for the PCL emulation by using the -p flag for pitch and the -s flag for font
name (or type face). Pitch values between 1 and 100 characters per inch (cpi) in whole integers are
supported. The condensed print flag, -K, is not supported.
Font Name
Pitch
-s courier
-p (1 to 100)
-scourier-bold
-p (1 to 100)
-scourier-italic
-p (1 to 100)
-scourier-bold italic
-p (1 to 100)
-sgothic -p (1 to 100)
-s gothic-bold
-p (1 to 100)
-sgothic-italic
-p (1 to 100)
-s lineprinter
-p 17
Note: To format ASCII files for other font styles use the base operating system enscript utility or the qprt
command with the -da, -s, and -p flags to a Postscript queue. For Postscript queues, -p stands for point
size and the valid list of fonts can be found in /usr/lib/ps/fontmap. Valid point sizes are any integer
from 1 to 1008.
Only a pitch of 17 is supported for the lineprinter font style.
Normally, the -N command line option is used to specify the number of copies desired. This method will
cause the specified copies of the entire print job to be submitted or queued to the print system. Because
the Optra Color 1200 supports collation internally, options were added to support it and the number of
copies of each page internally. This functionality- is limited by the amount of memory installed in your
printer and the size of the job. The -W# option determines how many copies of each page is desired,
where # is the number of copies. The -S [!/+] option controls whether collation is desired. The default is !
(or not). The main advantages of using the -W and -S options are to conserve printer subsystem usage
and allow the printer to handle multiple copies instead of sending # copies to the printer. Using the -S!
options with -W# also allows # copies of each page in a row, if that is desired. Note that using -N and -W
simultaneously is allowed. This would result in -N print jobs with -W copies of each page in each job.
155
Separator Pages
The -E flag controls separator pages. The valid values are 0, 1, 2, and 3 which represent NONE,
BETWEENCOPIES, BETWEENJOBS, and BETWEENPAGES respectively. The paper source for separator
pages is set via the colon file attribute uS and defaults to TRAY 1. The valid values for uS are the same as
uH and uT, except manual feed is not a valid source for separator pages. To change the default, the uS
attribute must be changed in the virtual printer to one of the valid values (see the Paper Source
information for this printer).
Paper Size
Paper source selection is supported for both the PCL 5 emulation and the PostScript Language by using
the -u flag of the qprt command.
-u 0
manual feed
-u 1
tray 1
Paper size selection is supported by using the qprt command flags, -O and -Q. The -O flag controls paper
versus envelope. A -O value of 3 indicates a paper size and 4 an envelope size. The values 1 and 2 were
skipped for backward compatibility. The first five paper sizes are also numbered for backward
compatibility. Whenever an invalid value for the input source is selected, it will be ignored.
Note: Envelopes available from Manual and Tray 1.
The default for -O is 3 or paper. The default for -Q is 1 or Letter for paper sizes and Monarch for
envelope sizes.
Paper Sizes (-0 3)
Envelope Sizes (-0 4)
-Q 1 Letter
7 3/4 Monarch
-Q 2 Legal
9 (Com 9)
-Q 3 B5 10 (Com 10)
-Q 4 A4 DL
-Q 5 Executive
C5
-Q 6 A5 B5 Envelope
-Q 7 Universal
Other Envelope
Note: The printer file (lexOptraC40.pcl) for PCL 5 defaults the paper size to letter. To change the default
size, change the values for the s0-s3 attributes in the file respectively for the _u (paper source) attributes.
For example, to make legal the default size for tray 2 change the s2 attribute value to 2.
Note: For PCL queues, if the selected size is not in the selected input source, a search sequence will be
used to find the size requested. If the size is found that source will be used. For PostScript queues, if the
selected size is not in the selected input source, the printer will prompt the user to load the source with
the appropriate size. This may result in an unexpected paper source being used or an operator panel
message that may not make sense at first. See the manual to determine appropriate responses.
156
Pitch
Collation
Separator Pages
Pitch selection is supported for the PCL emulation by using the -p flag for pitch and the -s flag for font
name (or type face). Pitch values between 1 and 100 characters per inch (cpi) in whole integers are
supported. The condensed print flag, -K, is not supported.
Font Name
Pitch
-s courier
-p (1 to 100)
-scourier-bold
-p (1 to 100)
-scourier-italic
-p (1 to 100)
-scourier-bold italic
-p (1 to 100)
-sgothic -p (1 to 100)
-s gothic-bold
-p (1 to 100)
-sgothic-italic
-p (1 to 100)
-s lineprinter
-p 17
Note: To format ASCII files for other font styles use the base operating system enscript utility or the qprt
command with the -da, -s, and -p flags to a Postscript queue. For Postscript queues, -p stands for point
size and the valid list of fonts can be found in /usr/lib/ps/fontmap. Valid point sizes are any integer
from 1 to 1008.
Only a pitch of 17 is supported for the lineprinter font style.
Normally, the -N command line option is used to specify the number of copies desired. This method will
cause that many copies of the entire print job to be submitted or queued to the print system. Because the
Optra Color 40 supports collation internally, options were added to support it and the number of copies
of each page internally. This functionality- is limited by the amount of memory installed in your printer
and the size of the job. The -W# option determines how many copies of each page is desired, where # is
the number of copies. The -S [!/+] option controls whether collation is desired. The default is ! (or not).
The main advantages of using the -W and -S options are to conserve printer subsystem usage and allow
the printer to handle multiple copies instead of sending # copies to the printer. Using the -S! options with
-W# also allows # copies of each page in a row, if that is desired. Note that using -N and -W
simultaneously is allowed. This would result in -N print jobs with -W copies of each page in each job.
The -E flag controls separator pages. The valid values are 0, 1, 2, and 3 which represent NONE,
BETWEENCOPIES, BETWEENJOBS, and BETWEENPAGES respectively. The paper source for separator
pages is set via the colon file attribute uS and defaults to TRAY 1. The valid values for uS are the same as
uH and uT, except manual feed is not a valid source for separator pages. To change the default the uS
attribute must be changed in the virtual printer to one of the valid values (see paper source above).
Paper source selection is supported for both the PCL 5 emulation and the PostScript Language by using
the -u flag of the qprt command.
-u 0
manual feed
-u 1
tray 1
157
Paper Size
Paper size selection is supported by using the qprt command flags, -O and -Q. The -O flag controls paper
versus envelope. A -O value of 3 indicates a paper size and 4 an envelope size. The values 1 and 2 were
skipped for backward compatibility. The first five paper sizes are also numbered for backward
compatibility. Whenever an invalid value for the input source is selected, it will be ignored.
Note: Envelopes available from Manual and Tray 1.
The default for -O is 3 or paper. The default for -Q is 1 or Letter for paper sizes and Monarch for
envelope sizes.
Paper Sizes (-0 3)
Envelope Sizes (-0 4)
-Q 1 Letter
7 3/4 Monarch
-Q 2 Legal
9 (Com 9)
-Q 3 B5 10 (Com 10)
-Q 4 A4 DL
-Q 5 A5 C5
-Q 6 Executive
B5 Envelope
-Q 7 A3 Other Envelope
-Q 8 11 X 17
-Q 9 Universal
-
Pitch
Note: The printer file (lexOptraC45.pcl) for PCL 5 defaults the paper size to letter. To change the default
size, change the values for the s0-s3 attributes in the file respectively for the _u (paper source) attributes.
For example, to make legal the default size for tray 2 change the s2 attribute value to 2.
Note: For PCL queues, if the selected size is not in the selected input source, a search sequence will be
used to find the size requested. If the size is found that source will be used. For PostScript queues, if the
selected size is not in the selected input source, the printer will prompt the user to load the source with
the appropriate size. This may result in an unexpected paper source being used or an operator panel
message that may not make sense at first. See the manual to determine appropriate responses.
Pitch selection is supported for the PCL emulation by using the -p flag for pitch and the -s flag for font
name (or type face). Pitch values between 1 and 100 characters per inch (cpi) in whole integers are
supported. The condensed print flag, -K, is not supported.
Font Name
Pitch
-s courier
-p (1 to 100)
-scourier-bold
-p (1 to 100)
-scourier-italic
-p (1 to 100)
-scourier-bold italic
-p (1 to 100)
-sgothic -p (1 to 100)
-s gothic-bold
-p (1 to 100)
-sgothic-italic
-p (1 to 100)
-s lineprinter
-p 17
Note: To format ASCII files for other font styles use the base operating system enscript utility or the qprt
command with the -da, -s, and -p flags to a Postscript queue. For Postscript queues, -p stands for point
size and the valid list of fonts can be found in /usr/lib/ps/fontmap. Valid point sizes are any integer
from 1 to 1008.
Only a pitch of 17 is supported for the lineprinter font style.
158
Collation
Separator Pages
Normally, the -N command line option is used to specify the number of copies desired. This method will
cause that many copies of the entire print job to be submitted or queued to the print system. Because the
Optra Color 45 supports collation internally, options were added to support it and the number of copies
of each page internally. This functionality- is limited by the amount of memory installed in your printer
and the size of the job. The -W# option determines how many copies of each page is desired, where # is
the number of copies. The -S [!/+] option controls whether collation is desired. The default is ! (or not).
The main advantages of using the -W and -S options are to conserve printer subsystem usage and allow
the printer to handle multiple copies instead of sending # copies to the printer. Using the -S! options with
-W# also allows # copies of each page in a row, if that is desired. Note that using -N and -W
simultaneously is allowed. This would result in -N print jobs with -W copies of each page in each job.
The -E flag controls separator pages. The valid values are 0, 1, 2, and 3 which represent NONE,
BETWEENCOPIES, BETWEENJOBS, and BETWEENPAGES respectively. The paper source for separator
pages is set via the colon file attribute uS and defaults to TRAY 1. The valid values for uS are the same as
uH and uT, except manual feed is not a valid source for separator pages. To change the default the uS
attribute must be changed in the virtual printer to one of the valid values (see paper source above).
Paper Size
Paper source selection is supported for both the enhanced PCL (R) 5e emulation and the PostScript (tm)
Level 2 emulation by using the -u flag of the qprt command. There are several optional input sources (see
your manual to determine which are installed). These numbers apply, no matter which ones are present. If
one is not present, choosing one of those will simply default as per the users manual. The input source
number is the same for both PCL and PostScript:
-u 0
manual feed
-u 1
tray 1
-u 2
tray 2
-u 3
multipurpose tray
By default the banner and trailer pages come from tray 1. To change the default, change the values for the
uH and/or uT attributes, respectively, in the virtual printer to the value for the desired paper source. Do
this using the chvirprt command. Valid values are the same as for the -u flag.
Paper size selection is supported by using either one or both of the qprt command flags, -O and -Q. The -O
flag controls paper versus envelope. A value of 3 indicates a paper size and 4 an envelope size. The values 1
and 2 were skipped for backward compatibility. Envelopes are only valid for manual feed, envelope feeder,
or the multipurpose tray. The default for -Q is 1 or Letter for paper sizes and 3 or Com 10 for envelope
sizes. To change the defaults change the s0-s7 attributes respectively for each of the valid input sources.
Because manual feed and the multipurpose tray support both paper and envelopes, the default for paper is
the else part (%e1) and the default for envelopes is the then part (%t3) of s0 and s7.
Paper Sizes (-0 3)
Envelope Sizes (-0 4)
-Q 1 Letter
7 3/4 Monarch
-Q 2 Legal
9 (Com 9)
-Q 3 B5 (JIS B5)
10 (Com 10)
-Q 4 A4 DL
-Q 5 Executive
C5
-Q 6 A5 B5 Envelope
-Q 7 Custom (Universal)
Other Envelope
Note: For PCL queues, if the selected size is not in the selected input source, a search sequence will be used
to find the size requested. If the size is found that source will be used. For PostScript queues, if the selected
size is not in the selected input source, the printer will prompt the user to load the source with the
appropriate size. This may result in an unexpected paper source being used or an op-panel message that
may not make sense at first. See the manual to determine appropriate responses.
159
Pitch
Collation
Separator Pages
Pitch selection is supported for the PCL emulation by using the -p flag for pitch and the -s flag for font
name (or type face). Pitch values between 1 and 100 characters per inch (cpi) in whole integers are
supported. The condensed print flag, -K, is not supported.
Font Name
Pitch
-s courier
-p (1 to 100)
-scourier-bold
-p (1 to 100)
-scourier-italic
-p (1 to 100)
-scourier-bold italic
-p (1 to 100)
-sgothic -p (1 to 100)
-s gothic-bold
-p (1 to 100)
-sgothic-italic
-p (1 to 100)
-s lineprinter
-p 17
Note: To format ASCII files for other font styles use the base operating system enscript utility or the -da
flag to a Postscript queue with the qprt command. Also, only a pitch of 17 is supported for the lineprinter
font style.
Normally, the -N command line option is used to specify the number of copies desired. This method will
cause the specified number of copies of the entire print job to be submitted or queued to the print system.
Because the Optra K 1220 supports collation internally, options were added to support it and the number of
copies of each page internally. This functionality is limited by the amount of memory installed in your
printer and the size of the job. The -W# option determines how many copies of each page is desired, where
# is the number of copies. The -S [!/+] option controls whether collation is desired. The default is ! (or not).
The main advantages of using the -W and -S options are to conserve printer subsystem usage and allow the
printer to handle multiple copies instead of sending # copies to the printer. Using the -S! options with -W#
also allows # copies of each page in a row, if that is desired. Note that using -N and -W simultaneously is
allowed. This would result in -N print jobs with -W copies of each page in each job.
The -E flag controls separator pages. The valid values are 0, 1, 2, and 3 which represent NONE,
BETWEENCOPIES, BETWEENJOBS, and BETWEENPAGES respectively. The paper source for separator
pages is set via the colon file attribute uS and defaults to TRAY 1. The valid values for uS are the same as
uH and uT, except manual feed is not a valid source for separator pages. To change the default, the uS
attribute must be changed in the virtual printer to one of the valid values (see paper source above).
Paper Source
160
To print color files, or any preformatted print job in PCL language, use the -dp flag of
the qprt command. This sets the base operating system printer backend to
passthrough mode and should be used any time you are printing from an application
in PCL emulation.
The print queue default can be changed to passthrough by modifying the _d attribute
in the colon file. See AIX 5L Version 5.3 Commands Reference, Volume 3 for information
about the lsvirprt command.
Paper source selection is supported for both the PCL 5 emulation and the PostScript
Language by using the -u flag of the qprt command.
PCL
PostScript
-u 1 Top tray
-u 1 Top tray
-u 2 Bottom tray
-u 2 Bottom tray
-u 3 feeder
-u 3 feeder
Paper Size
Pitch
Paper size selection is supported for the PCL 5 emulation by using the -Q flag of the
qprt command.
Paper Sizes
Size
-Q 1
Letter (default)
-Q 2
Legal
-Q 3
B5
-Q 4
A4
To change the default size, change the values for the s1-s3 attributes in the file. For
example, to make A4 the default size for all paper sources, change s1, s2, and s3 to 4.
This changes the top tray, bottom tray, and feeder tray sizes respectively.
Pitch selection is supported for the PCL 5 emulation by using the -p flag for pitch and
the -s flag for font name with the qprt command. Pitch values between 1 and 100
characters per inch (cpi) in whole integers are supported. The condensed print flag,
-K, is not supported.
Font Name
Pitch
-s courier
-p (1 to 100)
-s courier-bold
-p (1 to 100)
-s courier-italic
-p (1 to 100)
-s courier-bold italic
-p (1 to 100)
-s gothic
-p (1 to 100)
-s gothic-bold
-p (1 to 100)
-s gothic-italic
-p (1 to 100)
-s lineprinter
-p 17
Note: To format ASCII for other font styles, use the base operating system enscript
utility or the qprt command with the -da, -s, and -p flags to a PostScript queue. For
PostScript queues, -p stands for point size and the valid list of fonts are located in
/usr/lib/ps/fontmap. Valid point sizes are any integer from 1 to 1008.
Collation
Separator Pages
161
Paper Source
Paper Size
Paper Type
Print Resolution
162
Paper source selection is supported for both the PCL 5 emulation and the PostScript Language by using
the -u flag of the qprt command.
PCL
-u 1
manual feed
-u 2
top tray
-u 3
bottom tray
By default the banner and trailer pages come from the top tray. To change the default, change the values
for the uH and/or uT attributes respectively in the colon file to the value for the desired paper source
(s1-s3). Use the lsvirprt command.
Paper size selection is supported for the PCL 5 emulation by using the -Q and -O flags of the qprt
command. A value of 3 for the -O flag indicates paper and a value of 4 indicates envelope. Envelopes are
not valid in tray 2.
Paper Sizes (-0 3)
Envelope Sizes (-0 4)
-Q 1 Letter
7 3/4 Monarch
-Q 2 Legal
9 (Com 9)
-Q 3 B5 paper
10 (Com 10)
-Q 4 A4 DL
-Q 5
Executive C5
-Q 6 A5 B5 Envelope
-Q 7
Other Envelope
Note: The printer file (optra_e.pcl) for PCL 5 defaults the paper size to letter. To change the default size,
change the values for the s1-s3 attributes in the file. For example, to make A4 the default size for all
paper sources, change s1, s2, and s3 to 4. This changes the top tray, bottom tray, and feeder tray sizes
respectively.
The Optra E printer supports paper types: rough, normal (default), transparency, labels, and cardstock
using the -y parameter of the qprt command or the _y attribute in the colon file.
-y 1
Rough
-y 2
Normal (default)
-y 3
Transparency
-y 4
Labels
-y 5
Cardstock
Note: These values apply only to paper and not envelopes. The only values supported for tray 2 are
rough and normal.
The Optra E printer supports print resolution of 300 and 600 dpi using the -q flag of the qprt command.
The default is 300 dpi.
-q
300
-q
600
Pitch
Pitch selection is supported for the PCL 5 emulation by using the -p flag for pitch and the -s flag for font
name with the qprt command. Pitch values between 1 and 100 characters per inch (cpi) in whole integers
are supported. The condensed print flag, -K, is not supported.
Font Name
Pitch
-s courier
-p (1 to 100)
-s courier-bold
-p (1 to 100)
-s courier-italic
-p (1 to 100)
-s courier-bold italic
-p (1 to 100)
-sgothic -p (1 to 100)
-s gothic-bold
-p (1 to 100)
-s gothic-italic
-p (1 to 100)
-s lineprinter
-p 17
Note: To format ASCII for other font styles, use the base operating system enscript utility or the qprt
command with the -da, -s, and -p flags to a PostScript queue. For postscript queues, -p stands for point
size and the valid list of fonts are located in /usr/lib/ps/fontmap. Valid point sizes are any integer from 1
to 1008.
Also, only a pitch of 17 is supported for the lineprinter font style.
The -W flag allows the user to control how many copies of each page is produced by the printer itself.
For example, if a three-page job is submitted with the -W flag of the -qprt command, then 2 copies of
page one, followed by 2 copies of page two, followed by 2 copies of page three will be printed. The
default value is 1, and the maximum value is 999.
Paper source selection is supported for both the enhanced PCL (R) 5 emulation and the PostScript Level 2
emulation by using the -u flag of the qprt command. There are several optional input sources (see your
printer documentation to determine which are installed). The optional input sources apply no matter
which ones are installed. If one is not present, choosing one will use the default. The input source number
is for both PCL and PostScript:
-u 0
manual feed
-u 1
tray 1
-u 2
tray 2
-u 3
tray 3
-u 4
envelope feeder
-u 5
multipurpose tray
163
Paper Size
Paper size selection is supported by using -O and -Q flags of the qprt command. The -O flag controls
paper versus envelope. A -O value of 3 indicates a paper size and 4 an envelope size. The values 1 and 2
were skipped for backward compatibility. The first five paper sizes are also numbered for backward
compatibility. Whenever an invalid value for the input source is selected, it is ignored.
The default for -O is 3 or paper. The default for -Q is 1 or Letter for paper sizes and Monarch for envelope
sizes.
Paper Sizes (-0 3)
Envelope Sizes (-0 4)
-Q 1 Letter
7 3/4 Monarch
-Q 2 Legal
9 (Com 9)
-Q 3 B5 paper
10 (Com 10)
-Q 4 A4 DL
-Q 5 Executive
C5
-Q 6 A5 B5 Envelope
-Q 7 B4 Other Envelope (MPT only)
-Q 8 A3
-Q 9 Ledger (11x17)
-Q 10 Custom (11.69x17.69)
To change the defaults, change the s0 - s5 attributes for each valid input value. Because manual feed,
envelope feeder, and the multipurpose tray support both paper and envelopes, to change the defaults, edit
s0, s4, or s5. For these three, the default for paper is the else part (%e1), and the default for envelopes is
the then part (%t3).
Note:
1. Envelopes are only valid for manual feed, envelope feeder, or the multipurpose tray.
2. Trays 1, 2, and 3 support only paper sizes.
3. The multipurpose tray (MPT) supports both paper and envelopes.
4. Tray 1 supports sizes -Q 1, 2, 4, and 7 (Letter, Legal, A4, and B4).
5. Trays 2 and 3 support sizes -Q 1, 2, 4, 7, 8, 9 (Letter, Legal, A4, B4, A3, Ledger).
6. The multipurpose tray supports all sizes of paper and envelopes.
7. The other envelope size is supported only by the multipurpose tray.
8. The printer and colon file defaults paper size to Letter for the US and A4 for Europe, and envelope
size to COM10 for the US and DL for Europe.
9. Whenever an invalid value for the input source is selected, an error will be reported.
10. If the selected size is not in the input source selected (wrong size or empty), a search sequence is used
to find the size requested. See your printer documentation for more information.
164
Pitch selection is supported for the PCL 5 emulation by using the -p flag for pitch and the -s flag for font
name with the qprt command. Pitch values between 1 and 100 characters per inch (cpi) in whole integers
are supported. The condensed print flag, -K, is not supported.
Font Name
Pitch
-s courier
-p (1 to 100)
-s courier-bold
-p (1 to 100)
-s courier-italic
-p (1 to 100)
-s courier-bold italic
-p (1 to 100)
-s gothic
-p (1 to 100)
-s gothic-bold
-p (1 to 100)
-s gothic-italic
-p (1 to 100)
-slineprinter
-p 17
Note: To format ASCII for other font styles, use the base operating system enscript utility or the qprt
command with the -da, -s, and -p flags to a PostScript queue. For PostScript queues, -p stands for point
size and the valid list of fonts are located in /usr/lib/ps/fontmap. Valid point sizes are any integer from 1
to 1008. Also, only a pitch of 17 is supported for the lineprinter font style.
Duplex Mode
The optional duplex feature is supported by the -Y flag of the qprt command.
-Y 0
simplex
-Y 1
duplex, long-edge binding
-Y 2
duplex, short-edge binding
Collation and Number The Optra N printer supports collation of multiple copies of a print job internally. This feature is controlled
of Copies
by the -W and -S flags of the qprt command.
-S !
collation off
-S +
collation on
-W #
number of copies
Note:
Pitch
1. This function is independent of the -N flag of the qprt command. The -N# flag causes the printer to
send the job to the printer times. The -W# sends the print job once, and # copies of the job are printed.
Separator Pages
Output Bin
Faceup or Facedown
2. The function is limited by the amount of memory installed in the printer and the size of the print job.
The Optra N printer supports internally generated separator pages. This feature is controlled by the -E flag
of the qprt command.
-E 0
None
-E 1
Between Copies
-E 2
Between Jobs
-E 3
Between Pages
The paper source defaults to tray 1. To change the default, the uS attribute must be changed in the virtual
printer. The valid values for uS are:
uS 1
tray 1
uS 2
tray 2
uS 3
tray 3
uS 4
envelope feeder
uS 5
multipurpose tray
Note: This function is independent of the -B flag of the qprt command.
The equal sign (=) is the command line option for specifying the output destination. Valid values are:
0
printer top bin
1
finisher bin 1
2
finisher bin 2
3
finisher bin 3
50
printer side bin
The printer top bin or 0 is the default value for the output bin.
Note: If the printer side bin is selected and the finisher option is installed, the output will go to the active
bin.
The -U option controls whether paper is output face-up or face-down for the finisher.
Note: The printer top bin is always facedown. A value of + or true indicates face-down and is the default.
A value of ! or false indicates face-up. If face-up is selected the staples (-y) and job offset (-e) are ignored.
Printers and Printing
165
Staples
Job Offset
The -y option controls whether staples are desired or not. Only certain paper sizes are supported for each
of the values for this flag. Also, there are several rules about output quantities and destinations. See your
printer documentation for details on all the possibilities. The valid values are:
0
no staples (default)
1
one staple (top left)
2
two staples (left side)
The -e flag controls whether offsetting the first page of each job in the finisher bin is desired. The first
page is offset toward the front of the finisher by 1.7 inches. The offset function is ignored if staples are not
off. Separator sheets may be selected independently of offset. The valid values are:
+
job offset ON
!
job offset OFF (default)
Paper Source
Paper Size
Paper Type
166
Page rotation selection is supported for the PCL 5 emulation by using the -z flag of the qprt
command.
-z 0
Portrait
-z 1
Landscape
Paper source selection is supported for both the enhanced PCL 5 emulation and the PostScript Level 2
emulation by using the -u flag of the qprt command. The input source number is the same for both
PCL and PostScript:
-u 0
manual feed
-u 1
tray 1
By default, the banner and trailer pages come from the top tray. To change the default, change the
values for the uH and/or uT attributes respectively in the colon file to the value for the desired paper
source. The valid values are the same as for the -u flag. Do this by editing the virtual printer colon
file by using the chvirprt command.
Paper size selection is supported by using -O and -Q flags of the qprt command. The -O flag controls
paper versus envelope. A -O value of 3 indicates a paper size and 4 an envelope size.
Paper Sizes (-0 3)
Envelope Sizes (-0 4)
-Q 1 Letter
7 3/4 Monarch
-Q 2 Legal
9 (Com 9)
-Q 3 B5 10 (Com 10)
-Q 4 A4 DL
-Q 5 Executive
C5
-Q 6 A5 B5 Envelope
-Q 7
Other Envelope (MPT only)
To change the defaults, change the s1, s3 attribute values in the lexOptraE310.pcl colon file. The
default for paper size is 1 or letter, and the default for envelopes is 3 or Com 10. The letter value is
the else part (%e1) of the s1 and s3 attributes, and the envelope is the then part (%t3).
The Optra E310 printer supports paper types ROUGH, NORMAL (default), TRANSPARENCY,
LABELS, and CARDSTOCK via the -y parameter to the qprt command, or the -y attribute in the colon
file. The values to the -y option are 1 through 5 respectively for the above types.
-y 1
Bond
-y 2
Plain
-y 3
Transparency
-y 4
Labels
-y 5
Cardstock
Note: These values do not apply to envelopes.
Pitch
Pitch selection is supported for the PCL emulation by using the -p flag for pitch and the -s flag for
font name (or type face) with the qprt command. Pitch values between 1 and 100 characters per inch
(cpi) in whole integers are supported. The condensed print flag, -K, is not supported.
Font Name
Pitch
-s courier
-p (1 to 100)
-s courier-bold
-p (1 to 100)
-s courier-italic
-p (1 to 100)
-s courier-bolditalic
-p (1 to 100)
-s gothic
-p (1 to 100)
-s gothic-bold
-p (1 to 100)
-s gothic-italic
-p (1 to 100)
-s lineprinter
-p 17
Note: To format ASCII for other font styles, use the base operating system enscript utility or the qprt
command with the -da, -s, and -p flags to a PostScript queue. For PostScript queues, -p stands for
point size and the valid list of fonts is located in /usr/lib/ps/fontmap. Valid point sizes are any
integer from 1 to 1008.
Paper Source
Page rotation selection is supported for the PCL 5e emulation by using the -z flag of the qprt
command.
-z 0
Portrait
-z 1
Landscape
Paper source selection is supported for both the enhanced PCL (R) 5e emulation and the PostScript
Level 2 emulation by using the -u flag of the qprt command. There are several optional input sources
(see your manual to determine which are installed). These numbers apply, no matter which ones are
present. If one is not present, choosing one of those will simply default as per the users manual. The
input source number is the same for both PCL and PostScript:
-u 0
manual feed
-u 1
tray 1
-u 2
tray 2
-u 3
multipurpose tray
By default, the banner and trailer pages come from tray 1. To change the default, change the values
for the uH and/or uT attributes, respectively, in the virtual printer to the value for the desired paper
source. The valid values are the same as for the -u flag. Do this by editing with the chvirprt
command.
167
Paper Size
Pitch
Collation
168
Paper size selection is supported by using either one or both of the qprt command flags, -O and -Q.
The -O flag controls paper versus envelope. A -O value of 3 indicates a paper size and 4 an envelope
size. The values 1 and 2 were skipped for backward compatibility. Envelopes are only valid for
manual feed, envelope feeder, or the multipurpose tray. The default for -Q is 1 or Letter for paper
sizes, and 3 or Com 10 for envelope sizes. To change the defaults, change the s0 - s7 attributes
respectively for each of the valid input sources. Because manual feed and the multipurpose tray
support both paper and envelopes, the default for paper is the else part (%e1), and the default for
envelopes is the then part (%t3) of s0 and s7.
Paper Sizes (-O 3)
Envelope Sizes (-O 4)
-Q 1 Letter
7 3/4 Monarch
-Q 2 Legal
9 (Com 9)
-Q 3 B5 (JIS B5)
10 (Com 10)
-Q 4 A4 DL
-Q 5 Executive
C5
-Q 6 A5 B5 Envelope
-Q 7 Custom (Universal)
Other Envelope
Note: For PCL queues, if the selected size is not in the selected input source, a search sequence will
be used to find the size requested. If the size is found, that source will be used. For PostScript queues,
if the selected size is not in the selected input source, the printer will prompt the user to load the
source with the appropriate size. This may result in an unexpected paper source being used or an
operator panel message that may not make sense at first. See the manual to determine appropriate
responses.
Pitch selection is supported for the PCL 5 emulation by using the -p flag for pitch and the -s flag for
font name (or type face) with the qprt command. Pitch values between 1 and 100 characters per inch
(cpi) in whole integers are supported. The condensed print flag, -K, is not supported.
Font Name
Pitch
-s courier
-p (1 to 100)
-s courier-bold
-p (1 to 100)
-s courier-italic
-p (1 to 100)
-s courier-bolditalic
-p (1 to 100)
-s gothic
-p (1 to 100)
-s gothic-bold
-p (1 to 100)
-s gothic-italic
-p (1 to 100)
-s lineprinter
-p 17
Note: To format ASCII for other font styles, use the base operating system enscript utility or the -da
flag to a PostScript queue with the qprt command. Only a pitch of 17 is supported for the lineprinter
font style.
Normally, the -N command line option is used to specify the number of copies desired. This method
will cause the specified number of copies of the entire print job to be submitted or queued to the
print system. Because the Optra 410 supports collation internally, options were added to support it
and the number of copies of each page internally. This functionality is limited by the amount of
memory installed in your printer and the size of the job. The -W # option determines how many
copies of each page is desired, where # is the number of copies. The -S [!/+] option controls whether
collation is desired. The default is ! (or not). The main advantages of using the -W and -S options are
to conserve printer subsystem usage and allow the printer to handle multiple copies instead of
sending # copies to the printer. Using the -S! options with the -W # also allows # copies of each page
in a row, if this is desired. Note that using -N and -W simultaneously is allowed. This would result in
-N print jobs with -W copies of each page in each job.
Separator Pages
The -E flag controls separator pages. The valid values are 0, 1, 2, and 3, which represent NONE,
BETWEENCOPIES, BETWEENJOBS, and BETWEENPAGES, respectively. The separator page source
defaults to TRAY 1 and is specified via the uS attribute. The valid values for uS are the same as for
header and trailer pages (uH and uT respectively), except that the Manual Feeder is not supported. To
change the default, the uS attribute must be changed in the virtual printer to one of the valid values
(see the chvirprt command).
Paper Source
Paper Size
Paper Type
Page rotation selection is supported for the PCL 5e emulation by using the -z flag of the qprt
command.
-z 0
Portrait
-z 1
Landscape
Paper source selection is supported for both the enhanced PCL (R) 5e emulation and the PostScript
Level 2 emulation by using the -u flag of the qprt command. There are several optional input sources
(see your manual to determine which are installed). These numbers apply, no matter which ones are
present. If one is not present, choosing one of those will simply default as per the users manual. The
input source number is the same for both PCL and PostScript:
-u 0
manual feed
-u 1
tray 1
-u 2
tray 2
-u 3
tray 3
-u 4
tray 4
-u 5
tray 5
-u 6
envelope feeder
-u 7
multipurpose tray
By default, the banner and trailer pages come from tray 1. To change the default, change the values
for the uH and/or uT attributes, respectively, in the virtual printer to the value for the desired paper
source. The valid values are the same as for the -u flag. Do this with the chvirprt command.
Paper size selection is supported by using -O and -Q flags of the qprt command. The -O flag controls
paper versus envelope. A -O value of 3 indicates a paper size and 4 an envelope size. The values 1
and 2 were skipped for backward compatibility. Envelopes are only valid for manual feed, envelope
feeder, or the multipurpose tray. The default for -Q is 1 or Letter for paper sizes, and 3 or Com 10 for
envelope sizes. To change the defaults, change the s0 - s7 attributes respectively for each of the valid
input sources. Because manual feed and the multipurpose tray support both paper and envelopes, the
default for paper is the else part (%e1), and the default for envelopes is the then part (%t3) of s0 and
s7.
Paper Sizes (-O 3)
Envelope Sizes (-O 4)
-Q 1 Letter
7 3/4 Monarch
-Q 2 Legal
9 (Com 9)
-Q 3 B5 (JIS B5)
10 (Com 10)
-Q 4 A4 DL
-Q 5 Executive
C5
-Q 6 A5 B5 Envelope
-Q 7 Custom (Universal)
Other Envelope
Note: For PCL queues, if the selected size is not in the selected input source, a search sequence will
be used to find the size requested. If the size is found, that source will be used. For PostScript queues,
if the selected size is not in the selected input source, the printer will prompt the user to load the
source with the appropriate size. This may result in an unexpected paper source being used or an
op-panel message that may not make sense at first. See the manual to determine appropriate
responses.
The Optra Se printers support paper types Plain Paper (default), Bond, Transparency, Card Stock,
Labels, Letterhead, Preprinted, Colored Paper, Envelope (default for envelope feeder) and Custom
Type x, where x can be 1 through 6. This colon file does not attempt to set these values and will use
whatever the printer is set to for that input source. The user should insure that the proper paper type
is actually installed in the specified source.
169
Pitch
Duplex Mode
Collation
Separator Pages
Output Destination
Pitch selection is supported for the PCL 5 emulation by using the -p flag for pitch and the -s flag for
font name (or type face) with the qprt command. Pitch values between 1 and 100 characters per inch
(cpi) in whole integers are supported. The condensed print flag, -K, is not supported.
Font Name
Pitch
-s courier
-p (1 to 100)
-s courier-bold
-p (1 to 100)
-s courier-italic
-p (1 to 100)
-s courier-bolditalic
-p (1 to 100)
-s gothic
-p (1 to 100)
-s gothic-bold
-p (1 to 100)
-s gothic-italic
-p (1 to 100)
-s lineprinter
-p 17
Note: To format ASCII for other font styles, use the base operating system enscript utility or the -da
flag to a PostScript queue with the qprt command. Only a pitch of 17 is supported for the lineprinter
font style.
The qprt command line option -Y supports this.
0
simplex operation
1
duplex, long edge binding
2
duplex, short edge binding
Normally, the -N command line option is used to specify the number of copies desired. This method
will cause the specified number of copies of the entire print job to be submitted or queued to the
print system. Because the Optra Se supports collation internally, options were added to support it and
the number of copies of each page internally. This functionality is limited by the amount of memory
installed in your printer and the size of the job. The -W# option determines how many copies of each
page is desired, where # is the number of copies. The -S [!/+] option controls whether collation is
desired. The default is ! (or not). The main advantages of using the -W and -S options are to conserve
printer subsystem usage and allow the printer to handle multiple copies instead of sending # copies
to the printer. Using the -S! options with the -W# also allows # copies of each page in a row, if this is
desired. Note that using -N and -W simultaneously is allowed. This would result in -N print jobs with
-W copies of each page in each job.
The -E flag controls separator pages. The valid values are 0, 1, 2, and 3, which represent NONE,
BETWEENCOPIES, BETWEENJOBS, and BETWEENPAGES, respectively. The separator page source
defaults to TRAY 1 and is specified via the uS attribute. The valid values for uS are the same as for
header and trailer pages (uH and uT respectively), except that the Manual Feeder is not supported. To
change the default, the uS attribute must be changed in the virtual printer to one of the valid values
(see the chvirprt command).
The -= (equal sign) is the command line option for specifying the output destination. Valid values are:
0
standard bin
1
bin 1
2
bin 2
3
bin 3
50
active bin
The default value for the output destination is the standard bin (0). Note that if the active bin is
selected, the printer will select the bin based on the state of output bin capacity sensing and the
operator panel setting for Configure Bins under the PAPER MENU. See your printer manual to
determine exactly how the printer will respond.
170
Page Rotation
Paper Source
Paper Size
Paper Type
Page rotation selection is supported for the PCL 5e emulation by using the -z flag of the qprt
command.
-z 0
Portrait
-z 1
Landscape
Paper source selection is supported for both the enhanced PCL (R) 5e emulation and the PostScript
Level 2 emulation by using the -u flag of the qprt command. There are several optional input sources
(see your manual to determine which are installed). These numbers apply, no matter which ones are
present. If one is not present, choosing one of those will simply default as per the users manual. The
input source number is the same for both PCL and PostScript:
-u 0
manual feed
-u 1
tray 1
-u 2
tray 2
-u 3
tray 3
-u 4
tray 4
-u 5
tray 5
-u 6
envelope feeder
-u 7
multipurpose tray
By default, the banner and trailer pages come from tray 1. To change the default, change the values
for the uH and/or uT attributes, respectively, in the virtual printer to the value for the desired paper
source. The valid values are the same as for the -u flag. Do this with the chvirprt command.
Paper size selection is supported by using -O and -Q flags of the qprt command. The -O flag controls
paper versus envelope. A -O value of 3 indicates a paper size and 4 an envelope size. The values 1
and 2 were skipped for backward compatibility. Envelopes are only valid for manual feed, envelope
feeder, or the multipurpose tray. The default for -Q is 1 or Letter for paper sizes, and 3 or Com 10 for
envelope sizes. To change the defaults, change the s0 - s7 attributes respectively for each of the valid
input sources. Because manual feed and the multipurpose tray support both paper and envelopes, the
default for paper is the else part (%e1), and the default for envelopes is the then part (%t3) of s0 and
s7.
Paper Sizes (-0 3)
Envelope Sizes (-0 4)
-Q 1 Letter
7 3/4 Monarch
-Q 2 Legal
9 (Com 9)
-Q 3 B5 (JIS B5)
10 (Com 10)
-Q 4 A4 DL
-Q 5 Executive
C5
-Q 6 A5 B5 Envelope
-Q 7 Custom (Universal)
Other Envelope
Note: For PCL queues, if the selected size is not in the selected input source, a search sequence will
be used to find the size requested. If the size is found, that source will be used. For PostScript queues,
if the selected size is not in the selected input source, the printer will prompt the user to load the
source with the appropriate size. This may result in an unexpected paper source being used or an
operator panel message that may not make sense at first. See the manual to determine appropriate
responses.
The Optra T printers support paper types Plain Paper (default), Bond, Transparency, Card Stock,
Labels, Letterhead, Preprinted, Colored Paper, Envelope (default for envelope feeder) and Custom
Type x, where x can be 1 through 6. This colon file does not attempt to set these values and will use
whatever the printer is set to for that input source. The user should insure that the proper paper type
is actually installed in the specified source.
171
Pitch
Duplex Mode
Collation
Separator Pages
Output Destination
Pitch selection is supported for the PCL emulation by using the -p flag for pitch and the -s flag for
font name (or type face) with the qprt command. Pitch values between 1 and 100 characters per inch
(cpi) in whole integers are supported. The condensed print flag, -K, is not supported.
Font Name
Pitch
-s courier
-p (1 to 100)
-s courier-bold
-p (1 to 100)
-s courier-italic
-p (1 to 100)
-s courier-bolditalic
-p (1 to 100)
-s gothic
-p (1 to 100)
-s gothic-bold
-p (1 to 100)
-s gothic-italic
-p (1 to 100)
-s lineprinter
-p 17
Note: To format ASCII for other font styles, use the base operating system enscript utility or the -da
flag to a PostScript queue with the qprt command. Only a pitch of 17 is supported for the lineprinter
font style.
The qprt command line option -Y supports this.
0
simplex operation
1
duplex, long edge binding
2
duplex, short edge binding
Normally, the -N command line option is used to specify the number of copies desired. This method
will cause the specified number copies of the entire print job to be submitted or queued to the print
system. Because the Optra T supports collation internally, options were added to support it and the
number of copies of each page internally. This functionality is limited by the amount of memory
installed in your printer and the size of the job. The -W# option determines how many copies of each
page is desired, where # is the number of copies. The -S [!/+] option controls whether collation is
desired. The default is ! (or not). The main advantages of using the -W and -S options are to conserve
printer subsystem usage and allow the printer to handle multiple copies instead of sending # copies
to the printer. Using the -S! options with the -W# also allows # copies of each page in a row, if that is
desired. Note that using -N and -W simultaneously is allowed. This would result in -N print jobs with
-W copies of each page in each job.
The -E flag controls separator pages. The valid values are 0, 1, 2, and 3, which represent NONE,
BETWEENCOPIES, BETWEENJOBS, and BETWEENPAGES, respectively. The separator page source
defaults to TRAY 1 and is specified via the uS attribute. The valid values for uS are the same as for
header and trailer pages (uH and uT respectively), except that the Manual Feeder is not supported. To
change the default, the uS attribute must be changed in the virtual printer to one of the valid values
(see the chvirprt command.
The -= (equal sign) is the command line option for specifying the output destination. Valid values are:
0
standard bin
1
bin 1
2
bin 2
3
bin 3
4
bin 4
5
bin 5
6
bin 6
7
bin 7
8
bin 8
9
bin 9
10
bin 10
The default value for the output destination is the standard bin (0).
172
Page Rotation
Paper Source
Paper Size
Page rotation selection is supported for the PCL 5 emulation by using the -z flag of the qprt
command.
-z 0
Portrait
-z 1
Landscape
Paper source selection is supported for both the enhanced PCL (R) 5 emulation and the PostScript
Level 2 emulation by using the -u flag of the qprt command. There are several optional input sources
(see your manual to determine which are installed). These numbers apply, no matter which ones are
present. If one is not present, choosing one of those will simply default as per the users manual. The
input source number is the same for both PCL and PostScript:
-u 0
manual feed
-u 1
tray 1
-u 2
tray 2
-u 3
tray 3
-u 4
tray 4
By default, the banner and trailer pages come from the top tray. To change the default, change the
values for the uH and/or uT attributes, respectively, in the colon file to the value for the desired
paper source. The valid values are the same as for the -u flag. Do this by editing the virtual printer
colon file with the chvirprt command.
Paper size selection is supported by using the -Q flag of the qprt command. The first five paper sizes
are also numbered for backward compatibility. Whenever an invalid value for the input source is
selected, it will be ignored.
The default for -O is 3 or paper. The default for -Q is 1 or Letter for paper sizes and Monarch for
envelope sizes.
Paper Sizes
-Q 1
Letter
-Q 2
Legal
-Q 3
B5 Paper
-Q 4
A4
-Q 5
Executive
-Q 6
A5
-Q 7
B4
-Q 8
A3
-Q 9
Ledger (11x17)
-Q 10
Universal (11.69x17.69)
To change the defaults, change the s0 -s5 attributes respectively for each of the valid input valids. The
default paper size is the else part (%e1).
Note:
1. Manual Feed and Tray 1 support sizes -Q 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 (Letter, Legal, B4, A4, Executive,
A5, B4, A3, 11x17, Universal).
2. Trays 2, 3, and 4 support sizes -Q 1, 2, 4, 7, 8, 9 (Letter, Legal, A4, B4, A3, 11x17).
3. The printer (and this colon file) defaults paper size to letter for the US and A4 for Europe.
4. An invalid paper size value for the selected input source will cause an error to be reported.
5. If the selected size is not in the selected input source, either wrong size or empty, a search
sequence will be used to find the size requested. See the printer manual for assistance
173
Pitch
Duplex Mode
Pitch selection is supported for the PCL 5 emulation by using the -p flag for pitch and the -s flag for
font name (or type face) with the qprt command. Pitch values between 1 and 100 characters per inch
(cpi) in whole integers are supported. The condensed print flag, -K, is not supported.
Font Name
Pitch
-s courier
-p (1 to 100)
-s courier-bold
-p (1 to 100)
-s courier-italic
-p (1 to 100)
-s courier-bolditalic
-p (1 to 100)
-s gothic
-p (1 to 100)
-s gothic-bold
-p (1 to 100)
-s gothic-italic
-p (1 to 100)
-s lineprinter
-p 17
Note: To format ASCII for other font styles, use the base operating system enscript utility or the qprt
command with the -da, -s, and -p flags to a PostScript queue. For PostScript queues, -p stands for
point size and the valid list of fonts can be found in /usr/lib/ps/fontmap. Valid point sizes are any
integer from 1 to 1008. Only a pitch of 17 is supported for the lineprinter font style.
The optional duplex feature is supported by the -Y flag of the qprt command. The default value is 0
or simplex mode.
-Y 0
simplex
-Y 1
duplex, long edge binding
-Y 2
duplex, short edge binding
The optra W810 printer supports collation of multiple copies of a print job internally. This feature is
controlled by the -W and -S flags of the qprt command.
-S!
collation off
-S+
collation on
-W#
number of copies
Note:
1. This function is independent of the -N flag of the qprt command. The -N# flag will cause the print
job to be sent to the printer # times. The -W# flag will send the print job once, and # copies of the
job will be printed.
Separator Pages
Finisher Stapes
Finisher Offset
174
2. The function is limited by the amount of memory installed in the printer and the size of the print
job.
The printer supports internally generated separator pages. This feature is controlled by the -E flag of
the qprt command.
-E0
None
-E1
Between Copies
-E2
Between Jobs
-E3
Between Pages
The paper source defaults to Tray 1. To change the default, the uS attribute must be changed in the
virtual printer. The valid values for uS are:
uS 1
Tray 1
uS 2
Tray 2
uS 3
Tray 3
uS 4
Tray 4
Note: This function is independent of the -B flag of the qprt command.
The Optra W810 printer supports this option if it has an optional Finisher installed. The valid values
for y are:
-y 0
Off
-y 1
On
The Optra W810 printer supports this option if it has an optional Finisher installed. The valid values
for e are:
-e 0
Off
-e 1
On
Hole Punch
The Optra W810 printer supports this option if it has an optional Finisher installed. The valid values
for o are:
-o 0
Output Destination
Off
-o 1
On
The -= (equal sign) is the command line option for specifying the output destination. Valid values are:
0
standard bin
1
bin 1
2
bin 2
3
bin 3
4
bin 4
5
bin 5
6
bin 6
7
bin 7
8
bin 8
9
bin 9
10
bin 10
The default value for the output destination is the standard bin (0).
Paper source selection is supported by using the -u flag of the qprt command.
-u 1
tractor 1
-u 2
tractor 2
The banner and trailer pages use the same source as the print job. It is suggested that the
printer be attended when switching between tractors.
175
Pitch selection is supported by using the -p flag for the pitch, the -s flag for font name, and
-q flag of the qprt command for print quality. The default values supported include:
10
pitch
courier
font
quality
1 or draft
fast draft
-s
draft
-s
courier
-s
gothic
-s
-s
-s
-s
fast draft
draft
The valid pitch values are 10, 12, 17, 20, and 24 for 239x only.
Note:
1. Selection of draft or fast draft will override the selected font.
Page Width
2. Bold font is supported using the -e flag and emphasized print. Italic font is supported
using the -k flag and italic print.
The -w flag controls the width of the printable page in characters.
Plus Printer
Default
2380 and 2390
80
2381 and 2391
136
176
When HPGL print files are submitted to the HPGL print queue, the system downloads the HPGL
emulator to the printer and selects the emulator as needed.
PostScript files can also be submitted to the HPGL print queue. The files must begin with the
two-character string %! so the system can recognize them as PostScript instead of HPGL files.
where lpx is the printer device name, such as lp0. This tells the system that the HPGL emulator needs to
be downloaded to the printer again.
When you reboot the system, turn the printer off and on to reinitialize it.
177
v
v
v
v
v
178
lp command
1
print service
configuration
print service
(spooling daemon)
optional
slow filter
4a
(job
screening)
2
(printer
initialization)
terminfo
database
KEY:
standard
interface program
communication path
System V process
control
default filter
System V process
control (alternate)
optional
fast filter
4b
data access
System V process
disk files
laser printer
Figure 6. Overview of Print Request Processing
You can customize the print service by adjusting or replacing some of the items shown in the Overview
of Print Request Processing figure (the numbers in the following list correspond to the numbered items in
the diagram).
1. Print service configuration: For most printers, you need only change the printer configuration stored
on disk. See the lpadmin command for adding or modifying a local printer.
2. terminfo database: For printers that are not represented in the terminfo database, you can add a new
entry that describes the capabilities of the printer. See Adding a printer entry to the terminfo
database on page 188. The print service uses the terminfo database in two parallel capacities:
screening print requests to ensure that those accepted can be handled by the desired printer, and
setting the printer so it is ready to print the requests.
For example, if the terminfo database does not show a printer capable of setting a page length
requested by a user, the spooling daemon rejects the request. However, if it does show it to be
capable, then the interface program uses the same information to initialize the printer.
3. Standard Interface Program: If you have a particularly complicated printer or if you want to use
features not provided by the print service, you can change the interface script. This script is
responsible for managing the printer: it prints the banner page, initializes the printer, and invokes a
filter to send copies of the users files to the printer.
4. Optional filters: To provide a link between the applications used on your system and the printers, you
can add slow and fast filters. Each type of filter can convert a file into another form, for example,
mapping one set of escape sequences into another, and can provide a special setup by interpreting
print modes requested by a user. Slow filters are run separately by the spooling daemon to avoid
tying up a printer. Fast filters are run so their output goes directly to the printer; thus, they can exert
control over the printer.
Printers and Printing
179
ps-717, uid 1532, gid 18, size 7872, Tue May 10 14:43:10 1994
ps
1
ps
/usr/spool/lp/temp/717-1
20
simple
hanna
0x0010
Content of line
The separator line lists the (comma-separated) request ID, user ID (uid), and group ID (gid) of the user
who submitted the request, total number of bytes in the original (unfiltered) file (size), and the date
and time the request was queued.
Name of the file in the /usr/spool/lp/temp directory. This line is repeated for each file printed, and
files are printed in the order given.
How the print service notified the user after printing the file (if applicable):
v M by an electronic mail message
v W by a message written to the users terminal
Any -r options given to the lp command indicating that the user requested raw processing of the file.
180
Letter
Content of line
Outcome of the job, expressed as a combination of individual bits in hexadecimal form. The important
bits used internally by the spooler are:
v 0x0004 Slow filtering finished successfully.
v 0x0010 Printing finished successfully.
v 0x0040 Request was canceled.
v 0x0100 Request failed filtering or printing.
Slow filter.
List of special modes to give to the filters used to print the request.
Fast filter.
Printer used for the request. This differs from the destination (the D line) if the request was queued for
any printer or a class of printers, or if the printer administrator transferred the request to another
printer.
Description
cancel
lp
lpstat
The administrator can give users the ability to disable and enable a printer so that if a printer is
malfunctioning, the user can turn the printer off without having to call the administrator. (However, in
your printing environment, it might not be reasonable to allow regular users to disable a printer.)
The Administrative Print Service Commands Table lists print service commands available only to the
administrator. To use the administrative commands, you must be logged in as root user.
The administrative print service commands are located in the /usr/lib directory. If you use these
commands frequently, include /usr/lib in your PATH variable.
Administrative print service commands
Command
Description
accept reject
Permits jobs to be queued for a specified destination Prevents jobs from being queued for a specified
destination
cancel
enable disable
lpadmin
lpc
lpfilter
lpforms
lpmove
lpsched lpshut
lpsystem
181
Command
Description
lpusers
Sets or changes the default priority and priority limits that the users of the print service can request
The accept, reject, cancel, enable, disable, and lpadmin commands can also be run from the Web-based
System Manager interface. To run these commands, start Web-based System Manager (type wsm), and then
select the Printers plug-in from the Contents Area.
Note: The lpadmin command uses the printer type to determine whether the settings are possible for the
printer. Therefore, you must first set the printer type before you can specify these defaults.
For example, to specify a page width of 11 inches, a page length of 14 inches, character pitch to
compressed, and line pitch of 3 lines per inch for the printer barney, enter:
/usr/sbin/lpadmin -p barney -o width=11i
/usr/sbin/lpadmin -p barney -o length=14i
/usr/sbin/lpadmin -p barney -o cpi=compressed
/usr/sbin/lpadmin -p barney -o lpi=3
182
If you do not provide defaults, the page size and print spacing are set to those available when the printer
is initialized. You can determine what the defaults are by first defining the printer configuration without
providing your own defaults, then using the lpstat command to display the printer configuration. To
display the default page size and print spacing, enter:
lpstat -p printer_name -l
If you do not set the defaults, the lpstat command reports defaults from the terminfo database entry for
the printer.
Banner configuration
A banner is a page describing the print request (for example, printer name, user, date) that prints with
the print job.
A banner is a page describing the print request (for example, printer name, user, date) that prints with the
print job.
Use the following command to permit users to decide whether they want a banner printed:
/usr/sbin/lpadmin -o nobanner
The presence of this entry allows a print server to accept connections from systems that are not explicitly
configured as known systems.
Entries specifying the remote system name can still be added to the file using the lpsystem command.
Access to a printer can be controlled from the printers users.allow and users.deny files. See the
lpadmin command for more information.
Note: The wildcard entry is only used for incoming connection requests and not for outgoing requests.
If you do not want to separately control access to each printer on your system but you want the
/etc/lp/Systems file to specify which remote systems have access to your printers, remove the wildcard
entry from the file and add entries for the remote systems. To do this, perform the following:
v To remove the wildcard entry for BSD systems, use:
/usr/sbin/lpsystem -r "*"
183
format is as follows:
key1:
attr1=val1
attr2=val2
key2:
...
The file includes a text description of each supported make and model, pointers to a printer interface
script, and a terminfo entry. It can also contain additional information such as required serial line settings
or supported content types.
The following attributes are available:
contents
interface
name
terminfo
stty
A quoted, comma-separated list of the content types supported for a printer, usually just PS (for
postscript), pcl (for Hewlett-Packards Printer Control Language), or simple (for most other printers).
Additional content types can be supported by creating Print Filters. See Print filters on page 192.
This attribute is optional.
The Printer Interface Script should be set to standard in most cases. SeePrinter interface scripts. This
attribute is mandatory.
A text description of a printer make/model. This attribute is mandatory.
Is the name of the terminfo entry associated with this printer. See terminfo database on page 28.
This attribute is optional.
Any serial or parallel line settings appropriate for the printer. This attribute is optional.
In addition, each printer must have a unique key name associated with it, as shown in these examples:
canon-jet-10ex:
name="Canon Bubble Jet 10ex"
terminfo=bj-10ex
interface=standard
hp-laserjet:
name="HP LaserJet (PCL)"
terminfo=hplaserjet
interface=standard
contents=pcl
stty="clocal -onlcr"
184
v Initialize the physical printer (restore the printer to a normal state in case a previously printed file has
left it in an unusual state), setting the character pitch, line pitch, page size, and character set requested
by the user. The standard interface script uses the lp.set command to initialize the printer. See the lp.set
command for more information.
v Print banner page (or pages), if required.
v Print the requested files. The standard interface script calls the lp.cat command to print the files. See the
lp.cat command for more information.
v Report any errors to the print service. The standard interface script uses the lp.tell command to send
descriptions of printer faults to the print service. The print service forwards that information as an alert
to the print administrator. See the lp.tell command for more information.
The print service opens the printer port. The print service gives the printer port connection to the
interface script as standard output and sets the printer to be the controlling terminal for the interface
script. If the port experiences a hangup, a SIGHUP signal is sent to the interface script.
Many of the interface scripts provide special options that the user can specify by using the -o option with
the lp command. See the lp command for more information.
The print service runs the interface script to send the print job to the printer, as shown in the following
example:
/etc/lp/interfaces/printer id user title copies options file1 file2 ...
file
The name of the interface script (the same as the printer name).
Request ID returned by the lp command.
Login name of user who made the request.
Optional title specified by the user.
Number of copies requested by the user.
List of blank-separated options, specified by the user (using lp -o) or by the print service (from
default values specified by the administrator with the lpadmin command). See the lp command for
the list of options recognized by the standard interface.
Full path name of a file to be printed.
Specifies the printer type. The value is used as a key for obtaining printer capability
information from the extended terminfo database.
Specifies the filter to use to send the request content to the printer; the filter is given
control of the printer.
Specifies the character set to use when printing the content of a print request. The
standard interface script extracts the control sequences needed to select the character set
from the terminfo database.
185
2. Make sure that the custom interface script sets the proper stty modes (terminal characteristics such as
baud rate or output options). Look for the section that begins with this line:
## Initialize the printer port
3. Modify the code in the standard interface script. It sets both the default modes and the adjusted
modes given by the print service or the user with a line similar to the following:
stty mode options 0<&1
This command line takes the standard input for the stty command from the printer port. For example,
the following stty command example sets the baud rate to 1200bps and sets some of the option
modes:
stty -parenb -parodd 1200 cs8 cread clocal ixon 0<&1
4. Set the hardware-flow control printer-port characteristic. The standard interface script does not set
hardware flow control; it is set according to your computer hardware. The code for the standard
interface script suggests where to set this and other printer port characteristics. Look for the section
that begins with this line:
# Here you may want to add other port initialization code.
5. Because different printers have different numbers of columns, make sure the header and trailer for
your interface script correspond to your printer. The standard interface script prints a banner that fits
on an 80-column page (except for the users title, which may be longer). Look for the section in the
code for the standard interface script that begins with this line:
## Print the banner page
6. Some applications, when run with certain printers, may require that you turn off page breaking. If
you must turn off page breaking, you can modify the standard interface program
(/usr/lib/lp/model/standard) at this line:
if [ -n "${FF}" -a "no" = "${nofilebreak}" ]
186
With the special exit code 129 or lp.tell, the interface script need not disable the printer itself. Your
interface script can disable the printer directly, but doing so overrides the fault-alerting mechanism. Alerts
are sent only if the print service detects that the printer has faulted, and the special exit code and lp.tell
program are its main detection tools.
If the print service must interrupt the printing of a file at any time, it kills the interface script with a
signal 15 (see the signal command and the kill command for more information).
If the interface script stops upon from receipt of any other signal, the print service assumes that future
print jobs are not affected and continues to use the printer. The print service notifies the person who
submitted the print job that the job did not finish successfully.
The signals SIGHUP, SIGINT, SIGQUI, and SIGPIP (trap numbers 1, 2, 3, and 13) are ignored when the
interface is invoked. The standard interface script changes this to trap these signals at appropriate times,
interprets these signals to mean that the printer has a problem, and issues a fault.
Description
1 to 127
The print service encountered a problem in printing the job (for example, there were too many
nonprintable characters or the job exceeded the printers capabilities). This problem does not affect
future print jobs. The print service should notify the person who submitted the print job, either via
write or mail - that an error occurred in printing the job. If a printer fault occurred, it was cleared.
128
Reserved for internal use by the print service. Interface scripts must not exit with this code.
129
The print service encountered a printer fault in printing the job. This problem affects future print jobs.
If the fault recovery for the printer directs the print service to wait for the administrator to fix the
problem, the print service should disable the printer. If the fault recovery is to continue printing, the
print service should not disable the printer, but try printing again in a few minutes.
> 129
Reserved for internal use by the print service. Interface scripts must not exit with codes in this range.
187
terminfo database
The print service relies on the standard interface script and the terminfo database to initialize each
printer and set up a selected page size, character pitch, line pitch, and character set.
Thus, it is usually sufficient to have the correct entry in the terminfo database (/usr/lib/terminfo/
terminfo.lp) to add a new printer to the print service.
The terminfo database identifies each printer by a short name, identical to the kind of name used to set
the TERM shell variable. For example, the name in the terminfo database for the AT&T model 455
printer is 455.
To specify the terminfo type for your printer, use the -T option of the lpadmin command. By default, the
terminfo database includes entries for many popular printers. Select the terminfo type that corresponds
to your printer.
If terminfo does not include an entry for your printer, you might still be able to use the printer with the
print service. However, you will not be able to use automatic selection of page size, pitch, and character
sets, and you might have trouble keeping the printer set to the correct modes for each print request or
using printer forms with the printer. In this case, you can either add an entry to terminfo (Adding a
printer entry to the terminfo database) for your printer or create a customized interface program
(Creating printer interface scripts on page 185) to use with the printer.
You can define hundreds of items for each terminal or printer in the terminfo database. However, the
print service uses fewer than 50 of these, and most printers need even less than that. You can check items
defined for a specific terminfo entry by entering the following command:
infocmp terminfo_name
After adding or deleting terminfo entries or changing values that govern pitch settings, page width and
length, or character sets, stop and restart the print service.
188
terminfo entry
Booleans:
daisy
Numbers:
bufsz
* cols
* it
* lines
orc
orhi
orl
orvi
cps
Strings:
* cr
cpi
lpi
chr
cvr
csnm
mgc
* hpa
* cud1
* cuf1
swidm
rwidm
* ff
* is1
* is2
* is3
* if
* iprog
* cud
* cuf
* rep
* vpa
scs
smgb
smgbp
* smgl
smglp
* smgr
smgrp
smgt
smgtp
scsd
* ht
Description
Printer needs operator to change character set
Number of bytes buffered before printing
Number of columns in a line
Tabs initially every # spaces
Number of lines on a page
Horizontal resolution in units per character
Horizontal resolution in units per inch
Vertical resolution in units per line
Vertical resolution in units per inch
Average print rate in characters per second
Carriage return
Change number of characters per inch
Change number of lines per inch
Change horizontal resolution
Change vertical resolution
List of character set names
Clear all margins (top, bottom, and sides)
Horizontal position absolute
Down one line
Carriage right
Enable double-wide printing
Disable double-wide printing
Page eject
Printer initialization string
Printer initialization string
Printer initialization string
Name of initialization file
Path name of initializing program
Move carriage down # lines
Move carriage right # columns
Repeat a character # times
Absolute vertical position
Select character set
Set bottom margin at current line
Set bottom margin
Set left margin at current column
Set left margin
Set right margin at current column
Set right margin
Set top margin at current line
Set top margin
Start definition of a character set
Tab to next 8-space tab stop
The items marked with an asterisk (*) are available on your system. The remainder of the definitions can
be added.
Printer forms
The print service includes facilities to create and administer forms.
A preprinted printer form is a blank paper form that you load into your printer. An application typically
generates a file that, when printed on the blank form, fills out the form.
189
The print service uses the alignment pattern to line up the forms before printing begins and prompts you
to perform an alignment before printing.
Depending on your printer, specify page length in lines, inches (i), or centimeters (c). Specify page width
in columns, inches (i), or centimeters (c). In the example above, page length is specified as 66 lines. If the
printer recognizes inches, specify the page length as 11i.
Removing a form
The print service imposes no fixed limit on the number of forms you may define.
It is a good idea to remove forms that are no longer appropriate. If you do not, users must examine a
long list of obsolete forms when choosing a form. In addition, because the print service must occasionally
look through all the forms listed before performing certain tasks, the failure to remove obsolete forms
may require unnecessary processing by the print service.
To remove a form, enter the following command:
/usr/sbin/lpforms -f form-name -x
190
The method used to allow or deny users access to a form is similar to the method used to allow or deny
users access to the cron and at facilities. See the at, cron, and crontab commands for more information.
If users on your system can access forms on a remote printer, all users included on the allow list for the
local system must be included on the allow list for the remote system as well.
If, on the other hand, a local user is to be denied permission to use forms on a remote printer, it is not
necessary for the deny lists in both the local and remote print services to include that user. By being
included in only one of these deny lists, a user can be denied access to remote forms. As a courtesy to
your users, however, make sure that any local users who are included in a deny list on a remote system
are included in the corresponding deny list on your local system. This ensures that whenever a user on
your system requests a form without authorization, the user is immediately informed that permission to
use the form is being denied. If the local print service does not know that a user is denied permission to
use a particular remote form, there will be a delay before the user receives a permission denied message
from the remote system.
To add names to the deny list and remove them from the allow list, run the following:
The user-list is a comma- or space-separated list of names of users. If you use spaces to separate the
names, enclose the entire list (including the allow: or deny: but not the -u) in quotes. Each item in the list
can include a system name.
Specifying allow:all allows all users. Specifying deny:all denies all users.
If you do not add user names to the allow or deny lists, the print service assumes that all users may use
the form.
Mounting a form
Before the print service starts printing files that need a preprinted form, you must mount the form on a
printer.
If alerting has been set on a form, you will be alerted when enough print requests are queued waiting for
the form to be mounted (see Mount forms and font cartridge alerts on page 214 for information on
alerting). Mounting a form involves loading it onto the printer and then informing the print service that
it is mounted. It is sound practice to disable the printer first.
Until you have mounted a form on a printer, only print requests that do not require the form will be sent
to the printer.
Use the following procedure to inform the print service that the form is mounted:
1. Disable the printer.
2. Load the new form onto the printer.
3. Run the following command to mount a form:
/usr/sbin/lpadmin -p printer-name -M -f form-name -a -o filebreak
191
If an alignment pattern has been registered with the form, you can ask that this be repeatedly printed
after you have mounted the form, until you have adjusted the printer so that the alignment pattern looks
correct.
The -o filebreak option tells the print service to add a form feed after each copy of the alignment pattern,
if there is one. You must press the return key before each copy of the alignment pattern is printed.
The actual control sequence used for the form feed depends on the printer involved and is obtained from
the terminfo database. If the alignment pattern already includes a form feed, omit the -o filebreak
option.
Examining a form
After you have defined a form to the print service, you can examine it with one of two commands,
depending on the type of information you want to check.
The lpforms command displays the attributes of the form. (The display produced by the lpforms
command can be used as input. You may want to save it in a file for future reference.) The lpstat
command displays the current status of the form.
Note: A form definition that is captured in a file can be used later to redefine the form if you
inadvertently remove the form from the print service.
To display the status of a form, run the following:
lpstat -f form-name -l
To protect potentially sensitive content, the alignment pattern is not shown if the lpstat command is used.
Print filters
A default filter is provided with the print service to provide simple printer fault detection. It does not
convert files or handle any of the special modes. It may, however, be adequate for your needs.
A filter is a program that you can use for the following purposes:
v To convert a user file from one data format to another so that it can be printed correctly on a given
printer
v To handle the special modes of printing that users may request with the -y option to the lp command
(such as two-sided printing, landscape printing, draft or letter-quality printing)
v To detect printer faults and notify the print service of them, so that the print service can alert you
192
Not every filter can perform all three tasks. Given the printer-specific nature of these roles, the print
service has been designed so that these roles can be implemented separately. This separation allows you
or a printer manufacturer (or another source) to provide filters without having to change the print
service.
Note: Adding, changing, or removing filters can cause print requests that are still queued to be
canceled. This is because the print service evaluates all print requests still queued to see which are
affected by the filter change. Requests that are no longer printable, because a filter has been
removed or changed, are canceled (with notifications sent to the users who submitted them). There
can also be delays in the responses to new or changed print requests when filters are changed, due
to the many characteristics that must be evaluated for each print request still queued. These delays
can become noticeable if there is a large number of requests that need to be filtered.
Because of this possible impact, make alterations to filters during periods when the print service is
idle.
File conversion
For each printer (local or remote), you can specify what file content types it can print.
When a user submits a file to print on any printer and specifies its content type, the print service finds a
printer that can handle files of that content type. Because many applications can generate files for various
printers, this is often sufficient. However, some applications generate files that cannot be printed on your
printers.
By defining and creating a filter that converts such files into a type that your printers can handle, you
can support more applications in the print service. (The print service provides a few filters for converting
various types of files into PostScript.) For each filter you add to the system, you must specify one or
more types of input it can accept and the type of output it can produce (usually only one).
When a user specifies (by executing lp -T) a file content type that no printer can handle, the print service
tries to find a filter that can convert the file into an acceptable type. If the file to be printed is passed
through a filter, the print service then matches the output type of that filter with a printer type or the
input type of another filter. The print service continues to match output types to input types in this way,
thus passing a file through a series of filters, until the file reaches a printer that accepts it.
Example: HP DeskJet 500
In this example, the user Chris has run a spreadsheet program and has generated a file containing a copy
of a spreadsheet. Chris now wants to print this file using the print service. You have only HP DeskJet 500
printers on your system. Fortunately, the spreadsheet application understands how to generate output for
several printers, and Chris knows it is necessary to request output that can be handled by the HP DeskJet
500. When Chris submits the file for printing, the print service queues it for one of the printers; no filter
is needed.
Example: Tektronix 4014 Output
In this example, the user Marty created a graphic image that can be displayed on a Tektronix 4014
terminal. Marty now wants to print this image, but all of the printers are PostScript printers. Fortunately,
your system provides a filter called posttek that converts Tektronix type files to PostScript. Because you
set the printer type to PostScript, the print service recognizes that it can use the posttek filter to convert
Martys output before printing it.
193
Each filter you add to the filter table can be registered to handle special modes and other aspects of
printing, such as:
v Special modes
v Printer type
v Character pitch
v Line pitch
v Page length
v Page width
v
v
v
v
Pages to print
Character set
Form name
Number of copies
A filter is required to handle the special modes and printing of specific pages; the print service provides a
default handling for the rest. However, it may be more efficient to have a filter handle some of the rest,
or it is possible that a filter has to know several of these aspects to fulfill its other roles properly. A filter
may need to know, for example, the page size and the print spacing if it is going to break up the pages in
a file to fit on printed pages. As another example, some printers can handle multiple copies more
efficiently than the print service, so a filter that can control the printer can use the information about the
number of copies to skip the print service default handling of multiple copies.
194
to other files, known as include files. The print service does not recognize include files; it will not enqueue
any that are referenced by a source file when that file is in a queue to be printed. As a result, the troff or
nroff program, being unable to access the include files, may fail. Other programs may have similar
features that limit their use as filters.
Here are a few guidelines for evaluating a program for use as a filter:
v Only programs capable of reading data from standard input and writing data to standard output may
be used as filters.
v Examine the kinds of files users will submit for printing that will require processing by the program. A
good program is one that stands alone (that is, it does not need to refer to other files).
Determine if the program expects any files other than those submitted by a user for printing. If it does,
those files must be in the directory of the person using the filter, or they must be readable by all users
authorized to use the filter. The latter prerequisite is necessary because filters are run with the user ID
and group ID of the user who submitted the print request.
v If referenced files are permitted in the files submitted for printing, or if the program will need files
other than those submitted by a user, then the program, unable to access the additional files, is likely
to fail. Rather than using the program under consideration as a filter; instead, have users run the
program before submitting files for printing.
Referenced files that are always specified by full pathnames may be acceptable, but only if the filter is
used for local print requests. When used on requests submitted from a remote machine for printing on
your machine, the filter may still fail if the referenced files exist only on the remote machine.
See Adding a filter to the print service on page 200 for more information.
Filter definitions, which can be stored in a file or entered directly on the command line, have the
following format:
Command: command-pathname [options]
Input types: input-type-list
Output types: output-type-list
Printer types: printer-type-list
Printers: printer-list
Filter type: fast or slow
Options: template-list
The information can appear in any order. Not all of the information must be provided. When you do not
specify values for the items listed below, default values are assigned.
195
lpfilter Arguments
Command:
Input types:
Output types:
Printer types:
Printers:
Filter type:
Options:
Default
(no default)
any
any
any
any
slow
(no default)
Default values define a flexible filter, so at minimum you must supply the input and output type(s).
When you enter a list, you can separate the items in it with blanks or commas, unless it is a template-list.
Items in a template-list must be separated by commas.
Each of these characteristics is described as follows:
v Command: The full path of the filter program.
If there are any fixed options that the program always needs, include them here.
v Input types: The list of file content types that the filter can process.
The print service does not impose a limit on the number of input types that can be accepted by a filter,
but most filters can take only one. Several file types may be similar enough so that the filter can
handle them. You can use any name having a maximum of 14 alphanumeric characters and dashes (not
underscores). Because the print service uses these names to match a filter with a file type, follow a
consistent naming convention. For example, if more than one filter can accept the same input type, use
the same name for that input type when you specify it for each filter. Advise your users of the names
so they know how to identify the type of a file when submitting that file for printing.
v Output types: The list of file types that the filter can produce as output.
For each input type, the filter produces a single output type. The output type may vary, however, from
job to job. The names of the output types are restricted to 14 alphanumeric characters and dashes.
These names should either match the types of printers you have on your system or match the input
types handled by other filters. The print service groups filters together in a shell pipeline if it finds that
several passes by different filters are needed to convert a file. Try to find a set of filters that take (as
input types) all the different files your users may want printed and converts those files directly into
types your printers can handle.
v Printer types: A list of printer types into which the filter can convert files.
For most filters, this list is identical to the list of output types.
For example, you may have a printer that is given a single type for purposes of initialization (see
Printer types on page 201), but which can recognize several different types of files. In essence, this
printer has an internal filter that converts the various types into one that it can handle. Thus, a filter
may produce one of several output types that match the file types that the printer can handle. Label the
filter as working with that printer type.
As another example, you may have two different models of printers that are listed as accepting the
same types of files. However, due to slight differences in manufacture, one printer deviates in the
results it produces. You label the printers as being of different printer types, say A and B, where B is
the one that deviates. You create a filter that adjusts files to account for the deviation produced by
printers of type B. Because this filter is needed only for those printer types, you list it as working only
on type B printers.
For most printers and filters, you can leave this part of the filter definition blank.
v Printers: You may have some printers that, although they are of the correct type for a filter, are in
other ways not adequate for the output that the filter produces.
For example, you may want to dedicate one printer for fast turnaround. Only files that the printer can
handle without filtering will be sent to that printer. Other printers, of identical type, you allow to be
used for files that may need extensive filtering before they can be printed. In this case, label the filter
as working with only the latter group of printers.
196
In most cases, a filter works with all printers that accept its output, so you can usually skip this part of
the filter definition.
v Filter type: The print service recognizes fast filters and slow filters.
Fast filters are labeled fast because they incur little overhead in preparing a file for printing and
because they must have access to the printer when they run. A filter that is to detect printer faults
must be a fast filter. A filter that uses the PRINTER keyword as a filter option must be installed as a
fast filter.
Slow filters are filters that incur a lot of overhead in preparing a file and do not require access to a
printer. The print service runs slow filters in the background, without tying up a printer. This allows
files that do not need slow filtering to move ahead. Printers will not be left idle while a slow filter
works on a file if other files can be printed simultaneously.
Slow filters that are invoked by modes (using the -y option), must be run on the computer where the
print request was issued. The print service cannot pass values for modes to server machines. It can,
however, match a file content type (specified after the -T option of the lp command) to a content type
on a server machine. Therefore, to activate special modes on a server machine, you must specify
content types that will allow the print service to match input types and output types.
v Options: Options specify how different types of information is transformed into command line
arguments to the filter command.
This information may include specifications from a user (with the print request), the printer definition,
and the specifications implemented by any filters used to process the request.
There are 13 sources of information, each of which is represented by a keyword. Each option is defined
in a template, which is a statement in the following format:
keyword pattern=replacement
This type of statement is interpreted by the print service to mean: When the information referred to
by keyword has the value matched by pattern, take the replacement string, replace any asterisks it
contains with the pattern specified or expand any regular expressions it contains, and append the result
to the command line.
The options specified in a filter definition may include none, all, or any subset of these 13 keywords. In
addition, a single keyword may be defined more than once, if multiple definitions are required for a
complete filter definition. See Option definition with templates.
When you have gathered enough information to define the characteristics of your filter, you are ready to
run the lpfilter command, using your data as arguments. Because there are so many arguments and
because some of them may need to be entered more than once (with different values), record this
information first in a separate file and edit it, if necessary. You can then use the file as input to the
lpfilter command and avoid entering each piece of information separately.
Option definition with templates:
A template is a statement in a filter definition that defines an option to be passed to the filter command
based on the value of one of the characteristics of the filter.
A filter definition may include more than one template. Multiple templates may be entered on a single
line and separated with commas, or they may be entered on separate lines, preceded by the Options:
prefix.
The format of a template is as follows:
keyword pattern=replacement
This type of statement is interpreted by the print service to mean: When the information referred to by
keyword has the value matched by pattern, take the replacement string, replace any asterisks it contains
with the pattern specified or expand any regular expressions it contains, and append the result to the
command line.
Printers and Printing
197
As an example, suppose you want to have the print service scheduler assign print requests to filters on
the basis of the following criteria:
v If the type of OUTPUT to be produced by the filter is impress, then pass the -I option to the filter.
v If the type of OUTPUT to be produced by the filter is postscript, then pass the -P option to the filter.
To specify these criteria, provide the following templates as options to the lpfilter command:
Options: OUTPUT impress=-I, OUTPUT postscript=-P
If the Options: line becomes too long, put each template on a separate line, as follows:
"Options: OUTPUT impress=-I"
"Options: OUTPUT postscript=-P"
In both templates, the keyword is OUTPUT. In the first template, the value of pattern is impress and the
value of the replacement is -I. In the second template, the value of pattern is postscript and the value of
replacement is -P.
Keyword definitions and examples:
You can use keywords to define options in a filter definition.
The following keywords are available for defining options in a filter definition:
Characteristic
keyword
Possible patterns
Example
INPUT
content-type
troff
OUTPUT
content-type
postscript
Printer type
TERM
printer-type
att495
Printer name
PRINTER
printer-name
lp1
Character pitch
CPI
scaled-decimal
10
Line pitch
LPI
scaled-decimal
Page length
LENGTH
scaled-decimal
66
Page width
WIDTH
scaled-decimal
80
Pages to print
PAGES
page-list
1-5,13-20
Character set
CHARSET
character-set
finnish
Form name
FORM
form-name
invoice2
Number of copies
COPIES
integer
Special modes
MODES
mode
landscape
To find out which values to supply for each type of template (that is, for the pattern and replacement
arguments for each keyword), consider the following:
v The values for the INPUT and OUTPUT templates come from the file type that needs to be converted
by the filter and the output type that has to be produced by the filter, respectively. They will each be a
type registered with the filter.
v The value for the TERM template is the printer type.
v The value for the PRINTER template is the name of the printer that will print the final output.
v The values for the CPI, LPI, LENGTH, and WIDTH templates come from the user request, the form
being used, or the default values for the printer.
v The value for the PAGES template is a list of pages to be printed. Typically, it is a comma-separated list
of page ranges, each of which consists of a dash-separated pair of numbers or a single number (such as
1-6,8,10 for pages 1 through 6, 8, and 10). However, whatever value was given in the -P option to a
print request is passed unchanged.
v The value for the CHARSET template is the name of the character set to be used.
198
v The value for the FORM template is the name of the form requested by the -f option of the lp
command.
v The value of the COPIES template determines the number of copies made of the file. If the filter uses
this template, the print service will reduce to 1 the number of copies of the filtered file it will have
printed, because this single copy will really be the multiple copies produced by the filter.
v The value of the MODES template comes from the -y option of the lp command (the command used to
submit a print request). Because a user can specify several -y options, there may be several values for
the MODES template. The values will be applied in the left-to-right order given by the user.
The replacement part of a template shows how the value of a template is given to the filter program. It is
typically a literal option, sometimes with the place-holder * (asterisk) included to show where the value
goes. The pattern and replacement can also use the regular expression syntax of the ed command for more
complex conversion of user input options into filter options. All of the regular expression syntax of the ed
command is supported, including the \( . . . \) and \n constructions, which can be used to extract
portions of the pattern for copying into the replacement, and the &, which can be used to copy the entire
pattern into the replacement.
Note: If a comma or an equal sign (=) is included in a pattern or a replacement, escape its special meaning
by preceding it with a backslash (\). Note that some regular expressions include commas that will have
to be escaped this way. A backslash in front of any of these characters is removed when the pattern or
replacement is used.
col filter example:
An example using col filter to modify a users print requests is provided.
Suppose you already added a filter called col with the following definition:
Input types:
Output types:
Command:
Options:
Options:
Note: If you provide more than one definition (that is, more than one line) for any filter characteristic
other than Options, only the last definition will be used by the print service.
After you have registered this definition with the print service by entering it as input with the lpfilter
command, users print requests will be handled as follows:
v If a user enters the command
lp -y expand report.dec10
199
The filter program /usr/lib/lp/postscript/dpost takes one input type, troff, produces an output type
called postscript and works with any printer of type PS (for PostScript).
You have decided that your users need to provide just the abbreviations port and land when they ask for
the paper orientation to be portrait mode and landscape mode, respectively. Because these options are not
intrinsic to the print service, users must specify them using the -y option to the lp command.
The filter definition would look like this:
Input types: troff
Output types: postscript
Printer types: PS
Filter type: slow
Command: /usr/lib/lp/postscript/dpost
Options: LENGTH * = -l*
Options: MODES portrait = -op, MODES land = -ol
A user submitting a file of type troff for printing on a PostScript printer (type PS), with requests for
landscape orientation and a page length of 60 lines, would enter the following command:
lp -T troff -o length=60 -y land -d any
This filter would be invoked by the print service to convert the file as follows:
/usr/lib/lp/postscript/dpost -l60 -ol -pl
So if a user gives the command lp -y group=4, the dpost command would include the option -n4.
For additional examples, run the following command:
/usr/sbin/lpfilter -f filter -l
where filter is the name of the factory-installed PostScript filters. (For a list of PostScript filters, see
PostScript printers on page 203.)
The first command gets the filter definition from a file, and the second command gets the filter definition
from the standard input. A filter-name can be any string you choose, with a maximum of 14 alphanumeric
characters and underscores.
If you need to change a filter, reenter one of the same commands. You need provide information only for
those items that must be changed. Items for which you do not specify new information remain the same.
Removing a filter
The print service imposes no fixed limit on the number of filters you can define.
200
Remove filters that are no longer applicable to avoid extra processing by the print service, which must
examine all filters to find one that works in a given situation.
To remove a filter, run the following command:
/usr/sbin/lpfilter -f filter-name -x
Examining a filter
After you have added a filter definition to the print service, you can examine it by running the lpfilter
command.
The output of the lpfilter command is the filter definition displayed in a format that makes it suitable as
input. You may want to save this output in a file that you can use later to redefine the filter if you
inadvertently remove the filter from the print service.
To present the definition of the filter on your screen, enter the following command:
/usr/sbin/lpfilter -f filter-name -l
To capture the definition of the filter in a file for future reference, enter the following command:
/usr/sbin/lpfilter -f filter-name -l > filename
Replace filter-name with the name of the filter to restore or the word all to restore all the default filters.
Printer types
The printer-type attribute is defined with the -T printer-type option of the lpadmin command.
A printer type is the generic name for a printer. Typically it is derived from the manufacturer name. For
example, the ACME\ Computer 356 Dot Matrix Printer might have the type 356. Assigning a type for
each printer is important because the print software extracts information about printers from the
terminfo database on the basis of type. This information includes a list of the printer capabilities that
checks the configuration information you supply to the print service. (By checking the information you
provide against the known capabilities of the type of printer you are configuring, the print service can
catch inappropriate information you may have supplied.) The terminfo database also specifies the control
data needed to initialize a particular printer before printing a file.
While you are not required to specify a printer type, it is good practice to do so. You enhance your
systems ability to serve your users by classifying, on the basis of type, the printers available through the
print service.
If you give a list of printer types, separate the names with commas. If you do not define a printer type,
the default unknown is used.
You can assign several types to a printer if your printer is capable of emulating more than one kind of
printer. For example, if your printer can emulate an IBM Proprinter XL, an Epson FX86e, and an HP
LaserJet II, the terminfo database names these types 593ibm, 593eps, and 593hp, respectively. If you
specify more than one printer type, the print service uses one of them, as appropriate, for each print
request.
201
The following example shows how to use the lpadmin command to associate the type 593ibm with the
printer named laser.
/usr/sbin/lpadmin -p laser -T 593ibm
Note: If you specify more than one printer type, you must specify simple as the content type.
Content types
Most printers can print files of the same type as the printer type and of the simple type (ASCII files).
The content-type attribute is defined with the -I content-type-list option of the lpadmin command. Most
printers can print files of two types: the same type as the printer type (if the printer type is defined) and
the type simple (meaning an ASCII file), which is the default content type for all printers.
Files of content type simple are assumed to contain only two types of characters, printable ASCII
characters and the following control characters:
backspace
tab
linefeed
form feed
carriage return
Moves the carriage back one space, except at the beginning of a line
Moves the carriage to the next tab stop; by default, stops are spaced every 8 columns on most
printers
Moves the carriage to the beginning of the next line (may require special port settings for some
printerssee Printer port characteristics on page 215)
Moves the carriage to the beginning of the next page
Moves the carriage to the beginning of the same line (may fail on some printers)
The word carriage may be archaic for modern laser printers, but these printers perform actions similar to
those done by a carriage. If a printer can handle several types of files, including simple, you must
include simple explicitly in the content type list. If you do not want a printer to accept files of type
simple, specify a blank content-type-list (-I ) on the lpadmin command line. Some printers, though, can
accept (and print correctly) several different types of files. When adding this kind of printer, specify the
names of the content types that the new printer accepts by adding these names to the list. (By default, the
list contains only one type: simple.) If you are adding a remote printer, list the content types that have
been established for it by the administrator of the system on which it resides.
The content-type-list is a list of names separated by commas or spaces. If you use spaces to separate the
names, enclose the entire list (except for the -I) in quotes.
Common content types:
Content types appear similar to printer type names, but you can choose names that are meaningful to
people using the printer.
Content type names must contain no more than 14 characters and may include only letters, digits, and
underscores. The following table lists and describes some accepted content types.
Note: The names simple and any are recognized as having particular meanings by the print service; be
sure to use them consistently. The name terminfo is also reserved, as a reference to all types of printers.
Commonly used content types
202
Types
cif
daisy
dmd
fortran
otroff
pcl
plot
postscript
raster
simple
tek4014
tex
troff
Description
Output of BSD cifpbt
Print files intended for a Diablo 630 (daisy-wheel) printer
Print the contents of a bit-mapped display from a terminal
ASA carriage control format
CAT typesetter instructions generated by BSD or pre-System V troff (old troff)
HP LaserJet native output format
Plotting instructions for Tektronix displays and devices
PostScript language
Raster bitmap format for Varian raster devices
ASCII file
Print files formatted for a Tektronix 4014 device
DVI format files
Device-independent output from troff
When a file is submitted to the print service for printing with the printer specified by the -d any option
of the lp command, the print service searches for a printer capable of handling the job. The print service
can identify an appropriate printer through either the content type name or the printer type name.
Therefore, you may specify either name (or no name) when submitting a file for printing. If the same
content type is printable by several different types of printers, use the same content type names when
you add those printers. This makes it easier for the people using the printers because they can use the
same name to identify the type of file they want printed, regardless of the printing destination.
Most manufacturers produce printers that accept simple ASCII files. While these printers are different
types (and thus have different initialization control sequences), they may all be capable of handling the
same type of file, which we call simple. Several manufacturers may produce printers that accept ANSI
X3.64 defined escape sequences. However, the printers may not support all the ANSI capabilities; they
may support different sets of capabilities. You may want to differentiate them by assigning different
content type names for these printers.
Default content type:
While it may be desirable to list content types for each printer, it is not always necessary.
If you do not list the content types for a printer, the printer type is used as the name of the content type
the printer can handle. If you have not specified a printer type, the print service assumes the printer can
print only files of content type simple. This may be sufficient if you require users to specify the correct
printer explicitly and if files are correctly prepared for the printer before being submitted for printing.
PostScript printers
PostScript is a general-purpose programming language that allows you to specify the appearance of both
text and graphics on a page.
A PostScript printer is equipped with a computer that runs an interpreter for processing PostScript
language files. When a PostScript printer receives a file, it runs that file through the interpreter and then
prints it. Unless special provisions have been made by the manufacturer, files submitted to a PostScript
printer must be written in the PostScript language.
In addition to providing excellent facilities for managing text and graphics and combining them, most
major applications that support printed output support PostScript. Graphics operators facilitate the
construction of geometric figures that can then be positioned and scaled with any orientation. The text
capabilities allow you to specify a number of different fonts that can be placed on a page in any position,
size, or orientation. Because text is treated as graphics, text and graphics are readily combined. Moreover,
the language is resolution and device-independent, so that draft copies can be proofed on a
low-resolution device and the final version printed in higher resolution on a different device.
Printers and Printing
203
Applications that support PostScript, including word-processing and publishing software, create
documents in the PostScript language without intervention by the user. Thus, it is not necessary to know
the details of the language to take advantage of its features. However, standard files that some
applications or special terminals produce cannot be printed on a PostScript printer because they are not
described in the language. The print service provides optional filters to convert many of these files to
PostScript so that users can take advantage of PostScript and continue to use their standard applications,
such as troff.
Retail Type 1 fonts can be installed for use with applications running on the desktop. These fonts can be
downloaded to PostScript printers if the application generates PostScript output that uses them. The lp
command handles this automatically using the download filter.
For more information, see the cancel command in the AIX 5L Version 5.3 Commands Reference, Volume 1.
For more information, see the dslpaccept, dslpaccess, dslpadmin, dslpdisable, dslpenable, dslpreject,
and dslpsearchcommands in the AIX 5L Version 5.3 Commands Reference, Volume 2.
For more information, see the lp, lpstat, mkprtldap, and mksecldap commands in the AIX 5L Version 5.3
Commands Reference, Volume 3.
schedules the print request and manages the transmission of the request to the PostScript printer.
simple
troff
daisy
dmd
tek4014
plot
Filters are provided with the print service to translate print requests with these formats to the PostScript
language. For example, to convert a file containing ASCII text to PostScript code, the filter takes that text
and writes a program around it, specifying printing parameters such as fonts and the layout of the text
on a page.
After the PostScript filters are installed, they are invoked automatically by the print service when a user
specifies a content type for a print request with the -T option. For example, if a user enters the command
204
the ASCII file report2 (a file with an ASCII or simple format) is converted to PostScript automatically, as
long as the destination printer (psprinter) is defined to the system as a PostScript printer.
-n number
Note: If these filters are to be used with an application that creates PostScript output, make sure that the
format of the application conforms to the format of the PostScript file structuring comments. In particular,
the beginning of each PostScript page must be marked by the comment
%%Page: label ordinal
where ordinal is a positive integer that specifies the position of the page in the sequence of pages in the
document, and label is an arbitrary page label.
For example, you have a file called report2 that has a content type simple (meaning that the content of
this file is in ASCII format). You want to print six pages of this file (pages 4 through 9) with two logical
pages on each physical page. Because one of the printers on your system (psprinter) is a PostScript
printer, you can do this by entering the following command:
lp -d psprinter -T simple -P 4-9 -y group=2 report2
The filter that groups these logical pages will try to position the pages on the physical page to maximize
space utilization. Thus, when you specify group=2, the pages will be printed side by side, so that the
physical page will be landscape orientation. Landscape mode, which controls the orientation of the logical
page rather than the physical page, would cause the logical pages to be positioned one on top of the
other when combined with the group=2 option.
205
PostScript printers must use the PS interface program, requested by specifying -m PS on the lpadmin
command line.
Note: The printer type and content type of a PostScript printer must be consistent with the printer type
used in PostScript filters. Therefore, install your PostScript printers with a printer type of PS, PS-b, PS-r,
or PS-br, and a content-type of PS.
The PS printer types serve two functions. First, they cause the print service to activate the correct fast
filter to communicate with the printer. PS and PS-r are used to communicate with printers connected via
a serial port; PS-b and PS-br, to communicate with printers connected through a parallel port. Second,
the PS interface creates a PostScript banner page for PS printers. The banner page is printed last if the
printer type is PS-r or PS-br, and the pages of the document are printed in reverse order. The printer
type is specified with the -T option to the lpadmin command.
PostScript Page order table:
You can choose the filtering of input by selecting a specific content type when configuring a PostScript
printer.
Printer
PS
PS-b
PS-r
PS-br
Connection Type
serial
parallel
serial
parallel
Page Order
normal
normal
reverse
reverse
The -b specification (used when you select PS-b or PS-br) represents batch, which is typically used for
parallel connections, but can also be used for serial connections if you do not want PostScript printer
status messages. The PS and PS-r printer types cannot be used for parallel connections.
By specifying the -I option of the lpadmin command when configuring a PostScript printer, you can
indicate which content types are handled by the printer without slow filtering. For a printer on a server
system, PS is the correct content type to enter. However, for a printer on a client system, consider where
slow filtering is to occur, because network and system resource management may be of concern.
By specifying valid content types other than PS, you can force the slow filtering of input to occur on the
server system. Conversely, if you specify a content type of PS, the input will be filtered locally before the
print request is forwarded to the server system for fast filtering and printing.
To configure a printer on a server system:
/usr/sbin/lpadmin -p ps1 -T PS-b -I PS -m PS
As part of the installation procedure, you may want to install fonts on the printer or downloadable fonts
on the computer. See Installation and maintenance of PostScript fonts on page 207 for details.
Installation and maintenance of PostScript filters:
The PostScript filters provided cover the majority of situations. In certain circumstances, however, you
may find it helpful to change the filter descriptions and install the filters differently.
206
This section describes the location and function of these filters. PostScript filters are contained in the
directory /usr/lib/lp/postscript.
Note:There are two types of filters: fast filters and slow filters. For definitions of these types, see
lpfilter and Print filter definition on page 195.
A prerequisite of communication between any system and a PostScript printer is the presence of the
postio or the lp.cat filter on the system. Those programs are the only mandatory PostScript filters that
communicate directly with the PostScript printer. See PostScript filters for information on filters that
allow other types of documents to be translated to PostScript and to be printed on a PostScript printer.
PostScript filters:
A list of file content types and associated filters is provided.
File Content Type
simple
troff
daisy
dmd
tek4014
plot
Filter
postprint
dpost
postdaisy
postdmd
posttek
postplot
See Special-purpose PostScript filters for information on filters perform special functions.
Special-purpose PostScript filters:
A list of special-purpose filters and their functions is provided.
Function
Communicate with printer
Download fonts
Reverse or select pages
Matrix gray scales
Filter
postio,lp.cat
download
postreverse
postmd
207
password and may be reserved for the printer administrator. This method is useful when there is
continual use of a font by the majority of print requests serviced by that printer.
v Fonts may be prepended to a print request by the user and be transmitted as part of the user print
request. When the document has been printed, the space allocated to the font is freed for other print
requests. The font is stored in the users directory. This method is preferable for fonts with limited
usage.
v Fonts may be stored on a system shared by many users. These fonts may be described as host-resident.
This system may be a server for the printer or may be a system connected to the printer by a network.
Each user may request fonts in the document to be printed. This method is useful when there are a
large number of available fonts or when there is not continual use of these fonts by all print requests.
If the fonts will be used only on printers attached to a server, store them on the server. If the fonts are
to be used by users on one system who may send jobs to multiple printers on a network, store them
on the users system.
The print service provides a special download filter to manage fonts using the last method in the list.
The print service can use troff width tables for the 35 standard PostScript fonts that reside on many
PostScript printers, for use by the dpost program.
Obtaining a list of printer-resident fonts:
Most PostScript printers come equipped with fonts resident in the printer ROM. Some printers have a
disk on which additional fonts are stored.
A list of the Type 1 fonts in ROM or on disk of an attached PostScript printer can be obtained from the
printer manufacturers documentation. For PostScript printers attached through a serial port, a list of
these fonts can also be generated using the postio command and a PostScript program, romfonts.ps.
To obtain a list of printer-resident fonts for a PostScript printer attached to a serial port, do the following:
1. Obtain the device on which the PostScript printer is connected:
lpstat -v
Given a system on which the PostScript printer prlocal is attached through a serial port, this
command would return output similar to the following:
device for prlocal: /dev/tty01
For our sample prlocal printer, this will produce output in the file /tmp/postio.o that looks similar to
the following:
printer startup
%%[ status: waiting; source: serial 25 ]%%
%%[ status: endofjob ]%%
%%[ status: idle ]%%
sending file romfonts.ps
waiting for end of job
%%[ status: busy; source: serial 25 ]%%
/AGaramond-Bold
/AGaramond-BoldItalic
/AGaramond-Italic
/AGaramond-Regular
/AvantGarde-Book
/AvantGarde-BookOblique
208
/AvantGarde-Demi
/AvantGarde-DemiOblique
. . . more PostScript font
names . . .
/ZapfChancery-MediumItalic
/ZapfDingbats
%%[ status: endofjob ]%%
job complete
This example lists the printer-resident fonts for the prlocal printer.
Adding printer-resident fonts to a printers font list:
You can add printer-resident fonts to a printers font list.
When a printer is installed, the list of printer-resident fonts should be added to the font list for that
printer. This font list file can be edited to contain only the font names in the printers memory (For
example AGaramond-Bold through ZapfDingbats), and placed into the file /etc/lp/printers/prlocal/
residentfonts to prevent downloading of these fonts from the host computer.
To add printer-resident fonts to a printers font list, do the following:
1. Navigate to the printer administration directory in which the font lists are kept. For a particular
printer, this font list is contained in the file /etc/lp/printers/printer-name/residentfonts. With the -p
option, download checks this file to see what Type 1 fonts are ROM-resident and disk-resident (some
PostScript printers have directly attached fonts disks) in the printer so that it does not download such
fonts.
2. This file is not automatically created when a PostScript printer is first set up on your system using the
lpadmin command. You may need to create this file yourself. (font-list files must be edited manually;
that is, with the help of a text editor such as vi.)
When fonts are permanently downloaded to the printer, add the font names to this file. (This will
prevent fonts from being downloaded when they are already on the printer, which can be a
time-consuming procedure.)
Note: If the printer is attached to a remote system, this list should include fonts which reside on that
system and are available for downloading to the printer. This prevents fonts from being transmitted
unnecessarily across a network.
Installing and maintaining host-resident fonts:
Some fonts will be resident on the host and transmitted to the printer as needed for particular print
requests.
As the administrator, it is your job to make PostScript fonts available to all the users on a system. To do
so, you must know how and where to install these fonts, using the guidelines described previously.
Because fonts are requested by name and stored in files, the print service keeps a map file that shows the
correspondence between the names of fonts and the names of the files containing those fonts. Both of
these must be updated when fonts are installed on the host.
To install host-resident PostScript fonts, do the following:
1. Copy the font file to the appropriate directory. The fonts available for use with PostScript printers
reside in the /usr/share/lib/hostfontdir directory or other directories.
2. Add to the map table the name of the font and the name of the file in which it resides. Also in the
hostfontdir directory, you (the administrator) must create and maintain a map table that shows the
correspondence between the name assigned to each font by the foundry (the company that created the
font) and the name of the file in which that font resides. A file name that begins with a slash (/) is
used as is; otherwise, the pathname is relative to the host font directory. Comments in the map table
209
are introduced by % (as in PostScript) and extend to the end of the line.For example, to map the font
called Palatino Bold, add the following line to the map table:
Palatino-Bold /usr/share/lib/hostfontdir
210
If the printer has mountable font cartridges, you need to list only their names. If the printer has selectable
character sets, you must list their names and map each set to a name or number that uniquely identifies
the set in the terminfo database.
Specifying character sets:
For printers that allow selectable character sets, determine the names of the character sets and then map
each set to a name or number in the terminfo database.
v To determine the names of the character sets listed in the terminfo database, enter:
tput -T printer-type csnm 0
Theprinter-type is the name of the printer type in question. This command should display the name of
the 0th character set (the character set obtained by default after the printer is initialized).
To display the names of the other character sets, repeat the command above, replacing 0 with 1, 2, 3,
and so on. In general, the terminfo names should closely match the names used in the user
documentation for the printer. However, because not all manufacturers use the same names, the
terminfo names may differ from one printer type to the next.
v To specify a list of character set names and to map them into terminfo names or numbers, enter:
/usr/sbin/lpadmin -p printer_name -S characterset_list
The characterset_list is a list of names, separated by commas or spaces. If you use spaces to separate the
names, enclose the entire list (but not the -S) in quotes. Each item in the list is a character set name
mapping (alias) that looks like one of the following:
csN=characterset_name
characterset_name1=characterset_name2
The variable N is a number between 0 and 63 that identifies the number of the character set in the
terminfo database. characterset_name1 identifies the character set by its name in the terminfo database.
In both instances, the name to the right of the equal sign (=) is the name you choose as an alias of the
character set.
Note: You do not have to provide a list of aliases for the character sets if the terminfo names are
adequate. You can refer to a character set by terminfo name, by number, or by your alias.
For example, your printer has two selectable character sets (sets #1 and #2) in addition to the standard
character set (set #0). The printer type is 5310. Enter the following commands to determine the names
of the selectable character sets:
tput -T 5310 csnm 1english
tput -T 5310 csnm 2finnish
The words english and finnish, which are the names of the selectable character sets, are the output of
the commands. The name finnish is adequate for referring to character set 2, but better names are
needed for the standard set (set 0) and set 1. Enter the following command to define synonyms:
/usr/sbin/lpadmin -p printer_name -S "cs0=american, english=british"
The following three commands will then produce identical results. (The lp command routes print jobs
to the printer, and in these examples, routes the print job to any printer capable of handling the cs1
character set.)
lp -S cs1 -d any . . .
lp -S english -d any . . .
lp -S british -d any . . .
If you do not list the character sets that can be used with a printer, the service assumes a printer that
has selectable character sets can take any csN name or terminfo name known for the printer.
Printers and Printing
211
v
Specifying font cartridges to use with a printer:
Until you specify the font cartridges that can be used with a new printer, the print service does not
consider any font cartridges installable on that printer and rejects any print requests that require a font
cartridge.
v To specify a list of font cartridges to use with a printer, type:
/usr/sbin/lpadmin -p printer_name -S font_cartridge_list
font_cartridge_list is a list of font cartridge names, separated by commas or spaces. If you use spaces to
separate the names, enclose the entire list (but not the -S) in quotes. These are the only font cartridges
considered installable on the printer.
v To remove the font cartridge list from the printer, enter:
/usr/sbin/lpadmin -p printer_name -S none
After you specify the list of font cartridges installable on the printer, you can install them. See Changing
a font cartridge on a printer.
Changing a font cartridge on a printer:
Before the print service prints a file that requires a font cartridge, you must install and mount the font
cartridge on the printer.
If you have set up alerting for the font cartridge, the print service alerts you when enough print jobs are
queued for the font cartridge to be installed and mounted. See Mount forms and font cartridge alerts
on page 214 for more information.
Changing a font cartridge involves first removing the current font cartridge from the printer. Then, install
the new font cartridge on the printer and inform the print service that the new font cartridge is ready to
use by mounting it. Because it is difficult to do this on a printer that is currently printing and because the
print service continues to print files that do not require the font cartridge on the printer, disable the
printer first.
To
1.
2.
3.
4.
Any print requests that require a font cartridge are printed on printer_name.
5. Re-enable the printer.
To unmount a font cartridge, enter:
/usr/sbin/lpadmin -p printer_name -M -S none
Note: You do not need to unmount the current font cartridge after physically removing it from the
printer before installing and mounting a new font cartridge.
212
Faults can range from simple problems, such as running out of paper, ribbon, or toner, to more serious
faults, such as a local power failure or printer failure. The range of fault indicators is also broad, ranging
from dropping the carrier (the signal that indicates that the printer is online) to sending an XOFF or a
message.
The print service itself only recognizes two classes of printer fault indicators: hangups (a loss of carrier)
and excessive delays in printing (an XOFF flow-control character without a matching XON). For faults
other than these, the printer service cannot determine the cause of the fault, so it cannot alert you.
However, you can add filters that can detect other printer faults and inform the print service, which in
turn alerts you. For more information, see Print filters on page 192.
Issuing a printer fault alert:
To arrange for the print service to issue an alert in the event of a printer fault, enter one of the following
commands:
/usr/sbin/lpadmin -p printer-name -A mail -W minutes
v
v /usr/sbin/lpadmin -p printer-name -A write -W minutes
v /usr/sbin/lpadmin -p printer-name -A 'command' -W minutes
The first two commands direct the print service to send you a mail message or write the message directly
to your terminal, respectively, for each alert. The third command directs the print service to run the
command command for each alert. The shell environment currently in effect when you enter the third
command is saved and restored for the execution of command. The environment includes environment
variables, user and group IDs, and current directory. The minutes argument is the number of minutes
between repeated alerts.
Disabling printer fault alerts:
You can disable printer fault alerts if desired.
If you do not want the print service to issue an alert when a fault occurs, enter the following:
/usr/sbin/lpadmin -p printer-name -A none
If you want mail sent or a message written to another user when a printer fault occurs, use the lpadmin
command with the -A mail login-ID option or the -A write login-ID option. If you do not specify a
login-ID, the mail or message will be sent to your current login name. This may not be your login if you
have used the su command to change your login.
Disabling repeated printer fault alerts:
After a fault occurs and you start receiving repeated alerts, you can direct the print service to stop
sending you alerts (for the current fault only).
To direct the print service to stop sending you alerts (for the current fault only), run the following
command:
/usr/sbin/lpadmin -p printer-name -A quiet
Note: Use the alert type of quiet only to terminate an active alert; do not specify quiet as the alert type
for a new printer.
If the printer-name is all in any of the commands discussed, the alerting condition will apply to all
printers.
If you do not define an alert method, you will receive mail once for each printer fault. If you define a
method without the -W option, you will be alerted once for each fault.
213
214
If you do not define an alert method for a form or font cartridge, you do not receive an alert for it. If you
define a method, but do not define the number of minutes between alerts (with the -W option), you
receive one alert for each occasion.
v To direct the print service to send electronic mail alerts every five minutes whenever the printer queue
contains two or more requests for the check form and it is not already mounted, enter:
lpforms -f check -A mail -Q 2 -W 5
v To direct the print service to write alerts to your terminal every two minutes whenever the printer
queue contains three or more requests for the dingbat font cartridge and the dingbat font cartridge is
not already mounted, enter:
lpadmin -S dingbat -A write -Q 3 -W 2
v To arrange for alerting whenever the queue contains requests for any form or font cartridge, enter one
of the following:
lpforms -f any -A mail -W 5
lpadmin -S any -A mail -W 5
v To stop receiving alert messages to mount a form or font cartridge, enter one of the following:
lpforms -f form_name -A quiet
lpadmin -S font_cartridge_name -A quiet
v To remove alerting when a form or font cartridge needs to be mounted, enter one of the following:
lpforms -f form_name -A none
lpadmin -S font_cartridge_name -A none
215
Default
9600
cs8
-cstopb
-parenb
ixon
-ixany
opost
-olcuc
onlcr
-ocrnl
-onocr
nl0
cr0
tab0
bs0
vt0
ff0
Description
9600 baud rate
8-bit bytes
1 stop bit per byte
No parity generation
Enable XON/XOFF flow control
Allow only XON to restart output
Postprocess data stream as listed below:
Do not map lower case to upper case
Map linefeed into carriage return/linefeed
Do not map carriage return into linefeed
Output carriage returns even at column 0
No delay after linefeeds
No delay after carriage returns
No delay after tabs
No delay after backspaces
No delay after vertical tabs
No delay after form feeds
You may find that the default characteristics are sufficient for your printers. However, printers vary
enough that you may have to set different characteristics. See the stty command for a complete list of
characteristics.
If you have a printer that requires printer port characteristics other than those handled by the stty
program, you will have to customize the interface program. See Printer interface scripts on page 184 for
help.
When you add a new printer, you may specify an additional list of port characteristics. The list you
provide will be applied after the default list so that you do not need to include in your list items that you
do not want to change. Specify the additional list as follows:
/usr/sbin/lpadmin -p printer-name -o "stty='stty-option-list'"
Note that both the double quotes and single quotes are needed if you give more than one item in the
stty-option-list.
Suppose your printer is to be used for printing graphical data, where linefeed characters should be
output alone, without an added carriage return. You would enter the following command:
/usr/sbin/lpadmin -p printer-name -o "stty=-onlcr"
Note that the single quotes are omitted because there is only one item in the list.
As another example, suppose your printer requires odd parity for data sent to it. You would enter the
following command:
/usr/sbin/lpadmin -p printer-name -o "stty='parenb parodd cs7'"
216
v To set up two virtual printers, port and land, that use the capabilities of a Hewlett-Packard LaserJet,
use the following procedure:
1. Set up the real printer. Specify the Name as real and set the Model to HPLaserJet.
2. Set up the port and land virtual printers. Set the Model to network. Specify the same Device to which
real is connected.
3. Create the file /usr/spool/lp/remote and add the following lines:
port: lp -dreal -oportrait
land: lp -dreal -olandscape
This specifies that when printing to printer land, the print system sends the print job to printer real
using the -olandscape option (to print in landscape mode) and when printing to printer port, the
print system sends the print job to printer real using the -oportrait option (to print in portrait
mode).
Note: The options listed after -dreal depend on the printer model. Check the interface script in
/usr/spool/lp/admins/lp/interface for your printer to determine the printer- or class-dependent
-o options.
v To print a file in landscape mode, enter:
lp -dland filename
This procedure translates the -dland option to lp to the necessary options for the printer (in this
example, -dreal -ol).
Another way to accomplish this is to create a simple shell script to perform the type of printing. For
example:
:
# Land - shell script to print in landscape mode
#
# syntax: land <file> <file> ...
#
#
lp -dreal -ol $@
The reasons for choosing one method over the other depend on how your applications access the print
system. Many applications allow you to specify only the name of the printer, so virtual printers are the
only solution. Other applications might allow complete control over the commands that submit the print
job. In this case, you might use the shell script in the preceding example.
217
The server flag options are described in detail in Server flag options on page 221.
The mkprtldap command works even if the directory server has been set up for other purposes, for
example, for white pages information. In this case, the mkprtldap command adds the AIX information
tree and the print subtree information to the existing database. This print tree is protected independently
from other trees by use of an Access Control List (ACL). In this case, the LDAP server works as usual.
Back up your existing database before you use the mkprtldap command to configure System V print
information to share the same database.
Configuration using the -s flag
During the configuration, if you use the -s flag with the mkprtldap command, the following occurs:
1. Checks the IBM Directory DB2 configuration on the system. If DB2 is not configured for IBM
Directory, the mkprtldap command creates a DB2 instance with ldapdb2 as the default instance name,
218
and creates a DB2 database with ldapdb2 as the default database name if one does not exist. If an
existing database is found, the mkprtldap command adds AIX System V print information to the
existing database.
2. Requires the IBM Directory Administrator Distinguished Name (DN) and password if the directory
has been previously configured. If the directory administrator DN and password have not been set,
the mkprtldap command sets them to the values provided to the command.
3. Adds the IBM Directory server process (slapd) to the /etc/inittab file so that the server starts after a
reboot.
4. Creates the AIX information tree DN (cn=aixdata container object) on the directory if one is not
present. The print subtree will be created under the AIX information subtree. If an existing AIX
information subtree exists on the directory, the print subtree will be created under it. All System V
print information will be stored under the print subtree. The directory-enabled System V print
commands must be run to add printers and print queues under the print subtree created.
5. Adds the default suffix cn=aixdata to the /etc/sldap32.conf file if the suffix does not exist. Creates
the AIX information tree container object cn=aixdata if it not found in the Directory. The cn=aixdata is
a top-level container object under which the print subtree (ou=print) is then created.
6. The print subtree is ACL-protected with the value of the ACLBindPasswd parameter passed to the
command. The same value must be used when configuring clients to use the directory for System V
print information.
7. If the -d flag is used and a valid existing node on the directory is passed to the command, the AIX
information subtree is created under the given node. The print subtree is then created under the AIX
information subtree.
8. Starts the IBM Directory server after all the previous steps are completed.
Note: If IBM Directory has been configured previously, the Administrator DN and password are needed
to run the mkprtldap command. The LDAP configuration is saved in the /etc/slapd32.conf file.
Note: If the IBM Directory (LDAP) server configuration is not successful, no undo option is provided for
the server-side configuration. See the IBM Directory documentation for any errors that occur during the
configuration. If the database information was created by the mkprtldap command, you must remove it
manually. If the mkprtldap command has added data to a preexisting database, you must determine how
to recover from a failed setup attempt. For details on how to remove data or databases, see the IBM DB2
documentation.
System V print information subtree:
System V print information is stored under the print subtree, which in turn is stored under a default AIX
Information tree (cn=aixdata) on the directory.
The AIX information tree is a top-level container object under which the different directory-enabled AIX
subsystems can store their information. It is recommended to store the print information in the default
location on the directory. However, the mkprtldap command provides the option to store the print
information under an existing node on the directory.
The following illustration shows the AIX System V print information stored in the directory in the form
of a directory information tree (DIT).
219
ou=other AIX
subsystem
ou=other AIX
subsystem
ou=printqueues
ou=printers
ou=systems
Print queue
definitions
Printer
definitions
System
definitions
After you have successfully configured IBM Directory to store System V print information, the next step
in the setup is to configure clients to use the LDAP directory server.
Because this AIX print subtree is ACL-protected, you may not be able to view the System V print
information in the directory information tree (DIT) under the AIX information tree using DMT (Directory
Management Tool). A client must bind with Print Bind DN (default is ou=print,cn=aixdata) and the ACL
bind password or with the administrator DN to be able to access the AIX print subtree.
Configuring a client to use the IBM Directory Server for System V print information:
You can configure a client to use the IBM Directory Server (LDAP) for System V print information.
To configure a client, use the IBM Directory (LDAP) for System V Print information, do the following:
1. Install the IBM Directory Client software on the system that will be set up as a client.
2. Run the mkprtldap command with the client option to configure the client. The syntax is as follows:
mkprtldap -c -h DirectoryServerHostname -w ACLBindPasswd [ -d PrintBindDN ] [-U]
During the client configuration, the mkprtldap command does the following:
v Saves the IBM Directory (LDAP) server host name in the /etc/ldapsvc/server.print file.
v Saves the AIX Print Bind DN in the /etc/ldapsvc/server.print file.
v Saves the ACL Bind Password for the AIX Print Bind DN in the /etc/ldapsvc/system.print file. The
value of the ACL Bind password must be the same as the one specified during the configuration of the
Directory server.
220
v Undoes a previous client configuration if the -U flag is specified. This option replaces the
/etc/ldapsvc/system.print and /etc/ldapsvc/server.print files with the previous saved copies of the
/etc/ldapsvc/server.print.save and /etc/ldapsvc/system.print.save files.
The client-side configuration files /etc/ldapsvc/server.print and /etc/ldapsvc/system.print are created
to store information about the IBM Directory server and ACL information; that is, the IBM Directory
server name, ACL information (printbindDN and printbindPassword), LDAP port, and the directory context
for print (required by the System V print subsystem). The default printbindDN is ou=print,cn=aixdata and
is used when the -d flag is not specified. If a DN is specified with the -d flag, the print bind DN will be
ou=print,cn=aixdata, <DN specified>. The following are sample /etc/ldapsvc/server.print and
/etc/ldapsvc/system.print files:
Example of a /etc/ldapsvc/server.print file:
PRINTSERVER=server.ibm.com
LDAPPORT=389
PRINTBINDDN=ou=print,cn=aixdata
where:
PRINTSERVER is the host name of the system with the IBM Directory server, LDAPPORT is the port
number to bind to, and PRINTBINDN is the ACL Bind DN and also serves as the directory context for
print
Example of a /etc/ldapsvc/system.print file:
PRINTBINDPASSWD=ldap
where:
PRINTBINDPASSWD is the ACL bind password for the print subtree.
The ACL bind password specified with the -w flag during client setup should match the ACL bind
password value specified during server configuration. The print directory context is the same as the
printbindDN. The file permissions for the /etc/ldapsvc/server.print file are set to 644 and the file is
owned by root. The file permissions for the /etc/ldapsvc/system.print file are set to 640. The file is
owned by root and members of the lp group are allowed read access to this file.
Parameter
Description
-a
AdminDN
-d
node DN
[Advanced Option] - This option requires a valid existing node DN on the directory under
which the AIX information tree and print subtree will be created.
The force flag is required by the mkprtldap command to force the creation of the print
subtree (and AIX information subtree if needed) when one or more AIX information trees
exist on the directory.
-f
-p
adminpasswd
Indicates the command is being run to configure the directory for System V print.
-s
-w
ACLBindPasswd
Client-side options
221
Flag
Parameter
Description
Indicates the command is being run to configure clients to use the directory for
System V print information.
-c
-d
PrintBindDN
Specifies the print bind DN. The default print bind DN is ou=print,cn=aixdata. The
print bind DN to use during client configuration is displayed at the end of the server
setup of the mkprtldap command.
-h
DirectoryServerHostname
Hostname of the IBM Directory server set up to store System V print information.
Undo a previous configuration of a client
-U
Usage
Flag
Parameter
Description
Displays usage information for the mkprtldap command.
where aclBindpassword the is the password used so that the ACL protects the print subtree. The ACL
bind password is specified during the configuration of System V print on the directory. This
configuration also sets the directory administrators DN and password to cn=root and root. Running
the command sets up a suffix and top-level container object cn=aixdata. The print subtree (ou=print)
is created under this AIX information tree (cn=aixdata object).
2. To configure System V print on a machine with a configured IBM Directory server, the administrator
DN and password are required. For example, if the existing administrators DN and password are
cn=admin and passwd, enter:
mkprtldap -s -a cn=admin -p passwd -w pass123wd
3. To configure System V print under a preexisting node on the IBM Directory server (for example,
o=ibm,c=us), the mkprtldap command provided the -d flag option. This is an advanced option
recommended only when it is necessary to store the print information under an existing node on the
directory. The recommended option is to store the print subtree in the default location on the
directory by not specifying the -d option.
The administrator DN and password are required to configure System V print on the directory.
Assume the existing administrators DN and password are cn=admin and passwd. Enter:
mkprtldap -a cn=admin -p passwd -w acl123passwd -d o=ibm,c=us
Running the command creates an AIX information tree (cn=aixdata) under the o=ibm,c=us object. The
print subtree is created under this new object (cn=aixdata, o=ibm, c=us).
4. To configure System V print information under a separate AIX information tree when the directory
contains an existing AIX information tree for other subsystem-specific information. There could be
situations in which the directory may contain an existing AIX information tree with Security or NIS
information. It may be necessary to store the print information in a separate location on the directory
under a different AIX information tree. By default,the mkprtldap command does not create an AIX
information tree if one exists on the directory. To force the mkprtldap command to create an AIX
information tree to store the print information,use the -f flag.
Consider an example where the security and NIS subsystem information is stored under the AIX
information tree at cn=aixdata,o=ibm,c=us. To create a new AIX information tree for print information
different from the existing one, run the command with the -f flag and specify the default location or
another node.
222
The Administrator DN and password are required to configure System V print on the directory. For
example, if the existing administrators DN and password are cn=admin and passwd, enter:
mkprtldap -a cn=admin -p passwd -w passwd123 -f
Running the command creates an AIX information tree (cn=aixdata) with the suffix (cn=aixdata) and
the print information is stored under this new AIX information tree (ou=print, cn=aixdata). There will
be two AIX information trees on the directory in this example: cn=aixdata,o=ibm,c=us and
cn=aixdata. The print information will be under the cn=aixdata object (suffix - cn=aixdata). For the
mkprtldap command, it is recommended to use the default location to add the print information to
the directory.
5. To configure a client to use IBM Directory setup for System V Print on host server.ibm.com, enter:
mkprtldap -c -h server.ibm.com -w passwd
Ensure that the ACL bind password (passwd) is the same as the one specified during the setup of the
Directory server. Running the command without specifying a print bind DN value with the -d option
will cause the command to use the default print bind DN ou=print,cn=aixdata. The Print Bind DN
must match the one displayed as a result end of running the mkprtldap command when you
configure the server.
6. To change the information in the client-side configuration files, run the mkprtldap command with the
new information. Enter:
mkprtldap -c -h server.ibm.co.uk -w aclpasswd -d ou=print,cn=aixdata,c=uk
Running this command on a client that has already been configured will change the information in
the /etc/ldapsvc/server.print and /etc/ldapsvc/system.print files to contain the new configuration
information. The original contents of the /etc/ldapsvc/server.print and /etc/ldapsvc/system.print
files will be stored in the /etc/ldapsvc/server.print.save and /etc/ldapsvc/system.print.save
files.
Files accessed during server and client configuration:
The mkprtldap command accesses and modifies several files during server and client configuration.
The following table shows files that are accessed and modified by the mkprtldap command during server
and client configuration and descriptions. It also shows the contents of the files.
Mode
File
Description
rw
/etc/slapd32.conf
rw
/etc/ldapsvc/server.print
rw
/etc/ldapsvc/system.print
Client configuration - Contains the ACL bind password for the print
subtree on the Directory
223
v Changing the status (including cancelling) of spooler jobs owned by the user
Note: This troubleshooting information assumes that you have access to a shell prompt. There are a
number of front-ends to the base operating system spooler itself on the market; troubleshooting in this
environment is still very possible, but if the problem lies in the command or method used to actually
submit a job to the spooler, the application must provide a method for precisely determining the
command or method used to submit the job to the spooler.
If the writesrv command is not running, start it with the following command:
startsrc -s writesrv
Finally, make sure that writesrv is listed in the output of one of the following commands:
netstat -a | pg
OR
netstat -a | grep writesrv
224
v Try the following command immediately after a reboot or when you have not tried to send anything to
the printer since a reboot.
echo Does the printer work? > /dev/lpn
where lpn is the name of the printer device you are testing. If the message prints at the printer, set up
the virtual printer definition for the printer. If the statement hangs or returns an error message, the
problem is not the operating system or the queueing system. It is one or more of the following:
The cable.
The setup, such as baud rate, handshaking, and port number. The printer and the computer must
have the same settings.
A bad port on the computer.
A broken printer.
v If you have trouble getting a serial printer to work on an 8-port, 16-port, or 64-port adapter or on a
modem, try to get the printer working on S1 or S2 directly on the computer. After the printer works on
S1 or S2, move the printer to the desired port. If S1 and S2 are unavailable, try moving the printer to
any other port.
Check the following items for hosts printing to a remote print server:
v Verify that the queue name and server name for the remote print server are correct in the /etc/qconfig
file.
v Make sure that the TCP/IP subsystem is running.
v Make sure that the qdaemon daemon is running.
Adapter considerations
The 16-port RS-232 adapter does not support clear to send (CTS), so a printer connected to this adapter
will not finish printing a job if the printer is powered off while the job is printing.
The 16-port RS-232 adapter does not support clear to send (CTS). A printer connected to this adapter will
not finish printing a job if the printer is powered off while the job is printing. You must restart the job or
delete it manually.
Resource considerations
Printing generates processes. Printing a job might take up anywhere from one to five processes in most
instances.
As with any other activity, it is possible to exhaust the number of processes on the system. This can
happen by submitting a single print job on a very actively used system, or by submitting large numbers
of jobs on a system with little other activity.
225
Running out of processes can cause erratic behavior on your system. If you experience erratic behavior
on your system, check your resources to determine if you are running out of processes.
If you do not see a process called /var/sbin/qdaemon, qdaemon, or /etc/qdaemon running, the
qdaemon is not running.
2. Restart the qdaemon by entering the following startsrc command:
startsrc -s qdaemon
If you are not using the system resource controller (SRC), you can also restart the queue daemon with
the qdaemon command.
3. Let the qdaemon print all the jobs in the print queue.
4. Make sure the lpd daemon is up and running by entering:
startsrc -s lpd
226
The lpstat command displays information about the current status of the line printer. The enq
command enqueues a file.
2. Issue the following command to stop qdaemon:
stopsrc -s qdaemon
3. Issue the following commands to verify that qdaemon did not fork other processes:
ps -ef | grep qdaemon
ps -ef | grep pio
The ps command shows the current status of processes. The grep command searches a file for a
pattern.
If you get one line back from each of the above grep commands, skip step 4and go to step 5. If you
get more than one line, go to step 5.
4. If other qdaemons or pios were returned by the ps -ef command, kill these processes by issuing the
following command with each process ID:
kill -9 pid
The following example shows a qdaemon returned by ps -ef. The process ID is 3357.
root 3357 2288 0 13:32:21 - 0:04 dtterm
To kill this process ID, enter kill -9 3357 at the command line.
5. Perform this step only if it is necessary to save the current print jobs from being deleted. Otherwise,
proceed to step 7.
If your print job is queued in one of the following directories, make a copy of it, and place it in /tmp.
You can print it when the queuing system is running again.
/var/spool/qdaemon
/var/spool/lpd
Note: In these directories, the files will have unfamiliar system names.
6. If the /var file system gets too full, you may experience problems with qdaemon or the spooler.
Large print jobs may fail, or 00root files with zero lengths may appear in your qdir directory.
Rebooting the system in this case may not clear out the files or restart qdaemon.
Enter the df command and look in the %used column for /var to see if the file system is too full.
Free space in the file system as necessary.
The df command displays information about total space and available space on a file system.
7. Change the directory as follows:
cd /var/spool/lpd/qdir
8. Issue a pwd command to verify that you are in the proper directory. Then, remove all files in this
directory using the rm command:
rm *
The pwd command writes to standard output the full path name of your current directory (from the
root directory). The rm command removes the entries for the specified file or files from a directory.
9. Change the directory again:
cd /var/spool/lpd/stat
10. Issue a pwd command to verify that you are in the proper directory. Then, remove all files in this
directory:
rm *
12. Issue a pwd command to verify that you are in the proper directory. Then, remove all files in this
directory:
rm *
Printers and Printing
227
13. Follow this step if you are having trouble with the remote queue or lpd. Change the directory:
cd /var/spool/lpd
Issue a pwd to verify that you are in the proper directory. Then, remove all files in this directory
using the rm command:
rm *
The queuing system should start normally. If some queues are still down, bring them up by entering:
enable QueueName
The lpq command, when entered without flags, reports the status of the default queue.
v Use the following enq command:
enq -q
The enq command enqueues a file to a shared resource, typically a printer (that is, it puts files into
a queue for a particular resource). The -q flag displays the status of the default queue.
2. Use one of the following commands to remove the job from the print queue (you must have root user
authority to cancel jobs other than your own):
v Use the following enq command:
enq -x 21
In this example, the enq command uses the -x flag to cancel job number 21.
v Use the following lprm command:
lprm -P lp0 42
In this example, the lprm command removes job number 42 from the lp0 printer queue, named
with the -P flag. You can also remove jobs for a specific user by naming the user on the command
line.
v Use the following qadm command:
qadm -X lp0
In this example, the qadm command uses the -x flag to cancel all jobs on the lp0 printer.
v Use the following SMIT fast path for the qcan command:
smit qcan
In this example, you can choose the By Print Queue option to cancel either all of a particular users
jobs or all jobs on a particular printer.
3. Tell the sender of the print job to first divide it into smaller pieces by using the following split
command, and then send the file as a series of jobs:
split -50 bigfile
The split command reads the specified file and writes it into segments to a set of output files. In the
previous example, bigfile is split into 50-line segments named bigfileaa, bigfileab, bigfileac, and
so forth.
228
The du command summarizes disk usage. The -s flag instructs the du command to display only the
total disk usage of the /var/spool directory and the files it contains. The -r flag tells the du command
to display an error message if it cannot read a file or directory.
2. Delete or move files in a full directory by doing one of the following:
v Delete any extraneous files. For example:
rm extrafile
v Move files that are a few hours old to a safe temporary directory. For example:
mv extrafile /u/spoolhold
Note: You must have root user authority to remove or move files other than your own.
3. Prevent users from storing files in your spooling directories by doing the following:
v Set permissions on the spooling directory using the chmod command. Change the directory to
exclude general users. For example:
chmod go-rw /var/spool/lp0
v Create a cron job to clean out the directory (you must have root user authority). Edit the crontab
file. For example, you might add the following line to your crontab file:
find /spool -mtime +7 -a -exec rm -f
This line removes any file in the /var/spool directory one week after the last modification.
v Establish policy for the whole user group.
Create a script to identify all users whose disk holdings are above a certain threshold and send
them e-mail requesting that they clean up their files.
v Provide an alternate way to store files, such as a tape drive in a public area, so that users can
archive infrequently used files.
4. As a last resort, mount more space to the spool directory by using one of the following methods:
v Use the mount command, which makes a file system available for use at a specified location. For
example:
mount /var/spool morespool
v Use the smit mount command, choose the Mount a File System option, and specify the file system
name and attributes.
v Verify that you have the correct cable for the printer.
v Make sure the cable is securely plugged into the terminals auxiliary port.
Printers and Printing
229
If the status for the terminal-attached printer queue does not read READY, enter the following commands
to cancel all jobs on the queue and restart it:
qadm -Xqname
qadm -Uqname
where qname is the name of the terminal-attached printer queue. You must resubmit your print jobs.
v Verify that the pioout command has the correct permissions:
/usr/lib/lpd/pio/etc/pioout -r-sr-xr-x
To reset permissions, enter the following command:
chmod 4555 /usr/lib/lpd/pio/etc/pioout
v Resubmit the print request and avoid typing while the request is printing.
v If the ASCII terminal locks, turn the terminal off and on.
230
qdaemon checklist
Use this checklist if there is a problem with the qdaemon command.
Under normal circumstances, the qdaemon command starts when the system starts, runs until the system
shuts down, and requires no attention from you (see the qdaemon command for more information).
Sometimes, however, the qdaemon command may stop running or be unable to perform its function. The
following information explains what you need to do under these conditions.
Any of the following conditions indicates that the qdaemon command needs maintenance:
v The enq command requests return the following message:
cannot awaken qdaemon (request accepted anyway)
v The qdaemon command detects serious inconsistencies within itself and displays an error message.
v The ps -ef command (the process status command that gives a full listing of all processes) does not
show a process named /usr/sbin/qdaemon or qdaemon.
To start the qdaemon command, issue the following command:
startsrc -s qdaemon
Generally, only users with root privilege can use this command. The new qdaemon command goes
through an initialization process.
If the qdaemon command does not continue running, make sure that both the qdaemon command and
the enq command have the appropriate permissions. The person with root authority owns both the
qdaemon command and the enq command. The qdaemon command and the enq command must run as
if they are run by the user who owns them. The permission bit s sets the effective owner (user ID) of a
process to that of the nominal owner. The appropriate permissions for these two commands are:
qdaemon -r-sr-sTo check these permissions, enter aclget /usr/sbin/qdaemon.
To reset permissions, enter: tcbck -y /usr/sbin/qdaemon. You must have root
user authority to reset these permissions.
enq -r-sr-sr-x
To check these permissions, enter aclget /usr/bin/enq.
To reset permissions, enter: tcbck -y /usr/bin/enq. You must have root user
authority to reset these permissions.
If you continue to have problems with the qdaemon command, you can use the following procedure to
reinitialize the entire queuing system:
1. If the qdaemon command is running (use the ps -ef command to find out), end it by entering
stopsrc -s qdaemon.
2. If any backends are running, use the kill command to stop them. See the kill command for more
information.
3. Delete the contents of the following directories:
v /var/spool/lpd/stat
v /var/spool/lpd/qdir
Note: All jobs currently queued for printing are canceled and must be resubmitted.
4. Restart the qdaemon command by entering startsrc -s qdaemon. See the startsrc command for more
information.
231
where QUEUE is the queue and DEVICE is the device that is showing DEV_WAIT.
mkdir /tmp QDIR
mv /var/spool/lpd/qdir/NNUSER:QUEUE /tmp QDIR
where NN is a number, USER is the user who queued the job and QUEUE is the queue that is showing
DEV_WAIT.
startsrc -s qdaemon
After the queueing system has been cleared and appears to be functioning properly, you will need to stop
the qdaemon, copy the jdf files from /tmp/QDIR to /var/spool/lpd/qdir, and then restart the qdaemon.
qdaemon testing
If submitting jobs to the spooler causes no discernible spooler activity, use the following information to
determine and resolve the problem.
Assume a local ASCII print queue named asc.
Is the qdaemon running?
Issue the command enq -Pasc /etc/motd. If the qdaemon is not active, a variant of the following
message will be displayed:
enq: (WARNING): Cannot awaken qdaemon. (request accepted anyway)
enq: errno = 2:
Issue the command ps -ef | grep qdaemon to verify that the qdaemon is not active. If the qdaemon is
not active, you should see, at the most, a line of output representing the grep itself. It should look
something like this:
root
2992 18792
0 12:46:39
pts/2
If the qdaemon is active, which it almost certainly will not be, you will see a variant of the following
line:
root
2980 3652
0 12:41:25
0:00 /usr/sbin/qdaemon
232
If the qdaemon is not active, issue the command startsrc -s qdaemon to restart the qdaemon. If the
qdaemon died, it should have been restarted automatically by the srcmstr process, but this does not
always work, so restart it manually. You should see a variant of this message:
0513-059 The qdaemon Subsystem has been started. Subsystem PID is 3000.
Wait a minute or so and reissue the command ps -ef | grep qdaemon. Is the qdaemon still active or did
it start and then quit?
The qdaemon may no longer be active, despite the fact that you just restarted it and received a message
stating the process ID (PID) of qdaemon. Check for the existence of the file named /var/spool/lpd/stat/
pid. You can do this by issuing the command cat /var/spool/lpd/stat/pid. This file contains the PID of
an active qdaemon. When the qdaemon is not active, the file is supposed to be removed.
If the cat command prints a number on your display, that should be the PID of an active qdaemon. If you
have already determined that the qdaemon is not active, remove the file /var/spool/lpd/stat/pid
because a previous instance of the qdaemon somehow quit without causing this file to be removed. If the
file does not exist, you should see a message like:
cat: cannot open /var/spool/lpd/stat/pid
The qdaemon was inactive, you restarted it, it quit again, the file /var/spool/lpd/stat/pid existed, and
you removed that file. Restart the qdaemon again using the command startsrc -s qdaemon. Wait a
minute or so and issue the command ps -ef | grep qdaemon again to see if the qdaemon remained
active. You can also issue the command cat /var/spool/lpd/stat/pid again to see if the file was
recreated and now contains a valid PID.
If the answer to the original question, Is the qdaemon running?, was yes, it is, then it is possible that the
qdaemon is waiting on all currently running jobs to complete before it shows any signs of accepting new
jobs. This scenario often occurs when a machine running the base operating system has a large number of
printers (more than 25) attached to asynchronous adapters, such as 64-port or 128-port adapters.
To check to see if the qdaemon is waiting on a job to complete before it runs any more jobs, use the
lpstat command to see if any jobs have a status of RUNNING. If so, physically examine the printers that
show RUNNING jobs and verify that at least one job is actually running. If one or more printers are
showing DEV_WAIT because of paper jams or because they are out of paper, fix the problem and see if
the printers begin printing. If they do not begin printing, again use the lpstat command to see if the
queue status is RUNNING. In any of these circumstances, the purpose of checking the printers is to
verify that at least one printer is actually printing even though the qdaemon is not starting new jobs.
Now submit a new job to the spooler with the command enq -Pasc /etc/motd.
Use the lpstat command to examine the queue status. If the new job has a job number of NEW, then the
qdaemon is, for some reason, focused on running other jobs and will not start any new jobs until the
current jobs are complete. You can only wait. You cannot even cancel the jobs that are running, since job
cancellation requests are jobs as well, and the qdaemon is not taking new jobs.
233
the queue, use personal knowledge, application documentation, or application technical support to
determine what might be wrong. If possible, determine exactly what job submission command or method
is being used by the application and try it from the command line. It is possible that the application is
hiding error messages being returned by either enq or the qdaemon.
where PIDNumbers are PIDs resulting from the ps command. You may find qdfork.
3. Stop associated processes:
ps -ef | grep pio
kill -9 PIDNumbers
where PIDNumbers are PIDs resulting from the ps command. You may find pioformat or pioout.
4. Clean out the queue and device status directory.
rm /var/spool/lpd/stat/*_dev_*
rm /var/spool/lpd/stat/s*
The file /var/spool/lpd/stat/numfile contains an integer representing the last job number that was
assigned. If it is satisfactory that the job numbering scheme restarts, enter:
rm /var/spool/lpd/stat/*
234
startsrc -s qdaemon
While issuing the ps commands, you may find a process whose parent process ID (PPID) is 1. If these
processes cannot be killed by kill -9, you must reboot the system to delete these processes.
Printing terminology
There are a number of terms that are commonly used with printing.
formatter filter
Provides the capability of either formatting the input print file or passing it through unmodified,
based on an input parameter. Even if the filter passes the input file unmodified, it still sends
printer commands to initialize the printer before the input file is printed and restores the printer
after printing is complete.
The formatter filter is made up of the following components:
v A device-independent formatter driver
v A device-dependent formatter
There is a formatter for each type (or group of types) of input data. For example, there is one
formatter for all the supported IBM Proprinters.
Invoked by a pipeline, the formatter driver is passed the name of a formatter to be driven. The
formatter driver dynamically loads and links the formatter and calls the formatters setup
function , which indicates whether data formatting or data pass-through is requested. After the
formatters setup function prepares the input file to be modified or passed through, it returns to
the formatter driver. The formatter driver then calls the initialize function, which outputs a string
of printer commands that starts the printer. For more information, see the initialize and setup
functions.
The formatter driver next calls either the passthru function once or the lineout function for each
line in the print file based on the return code from the setup function. If the lineout function is
called, the formatter driver performs all vertical spacing either automatically (form feeds, top and
bottom margins) or through the lineout function (line spacing, vertical tabs). For more
information, see the passthru and lineout functions.
When processing is complete, the formatter driver calls the restore function. The restore function
outputs a string of printer commands that restore the printer to its default state, which is defined
by the database attribute values. See the restore function for more information.
For more information about how the print formatter interacts with the printer formatter
subroutines, see the Print formatter example on page 73.
local printer
The printer attached to a node or host.
print job
A unit of work to be run on a printer. A print job can consist of printing one or more files,
depending on how the print job is requested. The system assigns a unique job number to each job
it prints.
print spooler
A generic spooling function that can be used for queuing various types of jobs, including print
jobs queued to a printer. The spooler does not normally distinguish the types of jobs it is
queuing. A system administrator defines a spooler queue abased on the spooler backend program
that is specified for the queue. For example, if the spooler backend program is the piobe
command (the printer I/O backend), the queue is a print queue.
235
Likewise, if the spooler backend program is a compiler, the queue is for compile jobs. When the
spoolers qdaemon process selects a job from a spooler queue, it runs the job by calling the
backend program specified by the system administrator when the queue was defined.
When networks are composed of base operating system machines and other types of clients and
servers, not all remote print requests are supported across the network. In some instances, you
might have to submit print jobs one file at a time or concatenate files before submitting them as a
print job.
The primary spooler command is the enq command. Although you can invoke this command
directly to queue a print job, three front-end commands are defined for submitting a print job
(see the lp, lpr, and qprt commands). A print request issued by one of these commands is first
passed to the enq program, which then places the information about the file in the queue for the
qdaemon to process. The queue is the /var/spool/lpd/qdir directory.
If the job is not a file (that is, pipe output of a command to enq), a real file is created in
/var/spool/qdaemon that contains the data to be printed. The information in the
/var/spool/lpd/qdir file points to the file in /var/spool/qdaemon.
printer backend
A collection of programs called by the spoolers qdaemon process to manage a print job that is
queued for printing. The printer backend performs the following functions:
v Receives a list of one or more files to be printed from the qdaemon process
v Uses printer and formatting attribute values from the database, overridden by flags entered on
the command line
v Initializes the printer before printing a file
v Runs filters as necessary to convert the print data stream to a format supported by the printer
v Provides filters for simple formatting of ASCII documents
v
v
v
v
v
v
v
v
The mkvirprt command defines a virtual printer to the printer backend. The set of predefined
attributes for the particular type of printer is copied to create a customized set of attributes. The
customized attributes can be listed with the lsvirprt command and changed with the chvirprt
command, with the Web-based System Manager (type wsm, and then select Devices), or with
SMIT (Change / Show Print Queue Characteristics option). Each time the mkvirprt or chvirprt
command is used, a digest utility (piodigest command) is automatically run to construct a
memory image of the attribute values and lookup tables that are to be read in and used during
the printing process.
The qdaemon command calls the piobe command (the Print Job Manager) and passes the flag
options and the names of one or more files to be printed. The only flag options not passed are
the spooler flag options removed by the enq command, because the qdaemon command has
already opened the printer device and redirected standard output to the printer. A status file
provides communication between the qdaemon and the backend.
If a header page is needed, the piobe command retrieves a header page pipeline that generates
the header page. The header page pipeline is passed to a shell. In the pipeline, the standard
output from the header page filter becomes the standard input for the formatter filter. The
236
formatter filter processes the header page and writes the result to standard output. Standard
output for the formatter filter becomes standard input for the device driver interface program
that writes the filtered header page to the printer device driver.
printer/plotter device
A special file in the /dev directory for the device. This file can be used by redirection (for
example, cat FileName > /dev/lp0). Settings for the device driver can be displayed and changed
using Web-based System Manager (type wsm, and then select Devices) or the lsdev and chdev
commands. Before printer commands can access a printer device, a print queue must be created
for the device, or the printer must be configured in the printer backend in /etc/qconfig.
qdaemon
The qdaemon is a process that runs in the background and controls the queues. It is usually
started by the startsrc command when the system is turned on.
The qdaemon keeps track of the print requests in the /var/spool/lpd/qdir directory and ensures
that the jobs are sent to the proper printer at the proper time. It also keeps track of the status of
the printers and stores printer usage data for system accounting purposes. This information is
held in the /var/spool/lpd/stat directory and can be accessed using the lpstat and enq -A
commands.
If the qdaemon is stopped, it is restarted by the srcmstr process.
Note: Do not stop the srcmstr process; it controls other daemons running on your system.
queue The location to which you direct a print job. It is a stanza in the /etc/qconfig file that matches
the name of the queue. It points to the associated queue device. For example:
Msa1:
device = lp0
In the preceding example, lp0 is the device name, and the rest of the lines define how the device
is used.
Adding a printer through Web-based System Manager (type wsm, and then select Devices) creates
a standard queue device entry to an existing queue.
Note:
1. There can be more than one queue device associated with a single queue.
2. There is no file entry in the /etc/qconfig file when you are using a remote printer. The queue
directs the file to the server.
real printer
The printer hardware attached to a serial or parallel port at a unique hardware device address.
The printer device driver in the kernel communicates with the printer hardware and provides an
interface between the printer hardware and a virtual printer.
237
A real printer can be added with the Web-based System Manager (type wsm, and then select
Printers) or with the mkdev command at the command line. See the mkdev command for more
information.
remote printer
A printer that is not directly attached to a local system. A remote print system allows nodes that
are not directly linked to a printer to have printer access.
To use remote printing facilities, the individual nodes must be connected to a network using
Transmission Control Protocol/Internet Protocol (TCP/IP) and must support the required TCP/IP
applications.
serial printer
A printer that performs functions sequentially, such as printing one character at a time.
Serial printers are normally configured as DTEs; that is, they expect to receive data on the receive
data line and transmit data on the transmit data line. Serial printers default to EIA-232
connections and use DB-25 D-type connectors. Many printers also support EIA-422 connections.
virtual printer
Also called a virtual printer definition, this is a file containing a set of attribute values that describe
a particular data stream (such as ASCII or PostScript) for a particular printer. This does not
include information about how the printer hardware is attached to the host computer or about
the protocol used for transferring bytes of data to and from the printer. A virtual printer is
associated with a print queue. You can define a print queue for each data stream the printer
supports. Multiple print queues can use the same real printer.
Before a print job can be placed in a queue, a virtual printer definition must exist for both the
print queue and the queue device. For more information, see the mkvirprt command.
238
Notices
This information was developed for products and services offered in the U.S.A.
IBM may not offer the products, services, or features discussed in this document in other countries.
Consult your local IBM representative for information on the products and services currently available in
your area. Any reference to an IBM product, program, or service is not intended to state or imply that
only that IBM product, program, or service may be used. Any functionally equivalent product, program,
or service that does not infringe any IBM intellectual property right may be used instead. However, it is
the users responsibility to evaluate and verify the operation of any non-IBM product, program, or
service.
IBM may have patents or pending patent applications covering subject matter described in this
document. The furnishing of this document does not grant you any license to these patents. You can send
license inquiries, in writing, to:
IBM Director of Licensing
IBM Corporation
North Castle Drive
Armonk, NY 10504-1785
U.S.A.
The following paragraph does not apply to the United Kingdom or any other country where such
provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION
PROVIDES THIS PUBLICATION AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR
IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some
states do not allow disclaimer of express or implied warranties in certain transactions, therefore, this
statement may not apply to you.
This information could include technical inaccuracies or typographical errors. Changes are periodically
made to the information herein; these changes will be incorporated in new editions of the publication.
IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this
publication at any time without notice.
Licensees of this program who wish to have information about it for the purpose of enabling: (i) the
exchange of information between independently created programs and other programs (including this
one) and (ii) the mutual use of the information which has been exchanged, should contact:
IBM Corporation
Dept. LRAS/Bldg. 903
11501 Burnet Road
Austin, TX 78758-3400
U.S.A.
Such information may be available, subject to appropriate terms and conditions, including in some cases,
payment of a fee.
The licensed program described in this document and all licensed material available for it are provided
by IBM under terms of the IBM Customer Agreement, IBM International Program License Agreement or
any equivalent agreement between us.
239
For license inquiries regarding double-byte (DBCS) information, contact the IBM Intellectual Property
Department in your country or send inquiries, in writing, to:
IBM World Trade Asia Corporation
Licensing
2-31 Roppongi 3-chome, Minato-ku
Tokyo 106-0032, Japan
IBM may use or distribute any of the information you supply in any way it believes appropriate without
incurring any obligation to you.
Information concerning non-IBM products was obtained from the suppliers of those products, their
published announcements or other publicly available sources. IBM has not tested those products and
cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM
products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of
those products.
Any references in this information to non-IBM Web sites are provided for convenience only and do not in
any manner serve as an endorsement of those Web sites. The materials at those Web sites are not part of
the materials for this IBM product and use of those Web sites is at your own risk.
This information contains examples of data and reports used in daily business operations. To illustrate
them as completely as possible, the examples include the names of individuals, companies, brands, and
products. All of these names are fictitious and any similarity to the names and addresses used by an
actual business enterprise is entirely coincidental.
Trademarks
IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business
Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be
trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at
Copyright and trademark information at www.ibm.com/legal/copytrade.shtml
Adobe, the Adobe logo, PostScript, and the PostScript logo are either registered trademarks or
trademarks of Adobe Systems Incorporated in the United States, and/or other countries.
Java and all Java-based trademarks and logos are registered trademarks of Sun Microsystems, Inc. in the
United States, other countries, or both.
Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in
the United States, other countries, or both.
UNIX is a registered trademark of The Open Group in the United States and other countries..
Linux is a trademark of Linus Torvalds in the United States, other countries, or both.
Other company, product, or service names may be trademarks or service marks of others.
240
Index
Special characters
/etc/qconfig file structure
53
Numerics
5080 Attachment Adapter
20
A
adapter
transparent printing 133
ASCII terminal
configuring a printer for 25
ASCII to PostScript
automating conversion 12, 13
converting files 12, 13
printing 12
attachment files 86
B
backend
processing 49
routines libqb 81
C
canceling
print jobs 4
Canon LASER SHOT printer 147
checking
status of print jobs 8, 9, 10
chmod command 229
chpq command 13
chvirprt command 235
code sets
multibyte 83
colon files 57, 70
limits field operators 89, 90
to add a printer 94
command summaries
printing 14
commands
chmod 229
chpq 13
chvirprt 235
crontab 229
df 226
du 229
enq 15, 228, 235
grep 226
lp 235
lpq 228
lpr 235
lprm 228
lpstat 226
lsvirprt 235
mkprtldap 217
mkvirprt 235
Copyright IBM Corp. 1997, 2009
commands (continued)
mount 229
piobe 15, 235
piodigest 235
pr 11
ps 226
pwd 226
qcan 4, 228
qchk 8
qdaemon 15
qdaemon command 235
qmov 6
qpri 5
qprt 1, 12, 15, 235
rm 226
smit 1, 4, 5, 7, 9, 13
split 228
startsrc 226
configuring
printer or plotter connected to RAN
controlling
printing process 15
converting
ASCII files to PostScript 12
crontab command 229
134
D
Dataproducts printers 147
devices
printers or plotters 235
queue 235
df command 226
du command 229
E
enq command 15, 228, 235
enscript filter 12
escape sequences
arithmetic operators 65
ASCII output 65
binary output 65
bitwise logical operators 65
command line flags 65
conditional operators 65
description of 65
input values 65
internal variables 65
logical operators 65
pass through from input to output
relational operators 65
65
F
files
formatting for printing 11
printing ASCII on a PostScript printer
filters, formatter 51
12
241
flags
for pr command 11
for qprt command 1, 12
formatter filter
definition 235
formatting
files for printing 11
G
grep command
226
H
Hewlett-Packard printer information
148
I
IBM printers 137
iconv subroutine 83
L
LDAP
configure server 217
configure storage 217
Lexmark 4227 Forms Printer 150
Lexmark Optra C Color laserprinter 160
Lexmark Optra E Laser Printer 162
Lexmark Optra laserprinter 151
Lexmark Optra N Laser Printer 163
Lexmark Optra Plus laserprinter 152
Lexmark Plus Printers 175
libqb, backend routines 81
local printers
definition 235
lp command 235
lpd
daemon 37
lpq command 228
lpr command 235
lprm command 228
lpstat command 226
lsvirprt command 235
M
mkvirprt command 235
mount command 229
moving
print jobs 6, 7
O
overriding
auto-determination of print file types
14
P
paper size
specifying for Hewlett-Packard printers
specifying for IBM printers 33
piobe command 15, 30, 235
piodigest command 235
242
33
pioout command 30
PIOTERM environment variables 25
plotter
adding support for 20
PostScript files
converting from ASCII 12, 13
PostScript printers
printing ASCII files 12
pr command
flags 11
print formatter
example of 73
print jobs
canceling 4
checking status 8, 9, 10
definition 235
moving 6, 7
prioritizing 5
scheduling 31
starting 1
print queue
adding
print queue device 19
characteristics 32
clearing 226
deleting 32
device
characteristics 32
deleting 32
listing
print queues 30
mounting more space 229
removing a job 228
setting permissions 229
splitting a job 228
starting and stopping 30
status conditions 8, 9, 10, 35
using disk space 229
working with files 229
print server
remote 39, 226
print spoolers
definition 235
printer
adding an undefined
procedure of using colon file 94
backend
commands 30
colon files 70
limits field operators 89, 90
configuring
printer for an ASCII terminal 25
configuring nonsupported 22
control codes 15
control information 15
defined
listing 34
deleting 34
nonsupported
configuring of 22
physical 54
properties 34
remote
managing 38
specific information 136
Canon LASER SHOT 147
Dataproducts printers 147
printer (continued)
specific information (continued)
Hewlett-Packard printers 148
IBM printers 137
Lexmark 4227 Forms Printer 150
Lexmark Optra 151
Lexmark Optra C Color 160
Lexmark Optra E 162
Lexmark Optra N 163
Lexmark Optra Plus 152
Lexmark Plus Printers 175
Printronix printers 176
QMS printers 177
TI printers 177
subsystem 14
supported 95
listing 33
terminal-attached 23, 25, 26
installing 23
limitations 26
virtual
attributes, described 57
printer backend
definition 235
printer code page
translation table 82
printer troubleshooting 223
8-bit printer attached to 7-bit interface 230
adapter considerations 225
inoperative printers 224
local printer checklist 224
qdaemon problems 231
queuing system 232
remote printer checklist 225
terminal-attached printer checklist 229
printer/plotter device
definition 235
printers
formatter filter 235
local 235
moving to another port 34
port
moving printer 34
real 235
remote 235
serial 235
status conditions 8, 9, 10
terminal-attached
adding a print queue 136
configuring for the 128-port 135
configuring the auxiliary port 135
testing 136
virtual 235
printing
administration 14
ASCII files on a PostScript printer 12
canceling print jobs 4
checking status of print jobs 8, 9, 10
devices 235
formatter filter 235
formatting files for 11
local printers 235
moving print jobs 6, 7
overriding print file types 14
overview 1
print jobs 235
printer backend 235
printing (continued)
prioritizing print jobs 5
qdaemon 235
queue 235
queue devices 235
real printers 235
remote printers 235
serial printers 235
spoolers 235
starting print jobs 1
status conditions of printers 8, 9, 10
terminology 235
using qprt command 15
using smit command 15
using Web-based System Manager 15
virtual printers 235
printing problems
clearing print queue 226
deleting files 229
reallocating printer resources 228
Printronix printers 176
prioritizing
print jobs 5
processes
qdaemon 235
srcmstr 235
startsrc 235
processing, backend 49
ps command 226
pwd command 226
Q
qcan command 4, 228
qchk command 8, 9
qconfig file 39
qdaemon
checklist 231
definition 235
printer backend 235
restarting 232
qdaemon command 15, 235
qmov command 6
QMS printers 177
qpri command 5
qprt command 1, 15, 235
flags 1, 12
printing files 15
using X fonts with 85
queue
status conditions 8, 9, 10
queue daemon 232
reactivating 226
queue devices
definition 235
queues
definition 235
queuing system
status conditions 35
R
RAN
configuring 134
real printers
definition 235
Index
243
rembak program 37
remote print server 226
remote printer
checklist 225
managing 38
remote printers
definition 235
remote printing
overview 36
rm command 226
RS-232 adapter
printer considerations
translation tables
example 86
multibyte code sets 85
transparent printing 133
troubleshooting
printer 223
V
virtual printers 51
attributes described
definition 235
225
S
serial printers
definition 235
SMIT
printer paper size
specifying for Hewlett-Packard printers
specifying for IBM printers 33
SMIT (System Management Interface Tool)
interface to printer attachment files 87
sm_cmd_obj object class
used with printer files 89, 91
smit command
canceling a print job 4
checking status of a print job 9
converting ASCII to PostScript 13
moving a print job 7
printing files 15
prioritizing a print job 5
starting a print job 1
smit mount command 229
split command 228
spooler 43
configuration file
etc/qconfig file structure 53
data flow 46
parts 46
queues 54
spoolers
definition 235
spooling directory
mounting more space 229
setting permissions 229
working with files 229
starting
print jobs 1
startsrc command 226
status conditions
of printers 8, 9, 10
summaries
for printing 14
T
terminal-attached printer
checklist 229
terminal-attached printers
setting up the hardware 135
terminal-attached printing 23, 26
hardware supported 26
using a modem 25
Text Formatting System 12
TI printers 177
244
57
W
33
10
Printed in USA
SC23-4897-03