User`s guide
4-126
Guide to Printers and Printing
Pass–Through Mode
Both virtual printers and the printer device driver can operate, or function, either in
pass–through mode or in non–pass–through mode. ”Pass–through mode” simply means
that a data stream is ”passed through” to the printer, byte by byte, unmodified. The mode of
operation selected for a given job determines how or even if a data stream is processed. It
is important to understand the difference between the two modes, when each mode is in
effect, and if the mode can be changed.
Printer Device Driver Pass–Through Mode
The printer device driver itself, for instance /dev/lp0, by default operates in
non–pass–through mode. A user can query or modify the operating rules for /dev/lp0 by
issuing the splp command. For example, below are the results of issuing the command
splp lp0 on a system with an IBM 4029 LAserPrinter defined as lp0. The results are output
to the display element specified by the TERM environment variable.
device = /dev/lp0 (+ yes ! no)
CURRENT FORMATTING PARAMETERS (ignored by qprt, lpr, and lp commands)
Note: –p + causes the other formatting parameters to be ignored.
–p ! pass–through? –c + send carriage returns?
–l 64 page length (lines) –n + send line feeds?
–w 80 page width (columns) –r + carriage rtn after line fee?
–i 0 indentation (columns) –t + suppress tab expansion?
–W ! wrap long lines? –b + send backspaces?
–C ! convert to upper case? –f + send form feeds?
CURRENT ERROR PROCESSING PARAMETERS
–T 600 timeout value (seconds) –e ! return on error?
CURRENT SERIAL INTERFACE PARAMETERS
–B 19200baud rate –s 8 character size (bits)
–N ! enable parity? –S ! two stop bits?
–P ! odd parity?
The –p parameter determines whether or not 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. Splp 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
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 li
ne occurs immediately 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