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>Print Spooling Tutorial</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="PREVIOUS" title="AppleTalk Support " href= 12 "appletalk.htm"> 13 <link rel="NEXT" title="Sample Printcap Entry" href= 14 "sampleprintcap.htm"> 15 </head> 16 17 <body class="CHAPTER" bgcolor="#FFFFFF" text="#000000" link= 18 "#0000FF" vlink="#840084" alink="#0000FF"> 19 <div class="NAVHEADER"> 20 <table summary="Header navigation table" width="100%" border= 21 "0" cellpadding="0" cellspacing="0"> 22 <tr> 23 <th colspan="3" align="center">LPRng Reference Manual: 5 24 Sep 2003 (For LPRng-3.8.22)</th> 25 </tr> 26 27 <tr> 28 <td width="10%" align="left" valign="bottom"><a href= 29 "appletalk.htm" accesskey="P">Prev</a></td> 30 31 <td width="80%" align="center" valign="bottom"> 32 </td> 33 34 <td width="10%" align="right" valign="bottom"><a href= 35 "sampleprintcap.htm" accesskey="N">Next</a></td> 36 </tr> 37 </table> 38 <hr align="LEFT" width="100%"> 39 </div> 40 41 <div class="CHAPTER"> 42 <h1><a name="TUTORIAL"></a>Chapter 4. Print Spooling 43 Tutorial</h1> 44 45 <div class="TOC"> 46 <dl> 47 <dt><b>Table of Contents</b></dt> 48 49 <dt>4.1. <a href= 50 "tutorial.htm#OVERVIEW">Overview</a></dt> 51 52 <dt>4.2. <a href="sampleprintcap.htm">Sample Printcap 53 Entry</a></dt> 54 55 <dt>4.3. <a href="tutorialconfig.htm">Setting Up the 56 Tutorial Configuration</a></dt> 57 58 <dt>4.4. <a href="restoring.htm">Restoring Original 59 Configuration</a></dt> 60 61 <dt>4.5. <a href="printingandchecking.htm">Printing a 62 File and Checking Status</a></dt> 63 64 <dt>4.6. <a href="selectingprintqueue.htm">Selecting the 65 Print Queue</a></dt> 66 67 <dt>4.7. <a href="controllingprintqueue.htm">Controlling 68 the Print Queue</a></dt> 69 70 <dt>4.8. <a href="jobremoval.htm">Job Removal</a></dt> 71 72 <dt>4.9. <a href="printjobfilters.htm">Print Job 73 Filters</a></dt> 74 75 <dt>4.10. <a href="jobfileformatconversion.htm">Job File 76 Format Conversion with Filters</a></dt> 77 78 <dt>4.11. <a href="x3103.htm">Printcap Basics</a></dt> 79 80 <dt>4.12. <a href="x3273.htm">Banner Printing and the OF 81 filter</a></dt> 82 83 <dt>4.13. <a href="x3376.htm">Printing from <b class= 84 "APPLICATION">lpr</b> Directly To A Device</a></dt> 85 86 <dt>4.14. <a href="x3423.htm">Moving Jobs From Queue to 87 Queue and Redirecting Queues</a></dt> 88 89 <dt>4.15. <a href="x3470.htm">Print Job Classes, User 90 Requested Job Priority, and Form Support</a></dt> 91 92 <dt>4.16. <a href="x3515.htm">Holding and Releasing 93 Jobs</a></dt> 94 95 <dt>4.17. <a href="x3593.htm">Load Balance Queues and 96 Printer Pools</a></dt> 97 98 <dt>4.18. <a href="x3694.htm">Routing Jobs To Print 99 Queues</a></dt> 100 101 <dt>4.19. <a href="x3767.htm">Job Options and the Z 102 Control File Entry</a></dt> 103 104 <dt>4.20. <a href="x3885.htm">Interfacing to Non-LPRng 105 Spoolers</a></dt> 106 107 <dt>4.21. <a href="x3917.htm">Debugging, Tracing, and Log 108 Files</a></dt> 109 </dl> 110 </div> 111 112 <p>A print spooler is a program that accepts <span class= 113 "emphasis"><i class="EMPHASIS">print jobs</i></span> (which 114 are usually one or more files) from a program or network 115 interface, stores them in a <span class="emphasis"><i class= 116 "EMPHASIS">spool queue</i></span>, and then sends them to a 117 printer or another print spooler. Usually there are 118 facilities to submit jobs, check on the current job status, 119 remove jobs from spool queues, and perform administrative 120 functions such as starting or stopping printing.</p> 121 122 <p>A print spooler is a client/server application. The client 123 programs are used to submit jobs to the print spooler program 124 which performs the actual printing operations. In order to 125 carry out these operations, the server may need to use other 126 programs to convert print job files into a format acceptable 127 to a printer, or perform various accounting or administrative 128 functions.</p> 129 130 <div class="SECT1"> 131 <h1 class="SECT1"><a name="OVERVIEW">4.1. Overview</a></h1> 132 133 <div class="INFORMALEXAMPLE"> 134 <a name="AEN1668"></a> 135<pre class="SCREEN"> 136 +---------+ +-----+ +-----+ +--------+ +---------+ 137 | program | -> | lpr | -> | lpd | -> | filter | -> | printer | 138 +---------+ +-----+ * +-----+ +--------+ +---------+ 139 * * | 140 printcap V 141 +-----+ +--------+ +---------+ 142 | lpd | -> | filter | -> | printer | 143 +-----+ +--------+ +---------+ 144 145 Figure 1 146</pre> 147 </div> 148 <br> 149 <br> 150 151 <p>Figure 1 shows the flow of data between the individual 152 components of the <b class="APPLICATION">LPRng</b> print 153 spooling system. A program (or user) will use the <b class= 154 "APPLICATION">lpr</b> program to send a file to the <b 155 class="APPLICATION">lpd</b> server over a TCP/IP 156 connection. The <b class="APPLICATION">lpd</b> server will 157 store the file temporarily in a spool queue directory. The 158 information needed by the <b class="APPLICATION">lpr</b> 159 and <b class="APPLICATION">lpd</b> programs to carry out 160 this activity is stored in the <tt class= 161 "FILENAME">printcap</tt> (usually called the <tt class= 162 "FILENAME">/etc/printcap</tt>) database file.</p> 163 164 <p>The <b class="APPLICATION">lpd</b> server sorts the 165 queue entries and determines the print order. It will 166 select a job to be printed, open a connection to the 167 printer, and then use a <span class="emphasis"><i class= 168 "EMPHASIS">filter</i></span> program to convert the file 169 contents into a format suitable for the printer. If the 170 file does not need conversion, then the <b class= 171 "APPLICATION">lpd</b> server will send the file directly to 172 the printer.</p> 173 174 <p>The <b class="APPLICATION">lpd</b> server can also <span 175 class="emphasis"><i class="EMPHASIS">forward</i></span> 176 jobs to another print server over a network connection, 177 optionally sending them through a filter as well. The 178 destination server can in turn forward the job or send it 179 to a printer.</p> 180 181 <p>The protocol or commands used to do this job forward and 182 transfer are specified by <a href= 183 "rfc1179ref.htm">RFC1179</a>. This protocol specifies how 184 the <b class="APPLICATION">lpr</b> client program sends a 185 job to the <b class="APPLICATION">lpd</b> server, as well 186 as how the <b class="APPLICATION">lpd</b> server forwards 187 jobs to another server. In addition to job submission, 188 RFC1179 specifies commands to obtain queue status, to 189 remove jobs from the queue, and to start and stop print 190 queues.</p> 191 </div> 192 </div> 193 194 <div class="NAVFOOTER"> 195 <hr align="LEFT" width="100%"> 196 197 <table summary="Footer navigation table" width="100%" border= 198 "0" cellpadding="0" cellspacing="0"> 199 <tr> 200 <td width="33%" align="left" valign="top"><a href= 201 "appletalk.htm" accesskey="P">Prev</a></td> 202 203 <td width="34%" align="center" valign="top"><a href= 204 "index.htm" accesskey="H">Home</a></td> 205 206 <td width="33%" align="right" valign="top"><a href= 207 "sampleprintcap.htm" accesskey="N">Next</a></td> 208 </tr> 209 210 <tr> 211 <td width="33%" align="left" valign="top">AppleTalk 212 Support</td> 213 214 <td width="34%" align="center" valign="top"> </td> 215 216 <td width="33%" align="right" valign="top">Sample 217 Printcap Entry</td> 218 </tr> 219 </table> 220 </div> 221 </body> 222</html> 223 224