File: cups-doc.html

package info (click to toggle)
cupsomatic-ppd 0.20010420-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 26,696 kB
  • ctags: 5
  • sloc: perl: 449; makefile: 38
file content (276 lines) | stat: -rw-r--r-- 12,445 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276


<html>
<head>
<meta name="description" content="<!-- content: undefined tag: description -->">
<title>CUPS and the LinuxPrinting.org Database</title>
</head>
<body BGCOLOR="#FFFFFF">

 <table cellspacing=0 cellpadding=6 border=0 width="100%">
  <tr>
   <td align="center" BGCOLOR="#72D397">     <!-- upper left box -->
      <font size="+1">GNU/Linux<br>Printing</font>
   </td>

   <td BGCOLOR="#72D397" width="100%">     <!-- top bar -->
    <font size="+3">CUPS and the LinuxPrinting.org Database</font>
   </td>
  </tr>

  <tr>
   <td valign="top" 
       BGCOLOR="#72D397" height="100%">  <!-- left sidebar -->
    <font size="-1">
     <!-- menubar -->
       <A HREF="./">Home/News</A><br>
       &nbsp;&nbsp;<A HREF="./howto/">The&nbsp;HOWTO</A><br>
       &nbsp;&nbsp;&nbsp;&nbsp;<a href="howto/quickstart.html">QuickStart</a><br>
       &nbsp;&nbsp;&nbsp;&nbsp;<a href="howto/document-index.html">Index</a><br>
       &nbsp;&nbsp;&nbsp;&nbsp;<A HREF="./formats.html">Other&nbsp;Formats</A><br>
       &nbsp;&nbsp;<A HREF="./articles.html">Articles</A><br>
       &nbsp;&nbsp;<A HREF="./newsportal/">Forums</A><br>
       &nbsp;&nbsp;<A HREF="./suggested.html">Suggested&nbsp;Printers</A><br>
       &nbsp;&nbsp;<A HREF="./database.html">The&nbsp;Database</A><br>
       &nbsp;&nbsp;&nbsp;&nbsp;<A HREF="./printer_list.cgi">Printer&nbsp;Listings</A><br>
       &nbsp;&nbsp;&nbsp;&nbsp;<A HREF="./driver_list.cgi">Driver&nbsp;Listings</A><br>
       &nbsp;&nbsp;<A HREF="./foomatic.html">Foomatic</A><br>
       &nbsp;&nbsp;&nbsp;&nbsp;<A HREF="./lpd-doc.html">LPD&nbsp;Docs</A><br>
       &nbsp;&nbsp;&nbsp;&nbsp;<A HREF="./lprng-doc.html">LPRng&nbsp;Docs</A><br>
       &nbsp;&nbsp;&nbsp;&nbsp;<A HREF="./pdq-doc.html">PDQ&nbsp;Docs</A><br>
       &nbsp;&nbsp;&nbsp;&nbsp;<B>CUPS&nbsp;Docs</B><br>
       &nbsp;&nbsp;<A HREF="./vendors.html">Vendor&nbsp;Info</A><br>
       &nbsp;&nbsp;<A HREF="./projects.html">Projects</A><br>
       &nbsp;&nbsp;<A HREF="./manpages.html">Manual&nbsp;Pages</A><br>
       <br>
       <A HREF="./about.html">About&nbsp;this&nbsp;site</A><br>
       <A HREF="./contribute.html">Contributing</A><br>
       <br><a href="http://www.picante.com/~gtaylor/">Grant&nbsp;Taylor</a>
    </font>
   </td>

   <td valign="top" height="100%">       <!-- contents -->
    <!-- header/announcementy things go here -->
    <p>
I support CUPS through the CUPS-O-Matic PPD generator and
companion <tt><a href="cupsomatic">cupsomatic</a></tt> CUPS backend
filter.  What follows is quick-start information on setting up your
printer with this pair, followed by some details on how it all works.
<p>
Note that <tt>cupsd</tt> sometimes dies a horrible death when given
buggy PPD files; when this happens <tt>lpadmin</tt> and other CUPS
commands will 
hang.  I had to recompile and use a debugger to figure out what was
going on as I developed cupsomatic.  CUPS versions through 1.1b5 have
some bad security flaws to do with temporary files; caveat emptor.
That said, CUPS and XPP do in fact work, and together they form a very
nice system suitable for use in many environments.

<h3>Quick Start</h3>
<p>
This is mostly useless(tm) if you have a Postscript
printer; in that case go get a PPD from your printer's vendor.
<p>
This system is supposed(tm) to work with CUPS 1.0 or 1.1.  Check that
you have this installed; see the <a 
href="http://www.cups.org/">CUPS website</a> for details on that.
<ol>
 <li>You will need the driver that you wish to use installed
     (cupsomatic and the PPD file only provide a way to connect CUPS
     to your driver).  There are several styles of driver; the ones
     suitable for your printer will be referenced from your printer's
     page in <a href="database.html">the database</a>:
      <dl>
       <dt>Ghostscript
       <dd>Most Ghostscript drivers are included in typical
           distributions of Ghostscript, but some are not.  You can
           see the available Ghostscript drivers on your system with
	   `<tt>gs -h</tt>'.  If the driver you need is not listed;
	   you will need to obtain a new Ghostscript package with the
	   driver included, or compile Ghostscript yourself.  For
	   many third-party drivers, the driver authors distribute
	   special Ghostscript packages including the needed driver;
	   give that a shot first.
       <dt>Uniprint
       <dd>Some Ghostscript drivers are Uniprint drivers.  These
           consist simply of a upp file containing various parameters;
	   most are included with Ghostscript.  Others you will need
	   to obtain and place in your ghostscript library directory.
       <dt>Filter
       <dd>Some drivers are separate programs which run together with
	   Ghostscript.  You will need to obtain and install the
	   separate program, as well as Ghostscript.
      </dl>

 <li>You will need a PPD for the free software printer driver you wish
     to use.  Find the driver page for your printer driver from your
     printer's page in the database.  If there are `Execution
     Details', then the system has enough information to generate a
     PPD for you, and there should be a CUPS-O-Matic selector for you to
     select your printer from in the `Printing system interfaces'
     section of the page.  If there is not, then I simply haven't
     obtained (or entered) execution information about that driver;
     you're out of luck for now.

 <li>Save the PPD file as the name suggested by the comments in the
     file itself, in the directory <tt>/usr/share/cups/model</tt> (may
     be a different location for you, but it will be called
     something/model).  The PPD file does not have to be executable,
     but it should be world-readable.

 <li>You will need the <tt><a
     href="cupsomatic">cupsomatic</a></tt> Perl script installed.
     Save the cupsomatic script as the file 
     <tt>/var/lib/cups/filter/cupsomatic</tt>; the location may differ 
     on other installations (Red Hat appears to place this under
     <tt>/usr/lib/cups/filter/</tt>, for example).  Be sure to mark the
     script as 
     executable/readable with `<tt>chmod 755 cupsomatic</tt>', and be
     sure that your Perl interpreter is in /usr/bin (if not, edit the
     first line of the cupsomatic script).
     <p>
     There are a few other things you can set in the script; see the
     comments.  Mostly these seem apply to users of non-GNU systems.

 <li>You may want (or need!) to install the <tt><a
     href="gswrapper.html">foomatic-gswrapper</a></tt> companion
     script.

 <li>Execute as an appropriately empowered administrator (usually
     root, but perhaps you have approved other users as printer
     administrators) the proper setup command as found in the CUPS
     documentation.  Here are a few examples for the Epson Stylus 860
     Ghostscript driver defined in the database-generated file
     <tt><a
     href="cups-o-matic.cgi?driver=stp&printer=62112"
     >Epson-Stylus_Color_860-stp.ppd</a></tt>: 
     <dl>
       <dt><tt>lpadmin -p foo1 -m Epson-Stylus_Color_860-stp.ppd -v parallel:/dev/lp0 -E</tt>
       <dd>This defines a print queue named 'foo1' connected to /dev/lp0,
           and enable said queue.

       <dt><tt>lpadmin -p foo1 -m Epson-Stylus_Color_860-stp.ppd -v lpd://hostname/queuename</tt>
       <dd>This defines a print queue named 'foo1' connected over the
           network to the queue <tt>queuename</tt> offered by the  LPD
           service on host <tt>hostname</tt> without enabling said queue. 
     </dl>
</ol>

<h3>Printing with cupsomatic</h3>

To actually use this now that you've set it up, you use the CUPS
lp(1) command; given our example setup above,
<pre>
$ lp -d foo1 -o PageSize=Letter -o Dither=Fast /etc/motd
</pre>
Would use the <a href="show_driver.cgi?driver=stp">stp driver</a> to
print on letter paper with fast-mode dithering to your Epson Stylus
860.  See your driver's page on this site for details on the available
options.  There might also be some (PJL-based) options described on
your printer's page.  For many drivers, you'll want to use the
lpoptions(1) command 
(in CUPS 1.1; 1.0 users could mangle the PPD instead) to lock down a
set of sensible defaults for you.  This is especially true for drivers
like this Stylus one, which have large number of options.
<p>
To see the options available for your setup, send a print job with
only the option `<tt>docs</tt>', like this: `<tt>lp -d foo1 -o docs
/etc/hosts</tt>'.  This will make cupsomatic print out an option
summary (instead of the actual printjob; hence the file
/etc/hosts; no, it can't be /dev/null).

<p> Note that options with a user-provided integer or float value are
not supported by the PPD syntax.  With cupsomatic-based printers, you
may specify these options on the command line, and CUPS will just sort
of pass them along.  <a
href="http://cups.sourceforge.net/xpp">XPP</a> provides
explicit support for cupsomatic PPD files to eliminate this problem.
Other GUI tools, however, only handle normal PPD files, and thus won't
show these options.

<p> Usually, you can also use the <tt>media=...</tt>,
<tt>sides=...</tt>, and <tt>duplex</tt> "standard" CUPS options as
documented in the CUPS user manual; they should work if there are
InputSlot, MediaType, and/or Duplex options for your driver.

<p>
For more information on using CUPS and defining print queues, consult the <a
href="http://www.cups.org/documentation.html">CUPS documentation</a>.

<p>
If it doesn't work, turn on the debug flag at the top of cupsomatic,
and examine the debugging output in the file <tt>/tmp/prnlog</tt>.
And feel free to contact me for help.

<h3>How does it work?</h3>

<p>
There are three parts to the cups-o-matic scheme:

<dl>
 <dt>The Database
 <dd>The database contains a number of tables which detail exactly how
     to execute a given printer driver.  There are several front-ends
     which use these tables: the human-readable one generates the
     information shown on various driver pages, the one which generates a
     PDQ driver declaration, and the one you care about, which
     computes a PPD file.  (This is a Perl program called
     cups-o-matic.cgi).

 <dt>The PPD
 <dd>The PPD file generated by the database contains two things.  It
     contains the normal option declarations you'd expect in a PPD,
     for the various options known to the database.  It also contains
     a Perl Data::Dumper encapsulation (in a structured comment) of
     the entire set of data about the free software driver being used.

 <dt>The backend filter
 <dd>The CUPS filter script `<tt>cupsomatic</tt>' is called by CUPS
     with various inputs, including both the PPD filename and the
     various options selected by the user.  Cupsomatic opens the PPD,
     extracts the encapsulated execution data found there, and
     combines it with the user-provided option values to this to
     compute the proper command to execute for filtering.  It also
     massages the standard CUPS option types into the more generic
     printer/driver-specific format used by the database.
</dl>

<p>
CUPS completely supports normal PPD option types, which include
boolean values and enumerated choices.  PPDs do not support arbitrary
user-inputted numerical arguments, so the cupsomatic doesn't currently
do anything much with these.  AFAIK, there's nothing stopping the user
from explicity saying `<tt>-o Gamma=4.3</tt>' on the command line and
having it work, but GUI tools are based on the PPD-defined options, so
these arguments won't appear there.  I might pre-select a range of
legal values and treat floats and ints as enumerated types.  Someone
make a suggestion.
<p>
I added a bunch of special code to pick out the media= and sides=
options.  These now map sensibly to the PageSize, MediaType, and
InputSlot enumerated selections, plus the boolean Duplex argument, if
present.  It's all a bit ugly if a driver supports an option that
happens to be named the same as an existing standard ipp/cups option.
Oh, well.
<p>
You can obtain a <a href="all-com-ppds.tar.gz">tarball</a> of
<em>all</em> CUPS-O-Matic PPD files plus the filter.
   </td>
  </tr>

  <tr>
   <td BGCOLOR="#72D397">       <!-- bottom corner -->
    &nbsp;
   </td>

   <td BGCOLOR="#72D397" width="100%">       <!-- bottom bar -->
    <font size="-1">
     Built with <a href="http://www.freddyfrog.com/hacks/genpage/">Genpage</a> - Version: 1.0.4
    </font>
   </td>    
  </tr>

 </table>
</body>
</html>