1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2 3<html> 4 <head> 5 <meta name="generator" content="HTML Tidy, see www.w3.org"> 6 <title>Printing Banners</title> 7 <meta name="GENERATOR" content= 8 "Modular DocBook HTML Stylesheet Version 1.7"> 9 <link rel="HOME" title=" LPRng Reference Manual" href= 10 "index.htm"> 11 <link rel="UP" title="Job Processing" href="jobsteps.htm"> 12 <link rel="PREVIOUS" title="Opening the Output Device " href= 13 "opendevice.htm"> 14 <link rel="NEXT" title="Printing Job Files " href= 15 "printingjob.htm"> 16 </head> 17 18 <body class="SECT1" bgcolor="#FFFFFF" text="#000000" link= 19 "#0000FF" vlink="#840084" alink="#0000FF"> 20 <div class="NAVHEADER"> 21 <table summary="Header navigation table" width="100%" border= 22 "0" cellpadding="0" cellspacing="0"> 23 <tr> 24 <th colspan="3" align="center">LPRng Reference Manual: 5 25 Sep 2003 (For LPRng-3.8.22)</th> 26 </tr> 27 28 <tr> 29 <td width="10%" align="left" valign="bottom"><a href= 30 "opendevice.htm" accesskey="P">Prev</a></td> 31 32 <td width="80%" align="center" valign="bottom">Chapter 33 15. Job Processing</td> 34 35 <td width="10%" align="right" valign="bottom"><a href= 36 "printingjob.htm" accesskey="N">Next</a></td> 37 </tr> 38 </table> 39 <hr align="LEFT" width="100%"> 40 </div> 41 42 <div class="SECT1"> 43 <h1 class="SECT1"><a name="BANNERPRINTING">15.6. Printing 44 Banners</a></h1> 45 46 <p>Options used:</p> 47 48 <ul> 49 <li> 50 <p><var class="LITERAL">ab</var> FLAG <span class= 51 "emphasis"><i class="EMPHASIS">Always print banner 52 (default FALSE)</i></span></p> 53 </li> 54 55 <li> 56 <p><var class="LITERAL">be=</var><span class= 57 "emphasis"><i class="EMPHASIS">End banner generator 58 program</i></span></p> 59 </li> 60 61 <li> 62 <p><var class="LITERAL">bl=</var><span class= 63 "emphasis"><i class="EMPHASIS">Short banner line 64 format</i></span></p> 65 </li> 66 67 <li> 68 <p><var class="LITERAL">bp=</var><span class= 69 "emphasis"><i class="EMPHASIS">Banner generator 70 program</i></span></p> 71 </li> 72 73 <li> 74 <p><var class="LITERAL">bs=</var><span class= 75 "emphasis"><i class="EMPHASIS">Start banner 76 generator</i></span></p> 77 </li> 78 79 <li> 80 <p><var class="LITERAL">generate_banner</var> FLAG <span 81 class="emphasis"><i class="EMPHASIS">Generate banner for 82 forwarded jobs</i></span></p> 83 </li> 84 85 <li> 86 <p><var class="LITERAL">hl</var> FLAG <span class= 87 "emphasis"><i class="EMPHASIS">Banner (header) 88 Last</i></span></p> 89 </li> 90 91 <li> 92 <p><var class="LITERAL">of=</var><span class= 93 "emphasis"><i class="EMPHASIS">Banner and File Separator 94 Filter</i></span></p> 95 </li> 96 97 <li> 98 <p><var class="LITERAL">sb</var> FLAG <span class= 99 "emphasis"><i class="EMPHASIS">Short banner (default 100 FALSE)</i></span></p> 101 </li> 102 103 <li> 104 <p><var class="LITERAL">sh</var> FLAG <span class= 105 "emphasis"><i class="EMPHASIS">Suppress header (banners) 106 (default FALSE)</i></span></p> 107 </li> 108 </ul> 109 <br> 110 <br> 111 112 <p>Banner printing is one of the more complicated 113 configuration options of <b class="APPLICATION">LPRng</b>. 114 This is due mainly to historical evolution of the software, 115 as well as a lack of a well defined standard for filter 116 responsibilities. In the original BSD print spoolers, the 117 philosophy was that banner printing should be delegated to 118 the filters, as they were the most aware of the capabilities 119 of the printers. This required an <span class="emphasis"><i 120 class="EMPHASIS">out of band</i></span> method to convey 121 banner printing information to the filter, and resulted in a 122 complicated interface. The original interface was:</p> 123 124 <ol type="1"> 125 <li> 126 <p>The filter doing banner printing was invoked as a 127 special <var class="LITERAL">:of</var> filter, or passed 128 a special flag.</p> 129 </li> 130 131 <li> 132 <p>The print spooling software would send a special <span 133 class="emphasis"><i class="EMPHASIS">single 134 line</i></span> of information telling it what the banner 135 information should be. Note that this line was never 136 documented except for the source code, and was 137 inconsistent from version to version. Also, there was no 138 indication of what to do with additional lines, if 139 any.</p> 140 </li> 141 142 <li> 143 <p>The filter would generate the banner, discard the 144 line, and then pass other lines to the output device.</p> 145 </li> 146 </ol> 147 <br> 148 <br> 149 150 <p>Adding to the confusion, the original print spoolers had a 151 <var class="LITERAL">:sh</var> (suppress header or banner) 152 flag, which was supposed to suppress banner printing. It did 153 this by having the print spooler not generate the magic 154 banner information line.</p> 155 156 <p>A more sophisticated banner printing system would allow 157 the print spooler software to generate the banner, and would 158 then have the <var class="LITERAL">:of</var> filter act as a 159 pass through. Thus, we need configure the <var class= 160 "LITERAL">:of</var> filter NOT to use the first line as 161 banner printing information, and to pass through all 162 information to the device.</p> 163 164 <p>Complicating this whole mess is the <var class= 165 "LITERAL">ld</var> (leader option) and <var class= 166 "LITERAL">tr</var> (trailer option) which is a string sent to 167 the output device (<var class="LITERAL">:of</var> filter) 168 when the device (filter) is initialized or terminated. This 169 can sometimes be interpreted as the banner line, leading to 170 unexpected results.</p> 171 172 <p>Sequence of Operations:</p> 173 174 <ol type="1"> 175 <li> 176 <p>If the <var class="LITERAL">sh</var> (suppress header) 177 flag is true, no banner is printed, and the actions in 178 this section are skipped. No <span class="emphasis"><i 179 class="EMPHASIS">banner information line</i></span> is 180 generated for the <var class="LITERAL">:of</var> filter, 181 and no banner printing program is invoked. If there is an 182 <var class="LITERAL">:of</var> filter and it is expecting 183 such a line and you have <var class="LITERAL">ld</var> or 184 <var class="LITERAL">tr</var> information then you may 185 get unexpected results (actually, catastrophic failure is 186 a better term, but I digress).</p> 187 </li> 188 189 <li> 190 <p>If the <var class="LITERAL">hl</var> (header last) 191 flag is true the banner is printed at the end of the job 192 and the actions in this section are done at the end of 193 the job.</p> 194 </li> 195 196 <li> 197 <p>If the user does not want banner pages she can use the 198 <tt class="COMMAND">lpr -h</tt> option. This will cause 199 the <b class="APPLICATION">lpr</b> program to delete the 200 <var class="LITERAL">L</var> (banner name) line in the 201 control file. If there is no <var class="LITERAL">L</var> 202 line in the control file and <var class= 203 "LITERAL">ab</var> (always print a banner) is false (the 204 default), then no banner is printed and the other actions 205 in this section are skipped. If <var class= 206 "LITERAL">ab</var> is true and the <var class= 207 "LITERAL">L</var> line is missing then the <var class= 208 "LITERAL">N</var> (user login name) is used; if it is 209 missing as well, then ANONYMOUS is used for the user 210 name.</p> 211 </li> 212 213 <li> 214 <p>If a banner printing program is specified by <var 215 class="LITERAL">bp</var>, <var class="LITERAL">bs</var>, 216 or <var class="LITERAL">be</var> options, then <b class= 217 "APPLICATION">LPRng</b> will invoke the program to 218 generate a banner and then send the generated banner to 219 the printer via the <var class="LITERAL">:of</var> 220 filter. The banner printing program will be invoked using 221 the standard filter command line flags (see <a href= 222 "filteroptions.htm">Filter Command Line Options and 223 Environment Variables</a> for details), with is <acronym 224 class="ACRONYM">STDIN</acronym> attached to /dev/null and 225 <acronym class="ACRONYM">STDOUT</acronym> attached to a 226 file to hold the output banner.</p> 227 </li> 228 229 <li> 230 <p>If no banner printing program is specified and the 231 <var class="LITERAL">sb</var> (short banner) option is 232 TRUE (default is true), then the <var class= 233 "LITERAL">bl=...</var> (banner line) option value is 234 expanded and sent to the <var class="LITERAL">of_fd</var> 235 (<var class="LITERAL">:of</var> filter or device. The 236 default <var class="LITERAL">bl</var> value is: <var 237 class="LITERAL">bl=$-'C:$-'n Job: $-'J Date: $-'t</var>. 238 Using our example, this will get translated to:</p> 239 240 <div class="INFORMALEXAMPLE"> 241 <a name="AEN7331"></a> 242<pre class="SCREEN"> 243 papowell:A Job: file1 file2 Date: Thu Nov 27 23:02:04 PST 1997 244</pre> 245 </div> 246 <br> 247 <br> 248 </li> 249 250 <li> 251 <p>If no banner printing program is specified and we have 252 <var class="LITERAL">sb@</var> (no short banner) then we 253 skip banner generation, i.e. - we do <span class= 254 "emphasis"><i class="EMPHASIS">not</i></span> send a 255 banner generation line to the output (<var class= 256 "LITERAL">:of</var> filter).</p> 257 </li> 258 259 <li> 260 <p>If the queue is a normal forwarding queue, then the 261 <var class="LITERAL">generate_banner</var> option will 262 invoke the <var class="LITERAL">bp</var>, <var class= 263 "LITERAL">bs</var> or <var class="LITERAL">be</var> 264 program as appropriate to create a banner page file which 265 is then made the first (default) or last (<var class= 266 "LITERAL">hl</var> flag or <var class= 267 "LITERAL">be=...</var> present) file in a job. This 268 option has no effect in other types of queues. See the 269 <span class="emphasis"><i class="EMPHASIS"><a href= 270 "translateformat.htm">translate_format</a></i></span> 271 option as well.</p> 272 </li> 273 </ol> 274 <br> 275 <br> 276 </div> 277 278 <div class="NAVFOOTER"> 279 <hr align="LEFT" width="100%"> 280 281 <table summary="Footer navigation table" width="100%" border= 282 "0" cellpadding="0" cellspacing="0"> 283 <tr> 284 <td width="33%" align="left" valign="top"><a href= 285 "opendevice.htm" accesskey="P">Prev</a></td> 286 287 <td width="34%" align="center" valign="top"><a href= 288 "index.htm" accesskey="H">Home</a></td> 289 290 <td width="33%" align="right" valign="top"><a href= 291 "printingjob.htm" accesskey="N">Next</a></td> 292 </tr> 293 294 <tr> 295 <td width="33%" align="left" valign="top">Opening the 296 Output Device</td> 297 298 <td width="34%" align="center" valign="top"><a href= 299 "jobsteps.htm" accesskey="U">Up</a></td> 300 301 <td width="33%" align="right" valign="top">Printing Job 302 Files</td> 303 </tr> 304 </table> 305 </div> 306 </body> 307</html> 308 309