<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<title>Banner Printing and the OF filter</title>
<meta name="GENERATOR" content=
"Modular DocBook HTML Stylesheet Version 1.7">
<link rel="HOME" title=" LPRng Reference Manual" href=
"index.htm">
<link rel="UP" title="Print Spooling Tutorial " href=
"tutorial.htm">
<link rel="PREVIOUS" title="Printcap Basics" href="x3105.htm">
<link rel="NEXT" title="Printing from lpr Directly To A Device"
href="x3378.htm">
</head>
<body class="SECT1" bgcolor="#FFFFFF" text="#000000" link=
"#0000FF" vlink="#840084" alink="#0000FF">
<div class="NAVHEADER">
<table summary="Header navigation table" width="100%" border=
"0" cellpadding="0" cellspacing="0">
<tr>
<th colspan="3" align="center">LPRng Reference Manual: 24
Sep 2004 (For LPRng-3.8.28)</th>
</tr>
<tr>
<td width="10%" align="left" valign="bottom"><a href=
"x3105.htm" accesskey="P">Prev</a></td>
<td width="80%" align="center" valign="bottom">Chapter 4.
Print Spooling Tutorial</td>
<td width="10%" align="right" valign="bottom"><a href=
"x3378.htm" accesskey="N">Next</a></td>
</tr>
</table>
<hr align="LEFT" width="100%">
</div>
<div class="SECT1">
<h1 class="SECT1"><a name="AEN3275">4.12. Banner Printing and
the OF filter</a></h1>
<p>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.</p>
<div class="VARIABLELIST">
<dl>
<dt><var class="LITERAL">:sh</var></dt>
<dd>
<p>Suppress all banner printing or header pages. This
prevents any banners from being generated by the <b
class="APPLICATION">lpd</b> print spooler and if
present in a client printcap entry, will cause <b
class="APPLICATION">lpr</b> not to put any banner
printing information in the control file. Even if this
flag is not present, then <b class=
"APPLICATION">LPRng</b> will not print a banner unless
a banner printing program is specified with the <var
class="LITERAL">:bp,</var> <var class=
"LITERAL">:bs</var>, <var class="LITERAL">:be</var>, or
<var class="LITERAL">:sb</var> option.</p>
</dd>
<dt><var class="LITERAL">:ab</var></dt>
<dd>
<p>Print a banner or header page, even if the user has
not requested one. The <var class="LITERAL">:sh</var>
option has precedence over the <var class=
"LITERAL">:ab</var> option.</p>
</dd>
<dt><var class="LITERAL">:hl</var></dt>
<dd>
<p>The banner (header) is at the end (last page) of the
job.</p>
</dd>
<dt><var class="LITERAL">:bs=/...</var> and <var class=
"LITERAL">:be=/...</var> and</dt>
<dd>
<p>The <var class="LITERAL">:bs</var> and <var class=
"LITERAL">:be</var> 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
<var class="LITERAL">:hl</var> flag has been set, only
the <var class="LITERAL">:be</var> will be used.</p>
</dd>
<dt><var class="LITERAL">:bp=</var>...</dt>
<dd>
<p>If there is no <var class="LITERAL">:bs</var> or
<var class="LITERAL">:be</var> value when printing a
banner at the start or end of the job respectively,
then use the indicated filter program to generate a
banner.</p>
</dd>
<dt><var class="LITERAL">:sb</var> and <var class=
"LITERAL">:bl=....</var></dt>
<dd>
<p>If there is no program specified to generate the
banner and the <var class="LITERAL">:sb</var> flag is
set, send the <var class="LITERAL">:bl</var> (banner
line) string to the printer.</p>
</dd>
<dt><var class="LITERAL">:of=filter</var></dt>
<dd>
<p>A filter used to process banners and other non-job
file information.</p>
</dd>
<dt><var class="LITERAL">:suspend_of_filter</var></dt>
<dd>
<p>Controls whether the <var class="LITERAL">:of</var>
filter is suspended or has its input terminated.</p>
</dd>
</dl>
</div>
<br>
<br>
<p>The <b class="APPLICATION">pclbanner</b>, <b class=
"APPLICATION">psbanner</b>, and <b class=
"APPLICATION">lpbanner</b> programs are part of the <b class=
"APPLICATION">LPRng</b> distribution and are usually
installed in the same location as the <b class=
"APPLICATION">LPRng</b> supported filters. They produce a
PCL, PostScript, or text banner respectively.</p>
<p>The OF filter (<var class="LITERAL">:of=/path</var>) 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:</p>
<ul>
<li>
<p>It must be explicitly specified in the printcap file.
It is not run by default.</p>
<p>If specified, it is started at the beginning of job
printing and stays present throughout the entire job
printing session.</p>
</li>
<li>
<p>When printing individual files, the <var class=
"LITERAL">:of</var> filter is sent a special <span class=
"emphasis"><i class="EMPHASIS">suspend
yourself</i></span> two character string, <var class=
"LITERAL">\031\001</var>. This will cause the <var class=
"LITERAL">:of</var> filter to send itself a <acronym
class="ACRONYM">SIGSUSP</acronym> (suspend) signal.</p>
</li>
<li>
<p>The <var class="LITERAL">:of</var> filter is restarted
when any information not part of a print job file, such
as the initialization string (<var class=
"LITERAL">:ld</var> option), termination string (<var
class="LITERAL">:ld</var> option), or form feeds at start
(<var class="LITERAL">:fo</var>), end (<var class=
"LITERAL">:fq</var>), and between job files (<var class=
"LITERAL">:ff_separator</var>), and when banners are
generated by the <var class="LITERAL">:bp</var>, <var
class="LITERAL">:bs</var>, <var class=
"LITERAL">:be</var>, or <var class="LITERAL">:sb</var>
option and need to be sent to the printer.</p>
</li>
</ul>
<br>
<br>
<p>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 <var class=
"LITERAL">:of</var> filter was simply to save the overhead of
creating an extra processes.</p>
<p>Unfortunately, the <var class="LITERAL">:of</var> 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 <var class=
"LITERAL">suspend_of_filter@</var> flag can be used. This
will cause the <b class="APPLICATION">lpd</b> server to close
the <var class="LITERAL">:of</var> filters input, rather than
sending it the suspend string, and to restart a new <var
class="LITERAL">:of</var> filter process when necessary.</p>
</div>
<div class="NAVFOOTER">
<hr align="LEFT" width="100%">
<table summary="Footer navigation table" width="100%" border=
"0" cellpadding="0" cellspacing="0">
<tr>
<td width="33%" align="left" valign="top"><a href=
"x3105.htm" accesskey="P">Prev</a></td>
<td width="34%" align="center" valign="top"><a href=
"index.htm" accesskey="H">Home</a></td>
<td width="33%" align="right" valign="top"><a href=
"x3378.htm" accesskey="N">Next</a></td>
</tr>
<tr>
<td width="33%" align="left" valign="top">Printcap
Basics</td>
<td width="34%" align="center" valign="top"><a href=
"tutorial.htm" accesskey="U">Up</a></td>
<td width="33%" align="right" valign="top">Printing from
<b class="APPLICATION">lpr</b> Directly To A Device</td>
</tr>
</table>
</div>
</body>
</html>
syntax highlighted by Code2HTML, v. 0.9.1