]> git.ipfire.org Git - thirdparty/cups.git/blob - doc/help/spec-design.html
cfec318824f4c9ed69268997fd310441dd9a0231
[thirdparty/cups.git] / doc / help / spec-design.html
1 <HTML>
2 <!-- SECTION: Specifications -->
3 <HEAD>
4 <TITLE>CUPS Design Description</TITLE>
5 </HEAD>
6 <BODY>
7
8 <P>Like most printing systems, CUPS is designed around a central
9 print scheduling process that dispatches print jobs, processes
10 administrative commands, provides printer status information to
11 local and remote programs, and informs users as needed. Figure 1
12 shows the basic organization of CUPS.</P>
13
14 <H3>Scheduler</H3>
15
16 <P>The scheduler is a HTTP/1.1 server application that handles
17 HTTP requests. Besides handling printer requests via IPP POST
18 requests, the scheduler also acts as a full-featured web server
19 for documentation, status monitoring, and administration.</P>
20
21 <P>The scheduler also manages a list of available printers on
22 the LAN and dispatches print jobs as needed using the
23 appropriate filters and backends.</P>
24
25 <H3>Configuration Files</H3>
26
27 <P>The configuration files consist of:</P>
28
29 <ul>
30
31 <LI>The HTTP server configuration file.</LI>
32
33 <LI>Printer and class definition files.</LI>
34
35 <LI>MIME type and conversion rule files.</LI>
36
37 <LI>PostScript Printer Description (PPD) files.</LI>
38
39 </ul>
40
41 <P>The HTTP server configuration file is purposely similar to
42 the Apache server configuration file and defines all of the
43 access control properties for the server.</P>
44
45 <P>The printer and class definition files list the available
46 printer queues and classes. Printer classes are collections of
47 printers. Jobs sent to a class are forwarded to the first
48 available printer in the class, round-robin fashion.</P>
49
50 <P>The MIME type files list the supported MIME types
51 (text/plain, application/postscript, etc.) and "magic' rules for
52 automatically detecting the format of a file. These are used by
53 the HTTP server to determine the <tt>Content-Type</tt> field for
54 <tt>GET</tt> and <tt>HEAD</tt> requests and by the IPP request
55 handler to determine the file type when a <tt>Print-Job</tt> or
56 <tt>Send-File</tt> request is received with a
57 <tt>document-format</tt> of
58 <tt>application/octet-stream</tt>.</P>
59
60 <P>The MIME conversion rule files list the available filters.
61 The filters are used when a job is dispatched so that an
62 application can send a convenient file format to the printing
63 system which then converts the document into a printable format
64 as needed. Each filter has a relative cost associated with it,
65 and the filtering algorithm chooses the set of filters that will
66 convert the file to the needed format with the lowest total
67 "cost".</P>
68
69 <P>The PPD files describe the capabilities of all printers, not
70 just PostScript printers. There is one PPD file for each
71 printer. PPD files for non-PostScript printers define additional
72 filters through <tt>cupsFilter</tt> attributes to support
73 printer drivers.</P>
74
75 <P ALIGN="CENTER"><IMG SRC="../images/cups-block-diagram.gif"
76 WIDTH="768" HEIGHT="768" ALT="CUPS Block Diagram"/><BR>
77 <I>Figure 1 - CUPS Block Diagram</I></P>
78
79 <H3>CUPS API</H3>
80
81 <P>The CUPS API contains CUPS-specific convenience functions for
82 queuing print jobs, getting printer information, accessing
83 resources via HTTP and IPP, and manipulating PPD files. Unlike
84 the rest of CUPS, the CUPS API is provided under the terms of
85 the GNU LGPL so it may be used by non-GPL applications.</P>
86
87 <H3>Berkeley and System V Commands</H3>
88
89 <P>CUPS provides the System V and Berkeley command-line
90 interfaces for submitting jobs and checking the printer status.
91 The <tt>lpstat</tt> and <tt>lpc status</tt> commands
92 also show network printers ("printer@server") when printer
93 browsing is enabled.</P>
94
95 <P>The System V administation commands are supplied for managing
96 printers and classes. The Berkeley printer administration tool
97 (<tt>lpc</tt>) is only supported in a "read-only' mode to
98 check the current status of the printer queues and
99 scheduler.</P>
100
101 <H3>Filters</H3>
102
103 <P>A filter program reads from the standard input or from a file
104 if a filename is supplied. All filters must support a common set
105 of options including printer name, job ID, username, job title,
106 number of copies, and job options. All output is sent to the
107 standard output.</P>
108
109 <P>Filters are provided for many file formats and include image
110 file and PostScript raster filters that support non-PostScript
111 printers. Multiple filters are run in parallel to produce the
112 required output format.</P>
113
114 <P>The PostScript raster filter is based on the ESP Ghostscript
115 core. Instead of using the Ghostscript printer drivers, the CUPS
116 filter uses a generic CUPS raster printer driver and
117 CUPS-compliant front-end to support any kind of raster printer.
118 This allows the same printer driver filter to be used for
119 printing raster data from any filter.</P>
120
121 <pre>Talk about Apple's use of CUPS...</pre>
122
123 <H3>CUPS Imaging</H3>
124
125 <P>The CUPS Imaging library provides functions for managing
126 large images, doing colorspace conversion and color management,
127 scaling images for printing, and managing raster page streams.
128 It is used by the CUPS image file filters, the PostScript RIP,
129 and all raster printers drivers.</P>
130
131 <H3>Backends</H3>
132
133 <P>A backend program is a special filter that sends print data
134 to a device or network connection. Backends for parallel,
135 serial, USB, LPD, IPP, and AppSocket (JetDirect) connections are
136 provided in CUPS 1.2.</P>
137
138 <P>SAMBA version 2.0.6 and higher includes a SMB backend
139 (<tt>smbspool(1)</tt>) that can be used for printing to
140 Windows.</P>
141
142 <H2 CLASS="title">Network Printing</H2>
143
144 <P>Traditionally, network printing has been one of the hardest
145 things to get working under UNIX. One reason is because each
146 vendor added their own extensions to the LPD protocol (the
147 previous standard for network printing), making cross-platform
148 printing difficult if not impossible.</P>
149
150 <P>Another reason is that you have to administer every network
151 printer on every client machine. In some cases you can "clone'
152 the printer configuration from a "master' client to each of the
153 others, but even that can be time-consuming and error-prone.
154 Something better is needed.</P>
155
156 <P>CUPS provides "printer browsing", which allows clients to
157 automatically see and use printers from any server on a LAN.
158 This means that you only need to configure the server and the
159 clients will automatically see the printers and classes on
160 it.</P>
161
162 <P>In addition, CUPS can automatically merge multiple identical
163 network printers into "implicit classes". This allows clients to
164 send jobs to the implicit class and have them print on the first
165 available printer or server. In addition, failsafe and
166 load-balancing functions are enabled simply by defining the same
167 printer on multiple servers!</P>
168
169 </BODY>
170 </HTML>