LPRng Reference Manual: 5 Sep 2003 (For LPRng-3.8.22)
Prev | Chapter 4. Print Spooling Tutorial | Next

# 4.12. Banner Printing and the OF filter

Banner or header pages can be printed at the beginning, end, or both at the beginning or end. The following flags control how and where banners are printed. These flags are listed in order of precedence.

:sh

  Suppress all banner printing or header pages. This prevents any banners from being generated by the lpd print spooler and if present in a client printcap entry, will cause lpr not to put any banner printing information in the control file. Even if this flag is not present, then LPRng will not print a banner unless a banner printing program is specified with the :bp, :bs, :be, or :sb option.

:ab

  Print a banner or header page, even if the user has not requested one. The :sh option has precedence over the :ab option.

:hl

  The banner (header) is at the end (last page) of the job.

:bs=/... and :be=/... and

  The :bs and :be options specify that a banner page is to be generated at the start and end of the job respectively, using indicated filter program. If the :hl flag has been set, only the :be will be used.

:bp=...

  If there is no :bs or :be value when printing a banner at the start or end of the job respectively, then use the indicated filter program to generate a banner.

:sb and :bl=....

  If there is no program specified to generate the banner and the :sb flag is set, send the :bl (banner line) string to the printer.

:of=filter

  A filter used to process banners and other non-job file information.

:suspend_of_filter

  Controls whether the :of filter is suspended or has its input terminated.

The pclbanner, psbanner, and lpbanner programs are part of the LPRng distribution and are usually installed in the same location as the LPRng supported filters. They produce a PCL, PostScript, or text banner respectively.

The OF filter (:of=/path) is used to process banner pages and to do any necessary setup to initialize the printer to handle banner pages. This filter has the following unusual behavior:

- It must be explicitly specified in the printcap file. It is not run by default.

  If specified, it is started at the beginning of job printing and stays present throughout the entire job printing session.

- When printing individual files, the :of filter is sent a special suspend yourself two character string, \031\001. This will cause the :of filter to send itself a SIGSUSP (suspend) signal.

- The :of filter is restarted when any information not part of a print job file, such as the initialization string (:ld option), termination string (:ld option), or form feeds at start (:fo), end (:fq), and between job files (:ff_separator), and when banners are generated by the :bp, :bs, :be, or :sb option and need to be sent to the printer.

This rather baroque behavior is mostly historical in origin, and is very much embedded in the existing documentation and methodologies of the BSD print spooling system. Originally, when a printer port was opened, a special device initialization string was sent by the printer port device driver; this usually resulted in an extra page of paper being ejected by the printer. By opening the device once and then keeping it open, the print spooler would avoid the wasted paper. The reason for suspending the :of filter was simply to save the overhead of creating an extra processes.

Unfortunately, the :of filter suspension behavior is now a problem rather than a benefit. For example, for many devices to finish printing a page correctly the filter must be closed in order for it to flush buffers and for the low level drivers to properly finish. In order to provide this functionality, the suspend_of_filter@ flag can be used. This will cause the lpd server to close the :of filters input, rather than sending it the suspend string, and to restart a new :of filter process when necessary.

Prev | Home | Next
Printcap Basics | Up | Printing from lpr Directly To A Device