Next Previous Contents

7. Banners and OF Mode Operation

One of the more difficult administrative issues is whether to print banners (job separators) or to save the large amount of wasted paper, time and effort. The LPRng and ifhp combination provide a rather esoteric set of methods to generate banners, at least one of which should be suitable for your application.

You should be aware that some printers have the obnoxious habit of generating their own banner pages when jobs are transferred via the RFC1179 protocol. You should consult the manufacturers documentation and take the necessary steps to turn printer banner page generation off. It may turn out that this is impossible to do, and in that case the only option is to use the Socket or Appsocket connection methods.

By the original BSD print spooler, the :of print filter was responsible for banner generation. The print server would send it a magic string that the filter would recognize as a print a banner request, and it would then generate a banner. After this, another special magic cookie string, the character sequence 0x19,0x01, was sent to cause the :of filter to suspend itself. This allowed the print spooler to hold the connection to the printer open while it started another filter to transfer a file. Finally, after all the jobs were sent the :of filter was sent a SIGCONT signal to wake up and perform whatever closing operations were necessary.

This mixing of functionality causes horrible problems when special setup strings must be sent to printers in order to configure them for various operation. In order to avoid these problems, the banner printing and filter functions have been separated in the ifhp filter. If a banner is needed, then LPRng will use a special banner generating program to generate the banner. The output of this program is then sent to the :of filter, or directly to the printer if there is no :of filter.

7.1 No Banner

Here is a typical printcap entry when banner printing is not wanted:

lp:
  :sh
  :if=/.../ifhp

The :sh (suppress headers or banners) explicitly disables banner printing, and the lpd server will not even attempt to print a banner.

7.2 Banner Printing and No OF Filter

This printcap entry specifies a banner generator program and and banner generation. There is no :of filter specified, so the banner is sent directly to the printer. In such a case the banner printing program should make sure that it generates output with the appropriate set of initialization strings. The pclbanner, psbanner, and lpbanner programs produce PCL, PostScript, and text banners suitable for a wide range of printers. The code for these banner generators is part of the LPRng distribution.

lp:
  :bp=/.../pclbanner
   # or
  :bp=/.../psbanner
   # or
  :bp=/.../lpbanner
  :if=/.../ifhp

7.3 Banner Printing With OF Filter

Finally, we may want banner printing together with the :of filter. This is usually the case when we need to perform special printer setups or require the ifhp filter to do accounting. In this case we need to make sure that the banner page is counted as part of the job:

lp:
  :bp=/.../pclbanner
   # or
  :bp=/.../psbanner
   # or
  :bp=/.../lpbanner
  :of=/.../ifhp
  :if=/.../ifhp

When invoked as an :of filter, the lpd server passes a -Fo option on the command line, so that the ifhp filter knows what mode it is operating in.

7.4 LPRng Options Controlling Banner Printing

There are several other options available to control banner printing. If the user has specifically requested that one not be generated using the lpr -h (no header or banner) option, then the LPRng lpd printcap option force_banner overrides the user option. In addition, the bs (banner at start) and the be (banner at end) can be used to control where the banner is placed.


Next Previous Contents