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:
- A device-independent formatter driver
- 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 formatter's setup function , which indicates whether data formatting or data pass-through is requested. After the formatter's 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 thepassthru 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.
- 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.
Likewise, if the spooler backend program is a compiler, the queue is for compile jobs. When the spooler's 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 spooler's qdaemon process to manage a print job that is queued for printing. The printer backend performs the following functions:
- Receives a list of one or more files to be printed from the qdaemon process
- Uses printer and formatting attribute values from the database, overridden by flags entered on the command line
- Initializes the printer before printing a file
- Runs filters as necessary to convert the print data stream to a format supported by the printer
- Provides filters for simple formatting of ASCII documents
- Provides support for printing national language characters
- Passes the filtered print data stream to the printer device driver
- Generates header and trailer pages
- Generates multiple copies
- Reports printer error conditions, including out-of-paper and intervention-required errors
- Reports problems detected by the filters
- Cleans up after a print job is canceled
- Provides a print environment that a system administrator can customize to address specific printing needs
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 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 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 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
- queue device
- The stanza in the /etc/qconfig file that
usually follows the local queue stanza. It specifies the /dev file
(printer device) that should be printed to and the backend that should
be used. For example:
lp0: file = /dev/lp0 header = never trailer = never access = both backend = /usr/lpd/piobe
In the preceding example,
lp0
is the device name, and the rest of the lines define how the device is used. - 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.
A real printer can be added 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.