1 <html><head><meta http-equiv=
"Content-Type" content=
"text/html; charset=ISO-8859-1"><title>Chapter
19. CUPS Printing Support in Samba
3.0</title><link rel=
"stylesheet" href=
"samba.css" type=
"text/css"><meta name=
"generator" content=
"DocBook XSL Stylesheets V1.60.1"><link rel=
"home" href=
"index.html" title=
"SAMBA Project Documentation"><link rel=
"up" href=
"optional.html" title=
"Part III. Advanced Configuration"><link rel=
"previous" href=
"printing.html" title=
"Chapter 18. Classical Printing Support"><link rel=
"next" href=
"VFS.html" title=
"Chapter 20. Stackable VFS modules"></head><body bgcolor=
"white" text=
"black" link=
"#0000FF" vlink=
"#840084" alink=
"#0000FF"><div class=
"navheader"><table width=
"100%" summary=
"Navigation header"><tr><th colspan=
"3" align=
"center">Chapter
19. CUPS Printing Support in Samba
3.0</th></tr><tr><td width=
"20%" align=
"left"><a accesskey=
"p" href=
"printing.html">Prev
</a> </td><th width=
"60%" align=
"center">Part III. Advanced Configuration
</th><td width=
"20%" align=
"right"> <a accesskey=
"n" href=
"VFS.html">Next
</a></td></tr></table><hr></div><div class=
"chapter" lang=
"en"><div class=
"titlepage"><div><div><h2 class=
"title"><a name=
"CUPS-printing"></a>Chapter
19. CUPS Printing Support in Samba
3.0</h2></div><div><div class=
"author"><h3 class=
"author"><span class=
"firstname">Kurt
</span> <span class=
"surname">Pfeifle
</span></h3><div class=
"affiliation"><span class=
"orgname"> Danka Deutschland GmbH
<br></span><div class=
"address"><p><tt class=
"email"><<a href=
"mailto:kpfeifle@danka.de">kpfeifle@danka.de
</a>></tt></p></div></div></div></div><div><div class=
"author"><h3 class=
"author"><span class=
"firstname">Ciprian
</span> <span class=
"surname">Vizitiu
</span></h3><span class=
"contrib">drawings
</span><div class=
"affiliation"><div class=
"address"><p><tt class=
"email"><<a href=
"mailto:CVizitiu@gbif.org">CVizitiu@gbif.org
</a>></tt></p></div></div></div></div><div><p class=
"pubdate"> (
3 June
2003)
</p></div></div><div></div></div><div class=
"toc"><p><b>Table of Contents
</b></p><dl><dt><a href=
"CUPS-printing.html#id2953785">Introduction
</a></dt><dd><dl><dt><a href=
"CUPS-printing.html#id2953792">Features and Benefits
</a></dt><dt><a href=
"CUPS-printing.html#id2953845">Overview
</a></dt></dl></dd><dt><a href=
"CUPS-printing.html#id2953900">Basic Configuration of CUPS support
</a></dt><dd><dl><dt><a href=
"CUPS-printing.html#id2953979">Linking of smbd with libcups.so
</a></dt><dt><a href=
"CUPS-printing.html#id2954122">Simple smb.conf Settings for CUPS
</a></dt><dt><a href=
"CUPS-printing.html#id2954205">More complex smb.conf Settings for
2 CUPS
</a></dt></dl></dd><dt><a href=
"CUPS-printing.html#id2954322">Advanced Configuration
</a></dt><dd><dl><dt><a href=
"CUPS-printing.html#id2954343">Central spooling vs.
"Peer-to-Peer
" printing
</a></dt><dt><a href=
"CUPS-printing.html#id2954370">CUPS/Samba as a
"spooling-only
" Print Server;
"raw
" printing
3 with Vendor Drivers on Windows Clients
</a></dt><dt><a href=
"CUPS-printing.html#id2954406">Driver Installation Methods on Windows Clients
</a></dt><dt><a href=
"CUPS-printing.html#id2954465">Explicitly enable
"raw
" printing for
4 application/octet-stream!
</a></dt><dt><a href=
"CUPS-printing.html#id2954626">Three familiar Methods for driver upload plus a new one
</a></dt></dl></dd><dt><a href=
"CUPS-printing.html#id2954719">Using CUPS/Samba in an advanced Way -- intelligent printing
5 with PostScript Driver Download
</a></dt><dd><dl><dt><a href=
"CUPS-printing.html#id2954794">GDI on Windows -- PostScript on Unix
</a></dt><dt><a href=
"CUPS-printing.html#id2954839">Windows Drivers, GDI and EMF
</a></dt><dt><a href=
"CUPS-printing.html#id2954940">Unix Printfile Conversion and GUI Basics
</a></dt><dt><a href=
"CUPS-printing.html#id2955028">PostScript and Ghostscript
</a></dt><dt><a href=
"CUPS-printing.html#id2955125">Ghostscript -- the Software RIP for non-PostScript Printers
</a></dt><dt><a href=
"CUPS-printing.html#id2955238">PostScript Printer Description (PPD) Specification
</a></dt><dt><a href=
"CUPS-printing.html#id2955308">CUPS can use all Windows-formatted Vendor PPDs
</a></dt><dt><a href=
"CUPS-printing.html#id2955397">CUPS also uses PPDs for non-PostScript Printers
</a></dt></dl></dd><dt><a href=
"CUPS-printing.html#id2955420">The CUPS Filtering Architecture
</a></dt><dd><dl><dt><a href=
"CUPS-printing.html#id2955560">MIME types and CUPS Filters
</a></dt><dt><a href=
"CUPS-printing.html#id2955747">MIME type Conversion Rules
</a></dt><dt><a href=
"CUPS-printing.html#id2955864">Filter Requirements
</a></dt><dt><a href=
"CUPS-printing.html#id2956034">Prefilters
</a></dt><dt><a href=
"CUPS-printing.html#id2956120">pstops
</a></dt><dt><a href=
"CUPS-printing.html#id2956222">pstoraster
</a></dt><dt><a href=
"CUPS-printing.html#id2956377">imagetops and imagetoraster
</a></dt><dt><a href=
"CUPS-printing.html#id2956434">rasterto [printers specific]
</a></dt><dt><a href=
"CUPS-printing.html#id2956519">CUPS Backends
</a></dt><dt><a href=
"CUPS-printing.html#id2956831">cupsomatic/Foomatic -- how do they fit into the Picture?
</a></dt><dt><a href=
"CUPS-printing.html#id2956944">The Complete Picture
</a></dt><dt><a href=
"CUPS-printing.html#id2956960">mime.convs
</a></dt><dt><a href=
"CUPS-printing.html#id2957012">"Raw
" printing
</a></dt><dt><a href=
"CUPS-printing.html#id2957066">"application/octet-stream
" printing
</a></dt><dt><a href=
"CUPS-printing.html#id2957282">PostScript Printer Descriptions (PPDs) for non-PS Printers
</a></dt><dt><a href=
"CUPS-printing.html#id2957510">Difference between cupsomatic/foomatic-rip and
6 native CUPS printing
</a></dt><dt><a href=
"CUPS-printing.html#id2957666">Examples for filtering Chains
</a></dt><dt><a href=
"CUPS-printing.html#id2957897">Sources of CUPS drivers / PPDs
</a></dt><dt><a href=
"CUPS-printing.html#id2958024">Printing with Interface Scripts
</a></dt></dl></dd><dt><a href=
"CUPS-printing.html#id2958100">Network printing (purely Windows)
</a></dt><dd><dl><dt><a href=
"CUPS-printing.html#id2958116">From Windows Clients to an NT Print Server
</a></dt><dt><a href=
"CUPS-printing.html#id2958155">Driver Execution on the Client
</a></dt><dt><a href=
"CUPS-printing.html#id2958227">Driver Execution on the Server
</a></dt></dl></dd><dt><a href=
"CUPS-printing.html#id2958289">Network Printing (Windows clients -- UNIX/Samba Print
7 Servers)
</a></dt><dd><dl><dt><a href=
"CUPS-printing.html#id2958310">From Windows Clients to a CUPS/Samba Print Server
</a></dt><dt><a href=
"CUPS-printing.html#id2958474">Samba receiving Jobfiles and passing them to CUPS
</a></dt></dl></dd><dt><a href=
"CUPS-printing.html#id2958550">Network PostScript RIP: CUPS Filters on Server -- clients use
8 PostScript Driver with CUPS-PPDs
</a></dt><dd><dl><dt><a href=
"CUPS-printing.html#id2958605">PPDs for non-PS Printers on UNIX
</a></dt><dt><a href=
"CUPS-printing.html#id2958646">PPDs for non-PS Printers on Windows
</a></dt></dl></dd><dt><a href=
"CUPS-printing.html#id2958712">Windows Terminal Servers (WTS) as CUPS Clients
</a></dt><dd><dl><dt><a href=
"CUPS-printing.html#id2958729">Printer Drivers running in
"Kernel Mode
" cause many
9 Problems
</a></dt><dt><a href=
"CUPS-printing.html#id2958763">Workarounds impose Heavy Limitations
</a></dt><dt><a href=
"CUPS-printing.html#id2958784">CUPS: a
"Magical Stone
"?
</a></dt><dt><a href=
"CUPS-printing.html#id2958811">PostScript Drivers with no major problems -- even in Kernel
10 Mode
</a></dt></dl></dd><dt><a href=
"CUPS-printing.html#id2958865"> Setting up CUPS for driver Download
</a></dt><dd><dl><dt><a href=
"CUPS-printing.html#id2958884">cupsaddsmb: the unknown Utility
</a></dt><dt><a href=
"CUPS-printing.html#id2958976">Prepare your smb.conf for
11 cupsaddsmb
</a></dt><dt><a href=
"CUPS-printing.html#id2959022">CUPS Package of
"PostScript Driver for WinNT/
2k/XP
"</a></dt><dt><a href=
"CUPS-printing.html#id2959220">Recognize the different Driver Files
</a></dt><dt><a href=
"CUPS-printing.html#id2959278">Acquiring the Adobe Driver Files
</a></dt><dt><a href=
"CUPS-printing.html#id2959310">ESP Print Pro Package of
"PostScript Driver for
12 WinNT/
2k/XP
"</a></dt><dt><a href=
"CUPS-printing.html#id2959360">Caveats to be considered
</a></dt><dt><a href=
"CUPS-printing.html#id2959582">What are the Benefits of using the
"CUPS PostScript Driver for
13 Windows NT/
2k/XP
" as compared to the Adobe Driver?
</a></dt><dt><a href=
"CUPS-printing.html#id2959764">Run
"cupsaddsmb
" (quiet Mode)
</a></dt><dt><a href=
"CUPS-printing.html#id2959865">Run
"cupsaddsmb
" with verbose Output
</a></dt><dt><a href=
"CUPS-printing.html#id2960092">Understanding cupsaddsmb
</a></dt><dt><a href=
"CUPS-printing.html#id2960186">How to recognize if cupsaddsm completed successfully
</a></dt><dt><a href=
"CUPS-printing.html#id2960273">cupsaddsmb with a Samba PDC
</a></dt><dt><a href=
"CUPS-printing.html#id2960308">cupsaddsmb Flowchart
</a></dt><dt><a href=
"CUPS-printing.html#id2960361">Installing the PostScript Driver on a Client
</a></dt><dt><a href=
"CUPS-printing.html#id2960474">Avoiding critical PostScript Driver Settings on the
14 Client
</a></dt></dl></dd><dt><a href=
"CUPS-printing.html#id2960608">Installing PostScript Driver Files manually (using
15 rpcclient)
</a></dt><dd><dl><dt><a href=
"CUPS-printing.html#id2960723">A Check of the rpcclient man Page
</a></dt><dt><a href=
"CUPS-printing.html#id2960836">Understanding the rpcclient man Page
</a></dt><dt><a href=
"CUPS-printing.html#id2960925">Producing an Example by querying a Windows Box
</a></dt><dt><a href=
"CUPS-printing.html#id2961015">What is required for adddriver and setdriver to succeed
</a></dt><dt><a href=
"CUPS-printing.html#id2961177">Manual Commandline Driver Installation in
15 little Steps
</a></dt><dt><a href=
"CUPS-printing.html#id2961830">Troubleshooting revisited
</a></dt></dl></dd><dt><a href=
"CUPS-printing.html#id2961930">The printing *.tdb Files
</a></dt><dd><dl><dt><a href=
"CUPS-printing.html#id2962033">Trivial DataBase Files
</a></dt><dt><a href=
"CUPS-printing.html#id2962103">Binary Format
</a></dt><dt><a href=
"CUPS-printing.html#id2962165">Losing *.tdb Files
</a></dt><dt><a href=
"CUPS-printing.html#id2962224">Using tdbbackup
</a></dt></dl></dd><dt><a href=
"CUPS-printing.html#id2962290">CUPS Print Drivers from Linuxprinting.org
</a></dt><dd><dl><dt><a href=
"CUPS-printing.html#id2962398">foomatic-rip and Foomatic explained
</a></dt><dt><a href=
"CUPS-printing.html#id2963027">foomatic-rip and Foomatic-PPD Download and Installation
</a></dt></dl></dd><dt><a href=
"CUPS-printing.html#id2963488">Page Accounting with CUPS
</a></dt><dd><dl><dt><a href=
"CUPS-printing.html#id2963519">Setting up Quotas
</a></dt><dt><a href=
"CUPS-printing.html#id2963551">Correct and incorrect Accounting
</a></dt><dt><a href=
"CUPS-printing.html#id2963592">Adobe and CUPS PostScript Drivers for Windows Clients
</a></dt><dt><a href=
"CUPS-printing.html#id2963663">The page_log File Syntax
</a></dt><dt><a href=
"CUPS-printing.html#id2963765">Possible Shortcomings
</a></dt><dt><a href=
"CUPS-printing.html#id2963836">Future Developments
</a></dt><dt><a href=
"CUPS-printing.html#id2963884">Other Accounting Tools
</a></dt></dl></dd><dt><a href=
"CUPS-printing.html#id2963899">Additional Material
</a></dt><dt><a href=
"CUPS-printing.html#id2964092">Auto-Deletion or Preservation of CUPS Spool Files
</a></dt><dd><dl><dt><a href=
"CUPS-printing.html#id2964138">CUPS Configuration Settings explained
</a></dt><dt><a href=
"CUPS-printing.html#id2964221">Pre-conditions
</a></dt><dt><a href=
"CUPS-printing.html#id2964281">Manual Configuration
</a></dt></dl></dd><dt><a href=
"CUPS-printing.html#id2964299">When not to use Samba to print to
16 CUPS
</a></dt><dt><a href=
"CUPS-printing.html#id2964316">In Case of Trouble.....
</a></dt><dd><dl><dt><a href=
"CUPS-printing.html#id2964352">Where to find Documentation
</a></dt><dt><a href=
"CUPS-printing.html#id2964364">How to ask for Help
</a></dt><dt><a href=
"CUPS-printing.html#id2964377">Where to find Help
</a></dt></dl></dd><dt><a href=
"CUPS-printing.html#id2964391">Appendix
</a></dt><dd><dl><dt><a href=
"CUPS-printing.html#id2964398">Printing from CUPS to Windows attached
17 Printers
</a></dt><dt><a href=
"CUPS-printing.html#id2964612">More CUPS filtering Chains
</a></dt><dt><a href=
"CUPS-printing.html#id2964919">Trouble Shooting Guidelines to fix typical Samba printing
18 Problems
</a></dt><dt><a href=
"CUPS-printing.html#id2966041">An Overview of the CUPS Printing Processes
</a></dt></dl></dd></dl></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><div><h2 class=
"title" style=
"clear: both"><a name=
"id2953785"></a>Introduction
</h2></div></div><div></div></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2953792"></a>Features and Benefits
</h3></div></div><div></div></div><p>
19 The Common Unix Print System (
<a href=
"http://www.cups.org/" target=
"_top">CUPS
</a>) has become very popular. All
20 big Linux distributions now ship it as their default printing
21 system. But to many it is still a very mystical tool. Normally it
22 "just works
" (TM). People tend to regard it as a sort of
"black box
",
23 which they don't want to look into, as long as it works OK. But once
24 there is a little problem, they are in trouble to find out where to
25 start debugging it. Also, even the most recent and otherwise excellent
26 printed Samba documentation has only limited attention paid to CUPS
27 printing, leaving out important pieces or even writing plain wrong
28 things about it. This demands rectification. But before you dive into
29 this chapter, make sure that you don't forget to refer to the
30 "Classical Printing
" chapter also. It contains a lot of information
31 that is relevant for CUPS too.
33 CUPS sports quite a few unique and powerful features. While their
34 basic functions may be grasped quite easily, they are also
35 new. Because they are different from other, more traditional printing
36 systems, it is best to try and not apply any prior knowledge about
37 printing upon this new system. Rather try to start understand CUPS
38 from the beginning. This documentation will lead you here to a
39 complete understanding of CUPS, if you study all of the material
40 contained. But lets start with the most basic things first. Maybe this
41 is all you need for now. Then you can skip most of the other
43 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2953845"></a>Overview
</h3></div></div><div></div></div><p>
44 CUPS is more than just a print spooling system. It is a complete
45 printer management system that complies with the new IPP
46 (
<span class=
"emphasis"><em>Internet Printing Protocol
</em></span>). IPP is an industry
47 and IETF (
<span class=
"emphasis"><em>Internet Engineering Task Force
</em></span>)
48 standard for network printing. Many of its functions can be managed
49 remotely (or locally) via a web browser (giving you a
50 platform-independent access to the CUPS print server). In addition it
51 has the traditional commandline and several more modern GUI interfaces
52 (GUI interfaces developed by
3rd parties, like KDE's
53 overwhelming
<a href=
"http://printing.kde.org/" target=
"_top">KDEPrint
</a>).
55 CUPS allows creation of
"raw
" printers (ie: NO print file
56 format translation) as well as
"smart
" printers (i.e. CUPS does
57 file format conversion as required for the printer). In many ways
58 this gives CUPS similar capabilities to the MS Windows print
59 monitoring system. Of course, if you are a CUPS advocate, you would
60 argue that CUPS is better! In any case, let us now move on to
61 explore how one may configure CUPS for interfacing with MS Windows
62 print clients via Samba.
63 </p></div></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><div><h2 class=
"title" style=
"clear: both"><a name=
"id2953900"></a>Basic Configuration of CUPS support
</h2></div></div><div></div></div><p>
64 Printing with CUPS in the most basic
<tt class=
"filename">smb.conf
</tt>
65 setup in Samba
3.0 (as was true for
2.2.x) only needs two
66 settings:
<i class=
"parameter"><tt>printing = cups
</tt></i> and
<i class=
"parameter"><tt>printcap
67 = cups
</tt></i>. CUPS itself doesn't need a printcap file
68 anymore. However, the
<tt class=
"filename">cupsd.conf
</tt> configuration
69 file knows two related directives: they control if such a file should
70 be automatically created and maintained by CUPS for the convenience of
71 third party applications (example:
<i class=
"parameter"><tt>Printcap
72 /etc/printcap
</tt></i> and
<i class=
"parameter"><tt>PrintcapFormat
73 BSD
</tt></i>). These legacy programs often require the existence of
74 printcap file containing printernames or they will refuse to
75 print. Make sure CUPS is set to generate and maintain a printcap! For
76 details see
<b class=
"command">man cupsd.conf
</b> and other CUPS-related
77 documentation, like the wealth of documents on your CUPS server
78 itself:
<a href=
"http://localhost:631/documentation.html" target=
"_top">http://localhost:
631/documentation.html
</a>.
79 </p><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2953979"></a>Linking of smbd with libcups.so
</h3></div></div><div></div></div><p>
80 Samba has a very special relationship to CUPS. The reason is: Samba
81 can be compiled with CUPS library support. Most recent installations
82 have this support enabled, and per default CUPS linking is compiled
83 into smbd and other Samba binaries. Of course, you can use CUPS even
84 if Samba is not linked against
<tt class=
"filename">libcups.so
</tt> -- but
85 there are some differences in required or supported configuration
88 If SAMBA is compiled against libcups, then
<i class=
"parameter"><tt>printcap =
89 cups
</tt></i> uses the CUPS API to list printers, submit jobs,
90 query queues, etc. Otherwise it maps to the System V commands with an
91 additional
<b class=
"command">-oraw
</b> option for printing. On a Linux
92 system, you can use the
<b class=
"command">ldd
</b> utility to find out
93 details (ldd may not be present on other OS platforms, or its function
94 may be embodied by a different command):
95 </p><pre class=
"screen">
96 transmeta:/home/kurt # ldd `which smbd`
97 libssl.so
.0.9.6 =
> /usr/lib/libssl.so
.0.9.6 (
0x4002d000)
98 libcrypto.so
.0.9.6 =
> /usr/lib/libcrypto.so
.0.9.6 (
0x4005a000)
99 libcups.so
.2 =
> /usr/lib/libcups.so
.2 (
0x40123000)
102 The line
<tt class=
"computeroutput">libcups.so
.2 =
> /usr/lib/libcups.so
.2
103 (
0x40123000)
</tt> shows there is CUPS support compiled
104 into this version of Samba. If this is the case, and printing = cups
105 is set, then
<span class=
"emphasis"><em>any otherwise manually set print command in
106 <tt class=
"filename">smb.conf
</tt> is ignored
</em></span>. This is an
107 important point to remember!
108 </p><div class=
"tip" style=
"margin-left: 0.5in; margin-right: 0.5in;"><h3 class=
"title">Tip
</h3><p> Should you require -- for any reason -- to set your own
109 print commands, you can still do this by setting
<i class=
"parameter"><tt>printing =
110 sysv
</tt></i>. However, you'll loose all the benefits from the
111 close CUPS/Samba integration. You are on your own then to manually
112 configure the rest of the printing system commands (most important:
113 <i class=
"parameter"><tt>print command
</tt></i>; other commands are
114 <i class=
"parameter"><tt>lppause command, lpresume command, lpq command, lprm
115 command, queuepause command
</tt></i> and
<i class=
"parameter"><tt>queue resume
116 command
</tt></i>).
</p></div></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2954122"></a>Simple
<tt class=
"filename">smb.conf
</tt> Settings for CUPS
</h3></div></div><div></div></div><p>
117 To summarize, here is the simplest printing-related setup
118 for
<tt class=
"filename">smb.conf
</tt> to enable basic CUPS support:
119 </p><pre class=
"screen">
127 comment = All Printers
128 path = /var/spool/samba
134 printer admin = root, @ntadmins
137 This is all you need for basic printing setup for CUPS. It will print
138 all Graphic, Text, PDF and PostScript file submitted from Windows
139 clients. However, most of your Windows users would not know how to
140 send these kind of files to print without opening a GUI
141 application. Windows clients tend to have local printer drivers
142 installed. And the GUI application's print buttons start a printer
143 driver. Your users also very rarely send files from the command
144 line. Unlike UNIX clients, they hardly submit graphic, text or PDF
145 formatted files directly to the spooler. They nearly exclusively print
146 from GUI applications, with a
"printer driver
" hooked in between the
147 applications native format and the print data stream. If the backend
148 printer is not a PostScript device, the print data stream is
"binary
",
149 sensible only for the target printer. Read on to learn which problem
150 this may cause and how to avoid it.
151 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2954205"></a>More complex
<tt class=
"filename">smb.conf
</tt> Settings for
152 CUPS
</h3></div></div><div></div></div><p>
153 Here is a slightly more complex printing-related setup
154 for
<tt class=
"filename">smb.conf
</tt>. It enables general CUPS printing
155 support for all printers, but defines one printer share which is set
157 </p><pre class=
"screen">
165 comment = All Printers
166 path = /var/spool/samba
171 printer admin = root, @ntadmins
174 comment = A special printer with his own settings
175 path = /var/spool/samba-special
178 print command = echo
"NEW: `date`: printfile %f
" >> /tmp/smbprn.log ;\
179 echo
" `date`: p-%p s-%s f-%f
" >> /tmp/smbprn.log ;\
180 echo
" `date`: j-%j J-%J z-%z c-%c
" >> /tmp/smbprn.log :\
188 hosts allow = turbo_xp,
10.160.50.23,
10.160.51.60
191 This special share is only there for my testing purposes. It doesn't
192 even write the print job to a file. It just logs the job parameters
193 known to Samba into the
<tt class=
"filename">/tmp/smbprn.log
</tt> file and
194 deletes the jobfile. Moreover, the
<i class=
"parameter"><tt>printer
195 admin
</tt></i> of this share is
"kurt
" (not the
"@ntadmins
" group);
196 guest access is not allowed; the share isn't announced in Network
197 Neighbourhood (so you need to know it is there), and it is only
198 allowing access from three hosts. To prevent CUPS kicking in and
199 taking over the print jobs for that share, we need to set
200 <i class=
"parameter"><tt>printing = sysv
</tt></i> and
<i class=
"parameter"><tt>printcap =
202 </p></div></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><div><h2 class=
"title" style=
"clear: both"><a name=
"id2954322"></a>Advanced Configuration
</h2></div></div><div></div></div><p>
203 Before we dive into all the configuration options, let's clarify a few
204 points.
<span class=
"emphasis"><em>Network printing needs to be organized and setup
205 correctly
</em></span>. Often this is not done correctly. Legacy systems
206 or small LANs in business environments often lack a clear design and
208 </p><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2954343"></a>Central spooling vs.
"Peer-to-Peer
" printing
</h3></div></div><div></div></div><p>
209 Many small office or home networks, as well as badly organized larger
210 environments, allow each client a direct access to available network
211 printers. Generally, this is a bad idea. It often blocks one client's
212 access to the printer when another client's job is printing. It also
213 might freeze the first client's application while it is waiting to get
214 rid of the job. Also, there are frequent complaints about various jobs
215 being printed with their pages mixed with each other. A better concept
216 is the usage of a
"print server
": it routes all jobs through one
217 central system, which responds immediately, takes jobs from multiple
218 concurrent clients at the same time and in turn transfers them to the
219 printer(s) in the correct order.
220 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2954370"></a>CUPS/Samba as a
"spooling-only
" Print Server;
"raw
" printing
221 with Vendor Drivers on Windows Clients
</h3></div></div><div></div></div><p>
222 Most traditionally configured Unix print servers acting on behalf of
223 Samba's Windows clients represented a really simple setup. Their only
224 task was to manage the
"raw
" spooling of all jobs handed to them by
225 Samba. This approach meant that the Windows clients were expected to
226 prepare the print job file in such a way that it became fit to be fed to
227 the printing device. Here a native (vendor-supplied) Windows printer
228 driver for the target device needed to be installed on each and every
231 Of course you can setup CUPS, Samba and your Windows clients in the
232 same, traditional and simple way. When CUPS printers are configured
233 for RAW print-through mode operation it is the responsibility of the
234 Samba client to fully render the print job (file). The file must be
235 sent in a format that is suitable for direct delivery to the
236 printer. Clients need to run the vendor-provided drivers to do
237 this. In this case CUPS will NOT do any print file format conversion
239 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2954406"></a>Driver Installation Methods on Windows Clients
</h3></div></div><div></div></div><p>
240 The printer drivers on the Windows clients may be installed
241 in two functionally different ways:
242 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p>manually install the drivers locally on each client,
243 one by one; this yields the old
<span class=
"emphasis"><em>LanMan
</em></span> style
244 printing; it uses a
<tt class=
"filename">\\sambaserver\printershare
</tt>
245 type of connection.
</p></li><li><p>deposit and prepare the drivers (for later download) on
246 the print server (Samba); this enables the clients to use
247 "Point'n'Print
" to get drivers semi-automatically installed the
248 first time they access the printer; with this method NT/
2K/XP
249 clients use the
<span class=
"emphasis"><em>SPOOLSS/MS-RPC
</em></span>
250 type printing calls.
</p></li></ul></div><p>
251 The second method is recommended for use over the first.
252 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2954465"></a>Explicitly enable
"raw
" printing for
253 <span class=
"emphasis"><em>application/octet-stream
</em></span>!
</h3></div></div><div></div></div><p>
254 If you use the first option (drivers are installed on the client
255 side), there is one setting to take care of: CUPS needs to be told
256 that it should allow
"raw
" printing of deliberate (binary) file
257 formats. The CUPS files that need to be correctly set for RAW mode
258 printers to work are:
259 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p>/etc/cups/mime.types
260 </p></li><li><p>/etc/cups/mime.convs
</p></li></ul></div><p>
261 Both contain entries (at the end of the respective files) which must
262 be uncommented to allow RAW mode operation.
263 In
<tt class=
"filename">/etc/cups/mime.types
</tt> make sure this line is
265 </p><pre class=
"screen">
267 application/octet-stream
270 In
<tt class=
"filename">/etc/cups/mime.convs
</tt>,
272 </p><pre class=
"screen">
274 application/octet-stream application/vnd.cups-raw
0 -
277 If these two files are not set up correctly for raw Windows client
278 printing, you may encounter the dreaded
<tt class=
"computeroutput">Unable to
279 convert file
0</tt> in your CUPS error_log file.
280 </p><div class=
"note" style=
"margin-left: 0.5in; margin-right: 0.5in;"><h3 class=
"title">Note
</h3><p>editing the
<tt class=
"filename">mime.convs
</tt> and the
281 <tt class=
"filename">mime.types
</tt> file does not
282 <span class=
"emphasis"><em>enforce
</em></span> "raw
" printing, it only
283 <span class=
"emphasis"><em>allows
</em></span> it.
284 </p></div><p><b>Background.
</b>
285 CUPS being a more security-aware printing system than traditional ones
286 does not by default allow a user to send deliberate (possibly binary)
287 data to printing devices. This could be easily abused to launch a
288 "Denial of Service
" attack on your printer(s), causing at the least
289 the loss of a lot of paper and ink.
"Unknown
" data are tagged by CUPS
290 as
<span class=
"emphasis"><em>MIME type: application/octet-stream
</em></span> and not
291 allowed to go to the printer. By default, you can only send other
292 (known) MIME types
"raw
". Sending data
"raw
" means that CUPS does not
293 try to convert them and passes them to the printer untouched (see next
294 chapter for even more background explanations).
296 This is all you need to know to get the CUPS/Samba combo printing
297 "raw
" files prepared by Windows clients, which have vendor drivers
298 locally installed. If you are not interested in background information about
299 more advanced CUPS/Samba printing, simply skip the remaining sections
301 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2954626"></a>Three familiar Methods for driver upload plus a new one
</h3></div></div><div></div></div><p>
302 If you want to use the MS-RPC type printing, you must upload the
303 drivers onto the Samba server first (
<i class=
"parameter"><tt>[print$]
</tt></i>
304 share). For a discussion on how to deposit printer drivers on the
305 Samba host (so that the Windows clients can download and use them via
306 "Point'n'Print
") please also refer to the previous chapter of this
307 HOWTO Collection. There you will find a description or reference to
308 three methods of preparing the client drivers on the Samba server:
309 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p>the GUI,
"Add Printer Wizard
"
310 <span class=
"emphasis"><em>upload-from-a-Windows-client
</em></span>
311 method;
</p></li><li><p>the commandline,
"smbclient/rpcclient
"
312 <span class=
"emphasis"><em>upload-from-a-UNIX-workstation
</em></span>
313 method;
</p></li><li><p>the
<span class=
"emphasis"><em>Imprints
</em></span> Toolset
314 method.
</p></li></ul></div><p>
315 These
3 methods apply to CUPS all the same. A new and more
316 convenient way to load the Windows drivers into Samba is provided
317 provided if you use CUPS:
318 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p>the
<span class=
"emphasis"><em>cupsaddsmb
</em></span>
319 utility.
</p></li></ul></div><p>
320 cupsaddsmb is discussed in much detail further below. But we will
321 first explore the CUPS filtering system and compare the Windows and
322 UNIX printing architectures.
323 </p></div></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><div><h2 class=
"title" style=
"clear: both"><a name=
"id2954719"></a>Using CUPS/Samba in an advanced Way -- intelligent printing
324 with PostScript Driver Download
</h2></div></div><div></div></div><p>
325 Still reading on? Good. Let's go into more detail then. We now know
326 how to set up a
"dump
" printserver, that is, a server which is spooling
327 printjobs
"raw
", leaving the print data untouched.
329 Possibly you need to setup CUPS in a more smart way. The reasons could
331 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p>Maybe your boss wants to get monthly statistics: Which
332 printer did how many pages? What was the average data size of a job?
333 What was the average print run per day? What are the typical hourly
334 peaks in printing? Which departments prints how
335 much?
</p></li><li><p>Maybe you are asked to setup a print quota system:
336 users should not be able to print more jobs, once they have surpassed
337 a given limit per period?
</p></li><li><p>Maybe your previous network printing setup is a mess
338 and shall be re-organized from a clean beginning?
</p></li><li><p>Maybe you have experiencing too many
"Blue Screens
",
339 originating from poorly debugged printer drivers running in NT
"kernel
340 mode
"?
</p></li></ul></div><p>
341 These goals cannot be achieved by a raw print server. To build a
342 server meeting these requirements, you'll first need to learn about
343 how CUPS works and how you can enable its features.
345 What follows is the comparison of some fundamental concepts for
346 Windows and Unix printing; then is the time for a description of the
347 CUPS filtering system, how it works and how you can tweak it.
348 </p><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2954794"></a>GDI on Windows -- PostScript on Unix
</h3></div></div><div></div></div><p>
349 Network printing is one of the most complicated and error-prone
350 day-to-day tasks any user or an administrator may encounter. This is
351 true for all OS platforms. And there are reasons for this.
353 You can't expect for most file formats to just throw them towards
354 printers and they get printed. There needs to be a file format
355 conversion in between. The problem is: there is no common standard for
356 print file formats across all manufacturers and printer types. While
357 <span class=
"emphasis"><em>PostScript
</em></span> (trademark held by Adobe), and, to an
358 extent,
<span class=
"emphasis"><em>PCL
</em></span> (trademark held by HP), have developed
359 into semi-official
"standards
", by being the most widely used PDLs
360 (
<span class=
"emphasis"><em>Page Description Languages
</em></span>), there are still
361 many manufacturers who
"roll their own
" (their reasons may be
362 unacceptable license fees for using printer-embedded PostScript
364 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2954839"></a>Windows Drivers, GDI and EMF
</h3></div></div><div></div></div><p>
365 In Windows OS, the format conversion job is done by the printer
366 drivers. On MS Windows OS platforms all application programmers have
367 at their disposal a built-in API, the GDI (
<span class=
"emphasis"><em>Graphical Device
368 Interface
</em></span>), as part and parcel of the OS itself, to base
369 themselves on. This GDI core is used as one common unified ground, for
370 all Windows programs, to draw pictures, fonts and documents
371 <span class=
"emphasis"><em>on screen
</em></span> as well as
<span class=
"emphasis"><em>on
372 paper
</em></span> (=print). Therefore printer driver developers can
373 standardize on a well-defined GDI output for their own driver
374 input. Achieving WYSIWYG (
"What You See Is What You Get
") is
375 relatively easy, because the on-screen graphic primitives, as well as
376 the on-paper drawn objects, come from one common source. This source,
377 the GDI, produces often a file format called EMF (
<span class=
"emphasis"><em>Enhanced
378 MetaFile
</em></span>). The EMF is processed by the printer driver and
379 converted to the printer-specific file format.
380 </p><div class=
"note" style=
"margin-left: 0.5in; margin-right: 0.5in;"><h3 class=
"title">Note
</h3><p>
381 To the GDI foundation in MS Windows, Apple has chosen to
382 put paper and screen output on a common foundation for their
383 (BSD-Unix-based, did you know??) Mac OS X and Darwin Operating
384 Systems.Their
<span class=
"emphasis"><em>Core Graphic Engine
</em></span> uses a
385 <span class=
"emphasis"><em>PDF
</em></span> derivate for all display work.
388 </p><div class=
"figure"><a name=
"id2954904"></a><p class=
"title"><b>Figure
19.1. Windows Printing to a local Printer
</b></p><div class=
"mediaobject"><img src=
"projdoc/imagefiles/1small.png" alt=
"Windows Printing to a local Printer"></div></div><p>
389 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2954940"></a>Unix Printfile Conversion and GUI Basics
</h3></div></div><div></div></div><p>
390 In Unix and Linux, there is no comparable layer built into the OS
391 kernel(s) or the X (screen display) server. Every application is
392 responsible for itself to create its print output. Fortunately, most
393 use PostScript. That gives at least some common ground. Unfortunately,
394 there are many different levels of quality for this PostScript. And
395 worse: there is a huge difference (and no common root) in the way how
396 the same document is displayed on screen and how it is presented on
397 paper. WYSIWYG is more difficult to achieve. This goes back to the
398 time decades ago, when the predecessors of
<span class=
"emphasis"><em>X.org
</em></span>,
399 designing the UNIX foundations and protocols for Graphical User
400 Interfaces refused to take over responsibility for
"paper output
"
401 also, as some had demanded at the time, and restricted itself to
402 "on-screen only
". (For some years now, the
"Xprint
" project has been
403 under development, attempting to build printing support into the X
404 framework, including a PostScript and a PCL driver, but it is not yet
405 ready for prime time.) You can see this unfavorable inheritance up to
406 the present day by looking into the various
"font
" directories on your
407 system; there are separate ones for fonts used for X display and fonts
409 </p><p><b>Background.
</b>
410 The PostScript programming language is an
"invention
" by Adobe Inc.,
411 but its specifications have been published to the full. Its strength
412 lies in its powerful abilities to describe graphical objects (fonts,
413 shapes, patterns, lines, curves, dots...), their attributes (color,
414 linewidth...) and the way to manipulate (scale, distort, rotate,
415 shift...) them. Because of its open specification, anybody with the
416 skill can start writing his own implementation of a PostScript
417 interpreter and use it to display PostScript files on screen or on
418 paper. Most graphical output devices are based on the concept of
419 "raster images
" or
"pixels
" (one notable exception are pen
420 plotters). Of course, you can look at a PostScript file in its textual
421 form and you will be reading its PostScript code, the language
422 instructions which need to be interpreted by a rasterizer. Rasterizers
423 produce pixel images, which may be displayed on screen by a viewer
424 program or on paper by a printer.
425 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2955028"></a>PostScript and Ghostscript
</h3></div></div><div></div></div><p>
426 So, Unix is lacking a common ground for printing on paper and
427 displaying on screen. Despite this unfavorable legacy for Unix, basic
428 printing is fairly easy: if you have PostScript printers at your
429 disposal! The reason is: these devices have a built-in PostScript
430 language
"interpreter
", also called a
<span class=
"emphasis"><em>Raster Image
431 Processor
</em></span> (RIP), (which makes them more expensive than
432 other types of printers); throw PostScript towards them, and they will
433 spit out your printed pages. Their RIP is doing all the hard work of
434 converting the PostScript drawing commands into a bitmap picture as
435 you see it on paper, in a resolution as done by your printer. This is
436 no different to PostScript printing of a file from a Windows origin.
437 </p><div class=
"note" style=
"margin-left: 0.5in; margin-right: 0.5in;"><h3 class=
"title">Note
</h3><p>Traditional Unix programs and printing systems -- while
438 using PostScript -- are largely not PPD-aware. PPDs are
"PostScript
439 Printer Description
" files. They enable you to specify and control all
440 options a printer supports: duplexing, stapling, punching... Therefore
441 Unix users for a long time couldn't choose many of the supported
442 device and job options, unlike Windows or Apple users. But now there
445 </p><div class=
"figure"><a name=
"id2955075"></a><p class=
"title"><b>Figure
19.2. Printing to a Postscript Printer
</b></p><div class=
"mediaobject"><img src=
"projdoc/imagefiles/2small.png" alt=
"Printing to a Postscript Printer"></div></div><p>
447 However, there are other types of printers out there. These don't know
448 how to print PostScript. They use their own
<span class=
"emphasis"><em>Page Description
449 Language
</em></span> (PDL, often proprietary). To print to them is much
450 more demanding. Since your Unix applications mostly produce
451 PostScript, and since these devices don't understand PostScript, you
452 need to convert the printfiles to a format suitable for your printer
453 on the host, before you can send it away.
454 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2955125"></a>Ghostscript -- the Software RIP for non-PostScript Printers
</h3></div></div><div></div></div><p>
455 Here is where
<span class=
"emphasis"><em>Ghostscript
</em></span> kicks in. Ghostscript is
456 the traditional (and quite powerful) PostScript interpreter used on
457 Unix platforms. It is a RIP in software, capable to do a
458 <span class=
"emphasis"><em>lot
</em></span> of file format conversions, for a very broad
459 spectrum of hardware devices as well as software file formats.
460 Ghostscript technology and drivers is what enables PostScript printing
461 to non-PostScript hardware.
463 </p><div class=
"figure"><a name=
"id2955155"></a><p class=
"title"><b>Figure
19.3. Ghostscript as a RIP for non-postscript printers
</b></p><div class=
"mediaobject"><img src=
"projdoc/imagefiles/3small.png" alt=
"Ghostscript as a RIP for non-postscript printers"></div></div><p>
464 </p><div class=
"tip" style=
"margin-left: 0.5in; margin-right: 0.5in;"><h3 class=
"title">Tip
</h3><p>
465 Use the
"gs -h
" command to check for all built-in
"devices
" of your
466 Ghostscript version. If you specify e.g. a parameter of
467 <i class=
"parameter"><tt>-sDEVICE=png256
</tt></i> on your Ghostscript command
468 line, you are asking Ghostscript to convert the input into a PNG
469 file. Naming a
"device
" on the commandline is the most important
470 single parameter to tell Ghostscript how exactly it should render the
471 input. New Ghostscript versions are released at fairly regular
472 intervals, now by artofcode LLC. They are initially put under the
473 "AFPL
" license, but re-released under the GNU GPL as soon as the next
474 AFPL version appears. GNU Ghostscript is probably the version
475 installed on most Samba systems. But it has got some
476 deficiencies. Therefore ESP Ghostscript was developed as an
477 enhancement over GNU Ghostscript, with lots of bug-fixes, additional
478 devices and improvements. It is jointly maintained by developers from
479 CUPS, Gimp-Print, MandrakeSoft, SuSE, RedHat and Debian. It includes
480 the
"cups
" device (essential to print to non-PS printers from CUPS).
481 </p></div></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2955238"></a>PostScript Printer Description (PPD) Specification
</h3></div></div><div></div></div><p>
482 While PostScript in essence is a
<span class=
"emphasis"><em>Page Description
483 Language
</em></span> (PDL) to represent the page layout in a
484 <span class=
"emphasis"><em>device independent
</em></span> way, real world print jobs are
485 always ending up to be output on a hardware with device-specific
486 features. To take care of all the differences in hardware, and to
487 allow for innovations, Adobe has specified a syntax and file format
488 for
<span class=
"emphasis"><em>PostScript Printer Description
</em></span> (PPD)
489 files. Every PostScript printer ships with one of these files.
491 PPDs contain all information about general and special features of the
492 given printer model: Which different resolutions can it handle? Does
493 it have a Duplexing Unit? How many paper trays are there? What media
494 types and sizes does it take? For each item it also names the special
495 command string to be sent to the printer (mostly inside the PostScript
496 file) in order to enable it.
498 Information from these PPDs is meant to be taken into account by the
499 printer drivers. Therefore, installed as part of the Windows
500 PostScript driver for a given printer is the printer's PPD. Where it
501 makes sense, the PPD features are presented in the drivers' UI dialogs
502 to display to the user as choice of print options. In the end, the
503 user selections are somehow written (in the form of special
504 PostScript, PJL, JCL or vendor-dependent commands) into the PostScript
505 file created by the driver.
506 </p><div class=
"warning" style=
"margin-left: 0.5in; margin-right: 0.5in;"><h3 class=
"title">Warning
</h3><p>
507 A PostScript file that was created to contain device-specific commands
508 for achieving a certain print job output (e.g. duplexed, stapled and
509 punched) on a specific target machine, may not print as expected, or
510 may not be printable at all on other models; it also may not be fit
511 for further processing by software (e.g. by a PDF distilling program).
512 </p></div></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2955308"></a>CUPS can use all Windows-formatted Vendor PPDs
</h3></div></div><div></div></div><p>
513 CUPS can handle all spec-compliant PPDs as supplied by the
514 manufacturers for their PostScript models. Even if a
515 Unix/Linux-illiterate vendor might not have mentioned our favorite
516 OS in his manuals and brochures -- you can safely trust this:
517 <span class=
"emphasis"><em>if you get hold of the Windows NT version of the PPD, you
518 can use it unchanged in CUPS
</em></span> and thus access the full
519 power of your printer just like a Windows NT user could!
520 </p><div class=
"tip" style=
"margin-left: 0.5in; margin-right: 0.5in;"><h3 class=
"title">Tip
</h3><p>
521 To check the spec compliance of any PPD online, go to
<a href=
"http://www.cups.org/testppd.php" target=
"_top">http://www.cups.org/testppd.php
</a>
522 and upload your PPD. You will see the results displayed
523 immediately. CUPS in all versions after
1.1.19 has a much more strict
524 internal PPD parsing and checking code enabled; in case of printing
525 trouble this online resource should be one of your first pitstops.
526 </p></div><div class=
"warning" style=
"margin-left: 0.5in; margin-right: 0.5in;"><h3 class=
"title">Warning
</h3><p>
527 For real PostScript printers
<span class=
"emphasis"><em>don't
</em></span> use the
528 <span class=
"emphasis"><em>Foomatic
</em></span> or
<span class=
"emphasis"><em>cupsomatic
</em></span>
529 PPDs from Linuxprinting.org. With these devices the original
530 vendor-provided PPDs are always the first choice!
531 </p></div><div class=
"tip" style=
"margin-left: 0.5in; margin-right: 0.5in;"><h3 class=
"title">Tip
</h3><p>
532 If you are looking for an original vendor-provided PPD of a specific
533 device, and you know that an NT4 box (or any other Windows box) on
534 your LAN has the PostScript driver installed, just use
535 <b class=
"command">smbclient //NT4-box/print\$ -U username
</b> to
536 access the Windows directory where all printer driver files are
537 stored. First look in the
<tt class=
"filename">W32X86/
2</tt> subdir for
538 the PPD you are seeking.
539 </p></div></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2955397"></a>CUPS also uses PPDs for non-PostScript Printers
</h3></div></div><div></div></div><p>
540 CUPS also uses specially crafted PPDs to handle non-PostScript
541 printers. These PPDs are usually not available from the vendors (and
542 no, you can't just take the PPD of a Postscript printer with the same
543 model name and hope it works for the non-PostScript version too). To
544 understand how these PPDs work for non-PS printers we first need to
545 dive deeply into the CUPS filtering and file format conversion
546 architecture. Stay tuned.
547 </p></div></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><div><h2 class=
"title" style=
"clear: both"><a name=
"id2955420"></a>The CUPS Filtering Architecture
</h2></div></div><div></div></div><p>
548 The core of the CUPS filtering system is based on
549 <span class=
"emphasis"><em>Ghostscript
</em></span>. In addition to Ghostscript, CUPS
550 uses some other filters of its own. You (or your OS vendor) may have
551 plugged in even more filters. CUPS handles all data file formats under
552 the label of various
<span class=
"emphasis"><em>MIME types
</em></span>. Every incoming
553 printfile is subjected to an initial
554 <span class=
"emphasis"><em>auto-typing
</em></span>. The auto-typing determines its given
555 MIME type. A given MIME type implies zero or more possible filtering
556 chains relevant to the selected target printer. This section discusses
557 how MIME types recognition and conversion rules interact. They are
558 used by CUPS to automatically setup a working filtering chain for any
559 given input data format.
561 If CUPS rasterizes a PostScript file
<span class=
"emphasis"><em>natively
</em></span> to
562 a bitmap, this is done in
2 stages:
563 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p>the first stage uses a Ghostscript device named
"cups
"
564 (this is since version
1.1.15) and produces a generic raster format
565 called
"CUPS raster
".
566 </p></li><li><p>the second stage uses a
"raster driver
" which converts
567 the generic CUPS raster to a device specific raster.
</p></li></ul></div><p>
568 Make sure your Ghostscript version has the
"cups
" device compiled in
569 (check with
<b class=
"command">gs -h | grep cups
</b>). Otherwise you
570 may encounter the dreaded
<tt class=
"computeroutput">Unable to convert file
571 0</tt> in your CUPS error_log file. To have
"cups
" as a
572 device in your Ghostscript, you either need to
<span class=
"emphasis"><em>patch GNU
573 Ghostscript
</em></span> and re-compile or use
<a href=
"http://www.cups.org/ghostscript.php" target=
"_top">ESP Ghostscript
</a>. The
574 superior alternative is ESP Ghostscript: it supports not just CUPS,
575 but
300 other devices too (while GNU Ghostscript supports only about
576 180). Because of this broad output device support, ESP Ghostscript is
577 the first choice for non-CUPS spoolers too. It is now recommended by
578 Linuxprinting.org for all spoolers.
580 CUPS printers may be setup to use
<span class=
"emphasis"><em>external
</em></span>
581 rendering paths. One of the most common ones is provided by the
582 <span class=
"emphasis"><em>Foomatic/cupsomatic
</em></span> concept, from
<a href=
"http://www.linuxprinting.org/" target=
"_top">Linuxprinting.org
</a>. This
583 uses the classical Ghostscript approach, doing everything in one
584 step. It doesn't use the
"cups
" device, but one of the many
585 others. However, even for Foomatic/cupsomatic usage, best results and
586 broadest printer model support is provided by ESP Ghostscript (more
587 about cupsomatic/Foomatic, particularly the new version called now
588 <span class=
"emphasis"><em>foomatic-rip
</em></span>, follows below).
589 </p><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2955560"></a>MIME types and CUPS Filters
</h3></div></div><div></div></div><p>
590 CUPS reads the file
<tt class=
"filename">/etc/cups/mime.types
</tt>
591 (and all other files carrying a
<tt class=
"filename">*.types
</tt> suffix
592 in the same directory) upon startup. These files contain the MIME
593 type recognition rules which are applied when CUPS runs its
594 auto-typing routines. The rule syntax is explained in the man page
595 for
<tt class=
"filename">mime.types
</tt> and in the comments section of the
596 <tt class=
"filename">mime.types
</tt> file itself. A simple rule reads
598 </p><pre class=
"screen">
600 application/pdf pdf string(
0,%PDF)
603 This means: if a filename has either a
604 <tt class=
"filename">.pdf
</tt> suffix, or if the magic
605 string
<span class=
"emphasis"><em>%PDF
</em></span> is right at the
606 beginning of the file itself (offset
0 from the start), then it is
607 a PDF file (
<span class=
"emphasis"><em>application/pdf
</em></span>).
608 Another rule is this:
609 </p><pre class=
"screen">
611 application/postscript ai eps ps string(
0,%!) string(
0,
<04>%!)
614 Its meaning: if the filename has one of the suffixes
615 <tt class=
"filename">.ai
</tt>,
<tt class=
"filename">.eps
</tt>,
616 <tt class=
"filename">.ps
</tt> or if the file itself starts with one of the
617 strings
<span class=
"emphasis"><em>%!
</em></span> or
<span class=
"emphasis"><em><04>%!
</em></span>, it
618 is a generic PostScript file
619 (
<span class=
"emphasis"><em>application/postscript
</em></span>).
620 </p><div class=
"note" style=
"margin-left: 0.5in; margin-right: 0.5in;"><h3 class=
"title">Note
</h3><p>
621 There is a very important difference between two similar MIME type in
622 CUPS: one is
<span class=
"emphasis"><em>application/postscript
</em></span>, the other is
623 <span class=
"emphasis"><em>application/vnd.cups-postscript
</em></span>. While
624 <span class=
"emphasis"><em>application/postscript
</em></span> is meant to be device
625 independent (job options for the file are still outside the PS file
626 content, embedded in commandline or environment variables by CUPS),
627 <span class=
"emphasis"><em>application/vnd.cups-postscript
</em></span> may have the job
628 options inserted into the PostScript data itself (were
629 applicable). The transformation of the generic PostScript
630 (application/postscript) to the device-specific version
631 (application/vnd.cups-postscript) is the responsibility of the
632 CUPS
<span class=
"emphasis"><em>pstops
</em></span> filter. pstops uses information
633 contained in the PPD to do the transformation.
634 </p></div><div class=
"warning" style=
"margin-left: 0.5in; margin-right: 0.5in;"><h3 class=
"title">Warning
</h3><p>
635 Don't confuse the other mime.types file your system might be using
636 with the one in the
<tt class=
"filename">/etc/cups/
</tt> directory.
638 CUPS can handle ASCII text, HP-GL, PDF, PostScript, DVI and a
639 lot of image formats (GIF. PNG, TIFF, JPEG, Photo-CD, SUN-Raster,
640 PNM, PBM, SGI-RGB and some more) and their associated MIME types
642 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2955747"></a>MIME type Conversion Rules
</h3></div></div><div></div></div><p>
643 CUPS reads the file
<tt class=
"filename">/etc/cups/mime.convs
</tt>
644 (and all other files named with a
<tt class=
"filename">*.convs
</tt>
645 suffix in the same directory) upon startup. These files contain
646 lines naming an input MIME type, an output MIME type, a format
647 conversion filter which can produce the output from the input type
648 and virtual costs associated with this conversion. One example line
650 </p><pre class=
"screen">
652 application/pdf application/postscript
33 pdftops
655 This means that the
<span class=
"emphasis"><em>pdftops
</em></span> filter will take
656 <span class=
"emphasis"><em>application/pdf
</em></span> as input and produce
657 <span class=
"emphasis"><em>application/postscript
</em></span> as output, the virtual
658 cost of this operation is
33 CUPS-$. The next filter is more
659 expensive, costing
66 CUPS-$:
660 </p><pre class=
"screen">
662 application/vnd.hp-HPGL application/postscript
66 hpgltops
665 This is the
<span class=
"emphasis"><em>hpgltops
</em></span>, which processes HP-GL
666 plotter files to PostScript.
667 </p><pre class=
"screen">
669 application/octet-stream
672 Here are two more examples:
673 </p><pre class=
"screen">
675 application/x-shell application/postscript
33 texttops
676 text/plain application/postscript
33 texttops
679 The last two examples name the
<span class=
"emphasis"><em>texttops
</em></span> filter
680 to work on
"text/plain
" as well as on
"application/x-shell
". (Hint:
681 this differentiation is needed for the syntax highlighting feature of
682 "texttops
").
683 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2955864"></a>Filter Requirements
</h3></div></div><div></div></div><p>
684 There are many more combinations named in mime.convs. However, you
685 are not limited to use the ones pre-defined there. You can plug in any
686 filter you like into the CUPS framework. It must meet, or must be made
687 to meet some minimal requirements. If you find (or write) a cool
688 conversion filter of some kind, make sure it complies to what CUPS
689 needs, and put in the right lines in
<tt class=
"filename">mime.types
</tt>
690 and
<tt class=
"filename">mime.convs
</tt>, then it will work seamlessly
692 </p><div class=
"tip" style=
"margin-left: 0.5in; margin-right: 0.5in;"><h3 class=
"title">Tip
</h3><p>
693 The mentioned
"CUPS requirements
" for filters are simple. Take
694 filenames or
<tt class=
"filename">stdin
</tt> as input and write to
695 <tt class=
"filename">stdout
</tt>. They should take these
5 or
6 arguments:
696 <span class=
"emphasis"><em>printer job user title copies options [filename]
</em></span>
697 </p><div class=
"variablelist"><dl><dt><span class=
"term">Printer
</span></dt><dd><p>The name of the printer queue (normally this is the
698 name of the filter being run)
</p></dd><dt><span class=
"term">job
</span></dt><dd><p>The numeric job ID for the job being
699 printed
</p></dd><dt><span class=
"term">Printer
</span></dt><dd><p>The string from the originating-user-name
700 attribute
</p></dd><dt><span class=
"term">Printer
</span></dt><dd><p>The string from the job-name attribute
</p></dd><dt><span class=
"term">Printer
</span></dt><dd><p>The numeric value from the number-copies
701 attribute
</p></dd><dt><span class=
"term">Printer
</span></dt><dd><p>The job options
</p></dd><dt><span class=
"term">Printer
</span></dt><dd><p>(Optionally) The print request file (if missing,
702 filters expected data fed through
<tt class=
"filename">stdin
</tt>). In most
703 cases it is very easy to write a simple wrapper script around existing
704 filters to make them work with CUPS.
</p></dd></dl></div></div></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2956034"></a>Prefilters
</h3></div></div><div></div></div><p>
705 As was said, PostScript is the central file format to any Unix based
706 printing system. From PostScript, CUPS generates raster data to feed
707 non-PostScript printers.
709 But what is happening if you send one of the supported non-PS formats
710 to print? Then CUPS runs
"pre-filters
" on these input formats to
711 generate PostScript first. There are pre-filters to create PS from
712 ASCII text, PDF, DVI or HP-GL. The outcome of these filters is always
713 of MIME type
<span class=
"emphasis"><em>application/postscript
</em></span> (meaning that
714 any device-specific print options are not yet embedded into the
715 PostScript by CUPS, and that the next filter to be called is
716 pstops). Another pre-filter is running on all supported image formats,
717 the
<span class=
"emphasis"><em>imagetops
</em></span> filter. Its outcome is always of
718 MIME type
<span class=
"emphasis"><em>application/vnd.cups-postscript
</em></span>
719 (
<span class=
"emphasis"><em>not
</em></span> application/postscript), meaning it has the
720 print options already embedded into the file.
722 </p><div class=
"figure"><a name=
"id2956084"></a><p class=
"title"><b>Figure
19.4. Prefiltering in CUPS to form Postscript
</b></p><div class=
"mediaobject"><img src=
"projdoc/imagefiles/4small.png" alt=
"Prefiltering in CUPS to form Postscript"></div></div><p>
723 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2956120"></a>pstops
</h3></div></div><div></div></div><p>
724 <span class=
"emphasis"><em>pstops
</em></span>is the filter to convert
725 <span class=
"emphasis"><em>application/postscript
</em></span> to
726 <span class=
"emphasis"><em>application/vnd.cups-postscript
</em></span>. It was said
727 above that this filter inserts all device-specific print options
728 (commands to the printer to ask for the duplexing of output, or
729 stapling an punching it, etc.) into the PostScript file.
731 </p><div class=
"figure"><a name=
"id2956149"></a><p class=
"title"><b>Figure
19.5. Adding Device-specific Print Options
</b></p><div class=
"mediaobject"><img src=
"projdoc/imagefiles/5small.png" alt=
"Adding Device-specific Print Options"></div></div><p>
733 This is not all: other tasks performed by it are:
734 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p>
735 selecting the range of pages to be printed (if you choose to
736 print only pages
"3,
6,
8-
11,
16,
19-
21", or only the odd numbered
739 putting
2 or more logical pages on one sheet of paper (the
740 so-called
"number-up
" function)
741 </p></li><li><p>counting the pages of the job to insert the accounting
742 information into the
<tt class=
"filename">/var/log/cups/page_log
</tt>
743 </p></li></ul></div></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2956222"></a>pstoraster
</h3></div></div><div></div></div><p>
744 <span class=
"emphasis"><em>pstoraster
</em></span> is at the core of the CUPS filtering
745 system. It is responsible for the first stage of the rasterization
746 process. Its input is of MIME type application/vnd.cups-postscript;
747 its output is application/vnd.cups-raster. This output format is not
748 yet meant to be printable. Its aim is to serve as a general purpose
749 input format for more specialized
<span class=
"emphasis"><em>raster drivers
</em></span>,
750 that are able to generate device-specific printer data.
752 </p><div class=
"figure"><a name=
"id2956251"></a><p class=
"title"><b>Figure
19.6. Postscript to intermediate Raster format
</b></p><div class=
"mediaobject"><img src=
"projdoc/imagefiles/6small.png" alt=
"Postscript to intermediate Raster format"></div></div><p>
754 CUPS raster is a generic raster format with powerful features. It is
755 able to include per-page information, color profiles and more to be
756 used by the following downstream raster drivers. Its MIME type is
757 registered with IANA and its specification is of course completely
758 open. It is designed to make it very easy and inexpensive for
759 manufacturers to develop Linux and Unix raster drivers for their
760 printer models, should they choose to do so. CUPS always takes care
761 for the first stage of rasterization so these vendors don't need to care
762 about Ghostscript complications (in fact, there is currently more
763 than one vendor financing the development of CUPS raster drivers).
765 </p><div class=
"figure"><a name=
"id2956304"></a><p class=
"title"><b>Figure
19.7. CUPS-raster production using Ghostscript
</b></p><div class=
"mediaobject"><img src=
"projdoc/imagefiles/7small.png" alt=
"CUPS-raster production using Ghostscript"></div></div><p>
767 CUPS versions before version
1.1.15 were shipping a binary (or source
768 code) standalone filter, named
"pstoraster
". pstoraster was derived
769 from GNU Ghostscript
5.50, and could be installed besides and in
770 addition to any GNU or AFPL Ghostscript package without conflicting.
772 From version
1.1.15, this has changed. The functions for this has been
773 integrated back into Ghostscript (now based on GNU Ghostscript version
774 7.05). The
"pstoraster
" filter is now a simple shell script calling
775 <b class=
"command">gs
</b> with the
<b class=
"command">-sDEVICE=cups
</b>
776 parameter. If your Ghostscript doesn't show a success on asking for
777 <b class=
"command">gs -h |grep cups
</b>, you might not be able to
778 print. Update your Ghostscript then!
779 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2956377"></a>imagetops and imagetoraster
</h3></div></div><div></div></div><p>
780 Above in the section about prefilters, we mentioned the prefilter
781 that generates PostScript from image formats. The imagetoraster
782 filter is used to convert directly from image to raster, without the
783 intermediate PostScript stage. It is used more often than the above
784 mentioned prefilters. Here is a summarizing flowchart of image file
787 </p><div class=
"figure"><a name=
"id2956398"></a><p class=
"title"><b>Figure
19.8. Image format to CUPS-raster format conversion
</b></p><div class=
"mediaobject"><img src=
"projdoc/imagefiles/8small.png" alt=
"Image format to CUPS-raster format conversion"></div></div><p>
788 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2956434"></a>rasterto [printers specific]
</h3></div></div><div></div></div><p>
789 CUPS ships with quite some different raster drivers processing CUPS
790 raster. On my system I find in /usr/lib/cups/filter/ these:
791 <i class=
"parameter"><tt>rastertoalps, rastertobj, rastertoepson, rastertoescp,
792 rastertopcl, rastertoturboprint, rastertoapdk, rastertodymo,
793 rastertoescp, rastertohp
</tt></i> and
794 <i class=
"parameter"><tt>rastertoprinter
</tt></i>. Don't worry if you have less
795 than this; some of these are installed by commercial add-ons to CUPS
796 (like
<i class=
"parameter"><tt>rastertoturboprint
</tt></i>), others (like
797 <i class=
"parameter"><tt>rastertoprinter
</tt></i>) by
3rd party driver
798 development projects (such as Gimp-Print) wanting to cooperate as
799 closely as possible with CUPS.
801 </p><div class=
"figure"><a name=
"id2956484"></a><p class=
"title"><b>Figure
19.9. Raster to Printer Specific formats
</b></p><div class=
"mediaobject"><img src=
"projdoc/imagefiles/9small.png" alt=
"Raster to Printer Specific formats"></div></div><p>
802 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2956519"></a>CUPS Backends
</h3></div></div><div></div></div><p>
803 The last part of any CUPS filtering chain is a
"backend
". Backends
804 are special programs that send the print-ready file to the final
805 device. There is a separate backend program for any transfer
806 "protocol
" of sending printjobs over the network, or for every local
807 interface. Every CUPS printqueue needs to have a CUPS
"device-URI
"
808 associated with it. The device URI is the way to encode the backend
809 used to send the job to its destination. Network device-URIs are using
810 two slashes in their syntax, local device URIs only one, as you can
811 see from the following list. Keep in mind that local interface names
812 may vary much from my examples, if your OS is not Linux:
813 </p><div class=
"variablelist"><dl><dt><span class=
"term">usb
</span></dt><dd><p>
814 This backend sends printfiles to USB-connected printers. An
815 example for the CUPS device-URI to use is:
816 <tt class=
"filename">usb:/dev/usb/lp0
</tt>
817 </p></dd><dt><span class=
"term">serial
</span></dt><dd><p>
818 This backend sends printfiles to serially connected printers.
819 An example for the CUPS device-URI to use is:
820 <tt class=
"filename">serial:/dev/ttyS0?baud=
11500</tt>
821 </p></dd><dt><span class=
"term">parallel
</span></dt><dd><p>
822 This backend sends printfiles to printers connected to the
823 parallel port. An example for the CUPS device-URI to use is:
824 <tt class=
"filename">parallel:/dev/lp0
</tt>
825 </p></dd><dt><span class=
"term">scsi
</span></dt><dd><p>
826 This backend sends printfiles to printers attached to the
827 SCSI interface. An example for the CUPS device-URI to use is:
828 <tt class=
"filename">scsi:/dev/sr1
</tt>
829 </p></dd><dt><span class=
"term">lpd
</span></dt><dd><p>
830 This backend sends printfiles to LPR/LPD connected network
831 printers. An example for the CUPS device-URI to use is:
832 <tt class=
"filename">lpd://remote_host_name/remote_queue_name
</tt>
833 </p></dd><dt><span class=
"term">AppSocket/HP JetDirect
</span></dt><dd><p>
834 This backend sends printfiles to AppSocket (a.k.a.
"HP
835 JetDirect
") connected network printers. An example for the CUPS
836 device-URI to use is:
837 <tt class=
"filename">socket://
10.11.12.13:
9100</tt>
838 </p></dd><dt><span class=
"term">ipp
</span></dt><dd><p>
839 This backend sends printfiles to IPP connected network
840 printers (or to other CUPS servers). Examples for CUPS device-URIs
842 <tt class=
"filename">ipp:://
192.193.194.195/ipp
</tt>
843 (for many HP printers) or
844 <tt class=
"filename">ipp://remote_cups_server/printers/remote_printer_name
</tt>
845 </p></dd><dt><span class=
"term">http
</span></dt><dd><p>
846 This backend sends printfiles to HTTP connected printers.
847 (The http:// CUPS backend is only a symlink to the ipp:// backend.)
848 Examples for the CUPS device-URIs to use are:
849 <tt class=
"filename">http:://
192.193.194.195:
631/ipp
</tt>
850 (for many HP printers) or
851 <tt class=
"filename">http://remote_cups_server:
631/printers/remote_printer_name
</tt>
852 </p></dd><dt><span class=
"term">smb
</span></dt><dd><p>
853 This backend sends printfiles to printers shared by a Windows
854 host. An example for CUPS device-URIs to use are:
855 <tt class=
"filename">smb://workgroup/server/printersharename
</tt>
857 <tt class=
"filename">Smb://server/printersharename
</tt>
859 <tt class=
"filename">smb://username:password@workgroup/server/printersharename
</tt>
861 <tt class=
"filename">smb://username:password@server/printersharename
</tt>.
862 The smb:// backend is a symlink to the Samba utility
863 <span class=
"emphasis"><em>smbspool
</em></span> (doesn't ship with CUPS). If the
864 symlink is not present in your CUPS backend directory, have your
865 root user create it:
<b class=
"command">ln -s `which smbspool`
866 /usr/lib/cups/backend/smb
</b>.
867 </p></dd></dl></div><p>
868 It is easy to write your own backends as Shell or Perl scripts, if you
869 need any modification or extension to the CUPS print system. One
870 reason could be that you want to create
"special
" printers which send
871 the printjobs as email (through a
"mailto:/
" backend), convert them to
872 PDF (through a
"pdfgen:/
" backend) or dump them to
"/dev/null
" (In
873 fact I have the system-wide default printer set up to be connected to
874 a
"devnull:/
" backend: there are just too many people sending jobs
875 without specifying a printer, or scripts and programs which don't name
876 a printer. The system-wide default deletes the job and sends a polite
877 mail back to the $USER asking him to always specify a correct
880 Not all of the mentioned backends may be present on your system or
881 usable (depending on your hardware configuration). One test for all
882 available CUPS backends is provided by the
<span class=
"emphasis"><em>lpinfo
</em></span>
883 utility. Used with the
<i class=
"parameter"><tt>-v
</tt></i> parameter, it lists
884 all available backends:
885 </p><pre class=
"screen">
889 </pre></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2956831"></a>cupsomatic/Foomatic -- how do they fit into the Picture?
</h3></div></div><div></div></div><p>
890 "cupsomatic
" filters may be the most widely used on CUPS
891 installations. You must be clear about the fact that these were not
892 developed by the CUPS people. They are a
"Third Party
" add-on to
893 CUPS. They utilize the traditional Ghostscript devices to render jobs
894 for CUPS. When troubleshooting, you should know about the
895 difference. Here the whole rendering process is done in one stage,
896 inside Ghostscript, using an appropriate
"device
" for the target
897 printer. cupsomatic uses PPDs which are generated from the
"Foomatic
"
898 Printer
& Driver Database at Linuxprinting.org.
900 You can recognize these PPDs from the line calling the
901 <span class=
"emphasis"><em>cupsomatic
</em></span> filter:
902 </p><pre class=
"screen">
904 *cupsFilter:
"application/vnd.cups-postscript
0 cupsomatic
"
907 This line you may find amongst the first
40 or so lines of the PPD
908 file. If you have such a PPD installed, the printer shows up in the
909 CUPS web interface with a
<span class=
"emphasis"><em>foomatic
</em></span> namepart for
910 the driver description. cupsomatic is a Perl script that runs
911 Ghostscript, with all the complicated commandline options
912 auto-constructed from the selected PPD and commandline options give to
915 However, cupsomatic is now deprecated. Its PPDs (especially the first
916 generation of them, still in heavy use out there) are not meeting the
917 Adobe specifications. You might also suffer difficulties when you try
918 to download them with
"Point'n'Print
" to Windows clients. A better,
919 and more powerful successor is now in a very stable Beta-version
920 available: it is called
<span class=
"emphasis"><em>foomatic-rip
</em></span>. To use
921 foomatic-rip as a filter with CUPS, you need the new-type PPDs. These
922 have a similar, but different line:
923 </p><pre class=
"screen">
925 *cupsFilter:
"application/vnd.cups-postscript
0 foomatic-rip
"
928 The PPD generating engine at Linuxprinting.org has been revamped.
929 The new PPDs comply to the Adobe spec. On top, they also provide a
930 new way to specify different quality levels (hi-res photo, normal
931 color, grayscale, draft...) with a single click (whereas before you
932 could have required
5 or more different selections (media type,
933 resolution, inktype, dithering algorithm...). There is support for
934 custom-size media built in. There is support to switch
935 print-options from page to page, in the middle of a job. And the
936 best thing is: the new foomatic-rip now works seamlessly with all
937 legacy spoolers too (like LPRng, BSD-LPD, PDQ, PPR etc.), providing
938 for them access to use PPDs for their printing!
939 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2956944"></a>The Complete Picture
</h3></div></div><div></div></div><p>
940 If you want to see an overview over all the filters and how they
941 relate to each other, the complete picture of the puzzle is at the end
943 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2956960"></a><tt class=
"filename">mime.convs
</tt></h3></div></div><div></div></div><p>
944 CUPS auto-constructs all possible filtering chain paths for any given
945 MIME type, and every printer installed. But how does it decide in
946 favor or against a specific alternative? (There may often be cases,
947 where there is a choice of two or more possible filtering chains for
948 the same target printer). Simple: you may have noticed the figures in
949 the
3rd column of the mime.convs file. They represent virtual costs
950 assigned to this filter. Every possible filtering chain will sum up to
951 a total
"filter cost
". CUPS decides for the most
"inexpensive
" route.
952 </p><div class=
"tip" style=
"margin-left: 0.5in; margin-right: 0.5in;"><h3 class=
"title">Tip
</h3><p>
953 The setting of
<i class=
"parameter"><tt>FilterLimit
1000</tt></i> in
954 <tt class=
"filename">cupsd.conf
</tt> will not allow more filters to
955 run concurrently than will consume a total of
1000 virtual filter
956 cost. This is a very efficient way to limit the load of any CUPS
957 server by setting an appropriate
"FilterLimit
" value. A FilterLimit of
958 200 allows roughly
1 job at a time, while a FilterLimit of
1000 allows
959 approximately
5 jobs maximum at a time.
960 </p></div></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2957012"></a>"Raw
" printing
</h3></div></div><div></div></div><p>
961 You can tell CUPS to print (nearly) any file
"raw
".
"Raw
" means it
962 will not be filtered. CUPS will send the file to the printer
"as is
"
963 without bothering if the printer is able to digest it. Users need to
964 take care themselves that they send sensible data formats only. Raw
965 printing can happen on any queue if the
"-o raw
" option is specified
966 on the command line. You can also set up raw-only queues by simply not
967 associating any PPD with it. This command:
968 </p><pre class=
"screen">
970 lpadmin -P rawprinter -v socket://
11.12.13.14:
9100 -E
973 sets up a queue named
"rawprinter
", connected via the
"socket
"
974 protocol (a.k.a.
"HP JetDirect
") to the device at IP address
975 11.12.1.3.14, using port
9100. (If you had added a PPD with
976 <b class=
"command">-P /path/to/PPD
</b> to this command line, you would
977 have installed a
"normal
" printqueue.
979 CUPS will automatically treat each job sent to a queue as a
"raw
" one,
980 if it can't find a PPD associated with the queue. However, CUPS will
981 only send known MIME types (as defined in its own mime.types file) and
983 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2957066"></a>"application/octet-stream
" printing
</h3></div></div><div></div></div><p>
984 Any MIME type with no rule in the
985 <tt class=
"filename">/etc/cups/mime.types
</tt> file is regarded as unknown
986 or
<span class=
"emphasis"><em>application/octet-stream
</em></span> and will not be
987 sent. Because CUPS refuses to print unknown MIME types per default,
988 you will probably have experienced the fact that printjobs originating
989 from Windows clients were not printed. You may have found an error
990 message in your CUPS logs like:
991 </p><pre class=
"screen">
993 Unable to convert file
0 to printable format for job
996 To enable the printing of
"application/octet-stream
" files, edit
998 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p><tt class=
"filename">/etc/cups/mime.convs
</tt></p></li><li><p><tt class=
"filename">/etc/cups/mime.types
</tt></p></li></ul></div><p>
999 Both contain entries (at the end of the respective files) which must
1000 be uncommented to allow RAW mode operation for
1001 application/octet-stream. In
<tt class=
"filename">/etc/cups/mime.types
</tt>
1002 make sure this line is present:
1003 </p><pre class=
"screen">
1005 application/octet-stream
1008 This line (with no specific auto-typing rule set) makes all files
1009 not otherwise auto-typed a member of application/octet-stream. In
1010 <tt class=
"filename">/etc/cups/mime.convs
</tt>, have this
1012 </p><pre class=
"screen">
1014 application/octet-stream application/vnd.cups-raw
0 -
1017 This line tells CUPS to use the
<span class=
"emphasis"><em>Null Filter
</em></span>
1018 (denoted as
"-
", doing... nothing at all) on
1019 <span class=
"emphasis"><em>application/octet-stream
</em></span>, and tag the result as
1020 <span class=
"emphasis"><em>application/vnd.cups-raw
</em></span>. This last one is
1021 always a green light to the CUPS scheduler to now hand the file over
1022 to the
"backend
" connecting to the printer and sending it over.
1023 </p><div class=
"note" style=
"margin-left: 0.5in; margin-right: 0.5in;"><h3 class=
"title">Note
</h3><p> Editing the
<tt class=
"filename">mime.convs
</tt> and the
1024 <tt class=
"filename">mime.types
</tt> file does not
1025 <span class=
"emphasis"><em>enforce
</em></span> "raw
" printing, it only
1026 <span class=
"emphasis"><em>allows
</em></span> it.
1027 </p></div><p><b>Background.
</b>
1028 CUPS being a more security-aware printing system than traditional ones
1029 does not by default allow one to send deliberate (possibly binary)
1030 data to printing devices. (This could be easily abused to launch a
1031 Denial of Service attack on your printer(s), causing at least the loss
1032 of a lot of paper and ink...)
"Unknown
" data are regarded by CUPS
1033 as
<span class=
"emphasis"><em>MIME type
</em></span>
1034 <span class=
"emphasis"><em>application/octet-stream
</em></span>. While you
1035 <span class=
"emphasis"><em>can
</em></span> send data
"raw
", the MIME type for these must
1036 be one that is known to CUPS and an allowed one. The file
1037 <tt class=
"filename">/etc/cups/mime.types
</tt> defines the
"rules
" how CUPS
1038 recognizes MIME types. The file
1039 <tt class=
"filename">/etc/cups/mime.convs
</tt> decides which file
1040 conversion filter(s) may be applied to which MIME types.
1041 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2957282"></a>PostScript Printer Descriptions (PPDs) for non-PS Printers
</h3></div></div><div></div></div><p>
1042 Originally PPDs were meant to be used for PostScript printers
1043 only. Here, they help to send device-specific commands and settings
1044 to the RIP which processes the jobfile. CUPS has extended this
1045 scope for PPDs to cover non-PostScript printers too. This was not
1046 very difficult, because it is a standardized file format. In a way
1047 it was logical too: CUPS handles PostScript and uses a PostScript
1048 RIP (=Ghostscript) to process the jobfiles. The only difference is:
1049 a PostScript printer has the RIP built-in, for other types of
1050 printers the Ghostscript RIP runs on the host computer.
1052 PPDs for a non-PS printer have a few lines that are unique to
1053 CUPS. The most important one looks similar to this:
1054 </p><pre class=
"screen">
1056 *cupsFilter: application/vnd.cups-raster
66 rastertoprinter
1059 It is the last piece in the CUPS filtering puzzle. This line tells the
1060 CUPS daemon to use as a last filter
"rastertoprinter
". This filter
1061 should be served as input an
"application/vnd.cups-raster
" MIME type
1062 file. Therefore CUPS should auto-construct a filtering chain, which
1063 delivers as its last output the specified MIME type. This is then
1064 taken as input to the specified
"rastertoprinter
" filter. After this
1065 the last filter has done its work (
"rastertoprinter
" is a Gimp-Print
1066 filter), the file should go to the backend, which sends it to the
1069 CUPS by default ships only a few generic PPDs, but they are good for
1070 several hundred printer models. You may not be able to control
1071 different paper trays, or you may get larger margins than your
1072 specific model supports):
1073 </p><div class=
"variablelist"><dl><dt><span class=
"term">deskjet.ppd
</span></dt><dd><p>older HP inkjet printers and compatible
1074 </p></dd><dt><span class=
"term">deskjet2.ppd
</span></dt><dd><p>newer HP inkjet printers and compatible
1075 </p></dd><dt><span class=
"term">dymo.ppd
</span></dt><dd><p>label printers
1076 </p></dd><dt><span class=
"term">epson9.ppd
</span></dt><dd><p>Epson
24pin impact printers and compatible
1077 </p></dd><dt><span class=
"term">epson24.ppd
</span></dt><dd><p>Epson
24pin impact printers and compatible
1078 </p></dd><dt><span class=
"term">okidata9.ppd
</span></dt><dd><p>Okidata
9pin impact printers and compatible
1079 </p></dd><dt><span class=
"term">okidat24.ppd
</span></dt><dd><p>Okidata
24pin impact printers and compatible
1080 </p></dd><dt><span class=
"term">stcolor.ppd
</span></dt><dd><p>older Epson Stylus Color printers
1081 </p></dd><dt><span class=
"term">stcolor2.ppd
</span></dt><dd><p>newer Epson Stylus Color printers
1082 </p></dd><dt><span class=
"term">stphoto.ppd
</span></dt><dd><p>older Epson Stylus Photo printers
1083 </p></dd><dt><span class=
"term">stphoto2.ppd
</span></dt><dd><p>newer Epson Stylus Photo printers
1084 </p></dd><dt><span class=
"term">laserjet.ppd
</span></dt><dd><p>all PCL printers. Further below is a discussion
1085 of several other driver/PPD-packages suitable fur use with CUPS.
1086 </p></dd></dl></div></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2957510"></a>Difference between
<span class=
"emphasis"><em>cupsomatic/foomatic-rip
</em></span> and
1087 <span class=
"emphasis"><em>native CUPS
</em></span> printing
</h3></div></div><div></div></div><p>
1088 Native CUPS rasterization works in two steps.
1089 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p>
1090 First is the
"pstoraster
" step. It uses the special
"cups
"
1091 device from ESP Ghostscript
7.05.x as its tool
1093 Second comes the
"rasterdriver
" step. It uses various
1094 device-specific filters; there are several vendors who provide good
1095 quality filters for this step, some are Free Software, some are
1096 Shareware/Non-Free, some are proprietary.
</p></li></ul></div><p>
1097 Often this produces better quality (and has several more
1098 advantages) than other methods.
1100 </p><div class=
"figure"><a name=
"id2957561"></a><p class=
"title"><b>Figure
19.10. cupsomatic/foomatic processing versus Native CUPS
</b></p><div class=
"mediaobject"><img src=
"projdoc/imagefiles/10small.png" alt=
"cupsomatic/foomatic processing versus Native CUPS"></div></div><p>
1102 One other method is the
<span class=
"emphasis"><em>cupsomatic/foomatic-rip
</em></span>
1103 way. Note that cupsomatic is
<span class=
"emphasis"><em>not
</em></span> made by the CUPS
1104 developers. It is an independent contribution to printing development,
1105 made by people from Linuxprinting.org (see also
<a href=
"http://www.cups.org/cups-help.html" target=
"_top">http://www.cups.org/cups-help.html
</a>).
1106 cupsomatic is no longer developed and maintained and is no longer
1107 supported. It has now been replaced by
1108 <span class=
"emphasis"><em>foomatic-rip
</em></span>. foomatic-rip is a complete re-write
1109 of the old cupsomatic idea, but very much improved and generalized to
1110 other (non-CUPS) spoolers. An upgrade to foomatic-rip is strongly
1111 advised, especially if you are upgrading to a recent version of CUPS
1114 Both the cupsomatic (old) and the foomatic-rip (new) methods from
1115 Linuxprinting.org use the traditional Ghostscript print file
1116 processing, doing everything in a single step. It therefore relies on
1117 all the other devices built-in into Ghostscript. The quality is as
1118 good (or bad) as Ghostscript rendering is in other spoolers. The
1119 advantage is that this method supports many printer models not
1120 supported (yet) by the more modern CUPS method.
1122 Of course, you can use both methods side by side on one system (and
1123 even for one printer, if you set up different queues), and find out
1124 which works best for you.
1126 cupsomatic
"kidnaps
" the printfile after the
1127 <span class=
"emphasis"><em>application/vnd.cups-postscript
</em></span> stage and
1128 deviates it through the CUPS-external, system wide Ghostscript
1129 installation: Therefore the printfile bypasses the
"pstoraster
" filter
1130 (and thus also bypasses the CUPS-raster-drivers
1131 "rastertosomething
"). After Ghostscript finished its rasterization,
1132 cupsomatic hands the rendered file directly to the CUPS backend. The
1133 flowchart above illustrates the difference between native CUPS
1134 rendering and the Foomatic/cupsomatic method.
1135 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2957666"></a>Examples for filtering Chains
</h3></div></div><div></div></div><p>
1136 Here are a few examples of commonly occurring filtering chains to
1137 illustrate the workings of CUPS.
1139 Assume you want to print a PDF file to a HP JetDirect-connected
1140 PostScript printer, but you want to print the pages
3-
5,
7,
11-
13
1141 only, and you want to print them
"2-up
" and
"duplex
":
1142 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p>your print options (page selection as required,
2-up,
1143 duplex) are passed to CUPS on the commandline;
</p></li><li><p>the (complete) PDF file is sent to CUPS and autotyped as
1144 <span class=
"emphasis"><em>application/pdf
</em></span>;
</p></li><li><p>the file therefore first must pass the
1145 <span class=
"emphasis"><em>pdftops
</em></span> pre-filter, which produces PostScript
1146 MIME type
<span class=
"emphasis"><em>application/postscript
</em></span> (a preview here
1147 would still show all pages of the original PDF);
</p></li><li><p>the file then passes the
<span class=
"emphasis"><em>pstops
</em></span>
1148 filter which applies the commandline options: it selects the pages
1149 2-
5,
7 and
11-
13, creates and imposed layout
"2 pages on
1 sheet
" and
1150 inserts the correct
"duplex
" command (as is defined in the printer's
1151 PPD) into the new PostScript file; the file now is of PostScript MIME
1153 <span class=
"emphasis"><em>application/vnd.cups-postscript
</em></span>;
</p></li><li><p>the file goes to the
<span class=
"emphasis"><em>socket
</em></span>
1154 backend, which transfers the job to the printers.
</p></li></ul></div><p>
1155 The resulting filter chain therefore is:
1156 </p><pre class=
"screen">
1157 pdftops --
> pstops --
> socket
1159 Assume your want to print the same filter to an USB-connected
1160 Epson Stylus Photo printer, installed with the CUPS
1161 <tt class=
"filename">stphoto2.ppd
</tt>. The first few filtering stages
1162 are nearly the same:
1163 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p>your print options (page selection as required,
2-up,
1164 duplex) are passed to CUPS on the commandline;
</p></li><li><p>the (complete) PDF file is sent to CUPS and autotyped as
1165 <span class=
"emphasis"><em>application/pdf
</em></span>;
</p></li><li><p>the file therefore first must pass the
1166 <span class=
"emphasis"><em>pdftops
</em></span> pre-filter, which produces PostScript
1167 MIME type
<span class=
"emphasis"><em>application/postscript
</em></span> (a preview here
1168 would still show all pages of the original PDF);
</p></li><li><p>the file then passes the
"pstops
" filter which applies
1169 the commandline options: it selects the pages
2-
5,
7 and
11-
13,
1170 creates and imposed layout
"2 pages on
1 sheet
" and inserts the
1171 correct
"duplex
" command... (OOoops -- this printer and his PPD
1172 don't support duplex printing at all -- this option will be ignored
1173 then) into the new PostScript file; the file now is of PostScript
1175 <span class=
"emphasis"><em>application/vnd.cups-postscript
</em></span>;
</p></li><li><p>the file then passes the
1176 <span class=
"emphasis"><em>pstoraster
</em></span> stage and becomes MIME type
1177 <span class=
"emphasis"><em>application/cups-raster
</em></span>;
</p></li><li><p>finally, the
<span class=
"emphasis"><em>rastertoepson
</em></span> filter
1178 does its work (as is indicated in the printer's PPD), creating the
1179 printer-specific raster data and embedding any user-selected
1180 print-options into the print data stream;
</p></li><li><p>the file goes to the
<span class=
"emphasis"><em>usb
</em></span> backend,
1181 which transfers the job to the printers.
</p></li></ul></div><p>
1182 The resulting filter chain therefore is:
1183 </p><pre class=
"screen">
1184 pdftops --
> pstops --
> pstoraster --
> rastertoepson --
> usb
1185 </pre></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2957897"></a>Sources of CUPS drivers / PPDs
</h3></div></div><div></div></div><p>
1186 On the internet you can find now many thousand CUPS-PPD files
1187 (with their companion filters), in many national languages,
1188 supporting more than
1000 non-PostScript models.
1189 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p><a href=
"http://wwwl.easysw.com/printpro/" target=
"_top">ESP
1190 PrintPro (http://wwwl.easysw.com/printpro/)
</a> (commercial,
1191 non-Free) is packaged with more than
3000 PPDs, ready for
1192 successful use
"out of the box
" on Linux, Mac OS X, IBM-AIX,
1193 HP-UX, Sun-Solaris, SGI-IRIX, Compaq Tru64, Digital Unix and some
1194 more commercial Unices (it is written by the CUPS developers
1195 themselves and its sales help finance the further development of
1196 CUPS, as they feed their creators).
</p></li><li><p>the
<a href=
"http://gimp-print.sourceforge.net/" target=
"_top">Gimp-Print-Project
1197 (http://gimp-print.sourceforge.net/)
</a> (GPL, Free Software)
1198 provides around
140 PPDs (supporting nearly
400 printers, many driven
1199 to photo quality output), to be used alongside the Gimp-Print CUPS
1200 filters;
</p></li><li><p><a href=
"http://www.turboprint.com/" target=
"_top">TurboPrint
1201 (http://www.turboprint.com/)
</a> (Shareware, non-Free) supports
1202 roughly the same amount of printers in excellent
1203 quality;
</p></li><li><p><a href=
"http://www-124.ibm.com/developerworks/oss/linux/projects/omni/" target=
"_top">OMNI
1204 (http://www-
124.ibm.com/developerworks/oss/linux/projects/omni/)
</a>
1205 (LPGL, Free) is a package made by IBM, now containing support for more
1206 than
400 printers, stemming from the inheritance of IBM OS/
2 Know-How
1207 ported over to Linux (CUPS support is in a Beta-stage at
1208 present);
</p></li><li><p><a href=
"http://hpinkjet.sourceforge.net/" target=
"_top">HPIJS
1209 (http://hpinkjet.sourceforge.net/)
</a> (BSD-style licenses, Free)
1210 supports around
150 of HP's own printers and is also providing
1211 excellent print quality now (currently available only via the Foomatic
1212 path);
</p></li><li><p><a href=
"http://www.linuxprinting.org/" target=
"_top">Foomatic/cupsomatic
1213 (http://www.linuxprinting.org/)
</a> (LPGL, Free) from
1214 Linuxprinting.org are providing PPDs for practically every Ghostscript
1215 filter known to the world (including Omni, Gimp-Print and
1216 HPIJS).
</p></li></ul></div><div class=
"note" style=
"margin-left: 0.5in; margin-right: 0.5in;"><h3 class=
"title">Note
</h3><p>
1217 The cupsomatic/Foomatic trick from Linuxprinting.org works
1218 differently from the other drivers. This is explained elsewhere in this
1220 </p></div></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2958024"></a>Printing with Interface Scripts
</h3></div></div><div></div></div><p>
1221 CUPS also supports the usage of
"interface scripts
" as known from
1222 System V AT
&T printing systems. These are often used for PCL
1223 printers, from applications that generate PCL print jobs. Interface
1224 scripts are specific to printer models. They have a similar role as
1225 PPDs for PostScript printers. Interface scripts may inject the Escape
1226 sequences as required into the print data stream, if the user has
1227 chosen to select a certain paper tray, or print landscape, or use A3
1228 paper, etc. Interfaces scripts are practically unknown in the Linux
1229 realm. On HP-UX platforms they are more often used. You can use any
1230 working interface script on CUPS too. Just install the printer with
1231 the
<b class=
"command">-i
</b> option:
1232 </p><pre class=
"screen">
1234 lpadmin -p pclprinter -v socket://
11.12.13.14:
9100 -i /path/to/interface-script
1237 Interface scripts might be the
"unknown animal
" to many. However,
1238 with CUPS they provide the most easy way to plug in your own
1239 custom-written filtering script or program into one specific print
1240 queue (some information about the traditional usage of interface scripts is
1241 to be found at
<a href=
"http://playground.sun.com/printing/documentation/interface.html" target=
"_top">http://playground.sun.com/printing/documentation/interface.html
</a>).
1242 </p></div></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><div><h2 class=
"title" style=
"clear: both"><a name=
"id2958100"></a>Network printing (purely Windows)
</h2></div></div><div></div></div><p>
1243 Network printing covers a lot of ground. To understand what exactly
1244 goes on with Samba when it is printing on behalf of its Windows
1245 clients, let's first look at a
"purely Windows
" setup: Windows clients
1246 with a Windows NT print server.
1247 </p><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2958116"></a>From Windows Clients to an NT Print Server
</h3></div></div><div></div></div><p>
1248 Windows clients printing to an NT-based print server have two
1250 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p>execute the driver locally and render the GDI output
1251 (EMF) into the printer specific format on their own,
1252 or
</p></li><li><p>send the GDI output (EMF) to the server, where the
1253 driver is executed to render the printer specific
1254 output.
</p></li></ul></div><p>
1255 Both print paths are shown in the flowcharts below.
1256 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2958155"></a>Driver Execution on the Client
</h3></div></div><div></div></div><p>
1257 In the first case the print server must spool the file as
"raw
",
1258 meaning it shouldn't touch the jobfile and try to convert it in any
1259 way. This is what traditional Unix-based print server can do too; and
1260 at a better performance and more reliably than NT print server. This
1261 is what most Samba administrators probably are familiar with. One
1262 advantage of this setup is that this
"spooling-only
" print server may
1263 be used even if no driver(s) for Unix are available it is sufficient
1264 to have the Windows client drivers available and installed on the
1267 </p><div class=
"figure"><a name=
"id2958191"></a><p class=
"title"><b>Figure
19.11. Print Driver execution on the Client
</b></p><div class=
"mediaobject"><img src=
"projdoc/imagefiles/11small.png" alt=
"Print Driver execution on the Client"></div></div><p>
1268 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2958227"></a>Driver Execution on the Server
</h3></div></div><div></div></div><p>
1269 The other path executes the printer driver on the server. The clients
1270 transfers print files in EMF format to the server. The server uses the
1271 PostScript, PCL, ESC/P or other driver to convert the EMF file into
1272 the printer-specific language. It is not possible for Unix to do the
1273 same. Currently there is no program or method to convert a Windows
1274 client's GDI output on a Unix server into something a printer could
1277 </p><div class=
"figure"><a name=
"id2958249"></a><p class=
"title"><b>Figure
19.12. Print Driver execution on the Server
</b></p><div class=
"mediaobject"><img src=
"projdoc/imagefiles/12small.png" alt=
"Print Driver execution on the Server"></div></div><p>
1279 However, there is something similar possible with CUPS. Read on...
1280 </p></div></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><div><h2 class=
"title" style=
"clear: both"><a name=
"id2958289"></a>Network Printing (Windows clients -- UNIX/Samba Print
1281 Servers)
</h2></div></div><div></div></div><p>
1282 Since UNIX print servers
<span class=
"emphasis"><em>cannot
</em></span> execute the Win32
1283 program code on their platform, the picture is somewhat
1284 different. However, this doesn't limit your options all that
1285 much. In the contrary, you may have a way here to implement printing
1286 features which are not possible otherwise.
1287 </p><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2958310"></a>From Windows Clients to a CUPS/Samba Print Server
</h3></div></div><div></div></div><p>
1288 Here is a simple recipe showing how you can take advantage of CUPS
1289 powerful features for the benefit of your Windows network printing
1291 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p>Let the Windows clients send PostScript to the CUPS
1292 server.
</p></li><li><p>Let the CUPS server render the PostScript into device
1293 specific raster format.
</p></li></ul></div><p>
1294 This requires the clients to use a PostScript driver (even if the
1295 printer is a non-PostScript model. It also requires that you have a
1296 "driver
" on the CUPS server.
1298 Firstly, to enable CUPS based printing through Samba the
1299 following options should be set in your
<tt class=
"filename">smb.conf
</tt> file [globals]
1301 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p><i class=
"parameter"><tt>printing = CUPS
</tt></i></p></li><li><p><i class=
"parameter"><tt>printcap = CUPS
</tt></i></p></li></ul></div><p>
1302 When these parameters are specified, all manually set print directives
1303 (like
<i class=
"parameter"><tt>print command =...
</tt></i>, or
<i class=
"parameter"><tt>lppause
1304 command =...
</tt></i>) in
<tt class=
"filename">smb.conf
</tt> (as well as
1305 in samba itself) will be ignored. Instead, Samba will directly
1306 interface with CUPS through it's application program interface (API) -
1307 as long as Samba has been compiled with CUPS library (libcups)
1308 support. If Samba has NOT been compiled with CUPS support, and if no
1309 other print commands are set up, then printing will use the
1310 <span class=
"emphasis"><em>System V
</em></span> AT
&T command set, with the -oraw
1311 option automatically passing through (if you want your own defined
1312 print commands to work with a Samba that has CUPS support compiled in,
1313 simply use
<i class=
"parameter"><tt>printing = sysv
</tt></i>).
1315 </p><div class=
"figure"><a name=
"id2958439"></a><p class=
"title"><b>Figure
19.13. Printing via CUPS/samba server
</b></p><div class=
"mediaobject"><img src=
"projdoc/imagefiles/13small.png" alt=
"Printing via CUPS/samba server"></div></div><p>
1316 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2958474"></a>Samba receiving Jobfiles and passing them to CUPS
</h3></div></div><div></div></div><p>
1317 Samba
<span class=
"emphasis"><em>must
</em></span> use its own spool directory (it is set
1318 by a line similar to
<i class=
"parameter"><tt>path = /var/spool/samba
</tt></i>,
1319 in the
<i class=
"parameter"><tt>[printers]
</tt></i> or
1320 <i class=
"parameter"><tt>[printername]
</tt></i> section of
1321 <tt class=
"filename">smb.conf
</tt>). Samba receives the job in its own
1322 spool space and passes it into the spool directory of CUPS (the CUPS
1323 spooling directory is set by the
<i class=
"parameter"><tt>RequestRoot
</tt></i>
1324 directive, in a line that defaults to
<i class=
"parameter"><tt>RequestRoot
1325 /var/spool/cups
</tt></i>). CUPS checks the access rights of its
1326 spool dir and resets it to healthy values with every re-start. We have
1327 seen quite some people who had used a common spooling space for Samba
1328 and CUPS, and were struggling for weeks with this
"problem
".
1330 A Windows user authenticates only to Samba (by whatever means is
1331 configured). If Samba runs on the same host as CUPS, you only need to
1332 allow
"localhost
" to print. If they run on different machines, you
1333 need to make sure the Samba host gets access to printing on CUPS.
1334 </p></div></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><div><h2 class=
"title" style=
"clear: both"><a name=
"id2958550"></a>Network PostScript RIP: CUPS Filters on Server -- clients use
1335 PostScript Driver with CUPS-PPDs
</h2></div></div><div></div></div><p>
1336 PPDs can control all print device options. They are usually provided
1337 by the manufacturer; if you own a PostScript printer, that is. PPD
1338 files (PostScript Printer Descriptions) are always a component of
1339 PostScript printer drivers on MS Windows or Apple Mac OS systems. They
1340 are ASCII files containing user-selectable print options, mapped to
1341 appropriate PostScript, PCL or PJL commands for the target
1342 printer. Printer driver GUI dialogs translate these options
1343 "on-the-fly
" into buttons and drop-down lists for the user to select.
1345 CUPS can load, without any conversions, the PPD file from any Windows
1346 (NT is recommended) PostScript driver and handle the options. There is
1347 a web browser interface to the print options (select
<a href=
"http://localhost:631/printers/" target=
"_top">http://localhost:
631/printers/
</a>
1348 and click on one
<span class=
"emphasis"><em>Configure Printer
</em></span> button to see
1349 it), or a commandline interface (see
<b class=
"command">man lpoptions
</b>
1350 or see if you have lphelp on your system). There are also some
1351 different GUI frontends on Linux/UNIX, which can present PPD options
1352 to users. PPD options are normally meant to be evaluated by the
1353 PostScript RIP on the real PostScript printer.
1354 </p><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2958605"></a>PPDs for non-PS Printers on UNIX
</h3></div></div><div></div></div><p>
1355 CUPS doesn't limit itself to
"real
" PostScript printers in its usage
1356 of PPDs. The CUPS developers have extended the scope of the PPD
1357 concept, to also describe available device and driver options for
1358 non-PostScript printers through CUPS-PPDs.
1360 This is logical, as CUPS includes a fully featured PostScript
1361 interpreter (RIP). This RIP is based on Ghostscript. It can process
1362 all received PostScript (and additionally many other file formats)
1363 from clients. All CUPS-PPDs geared to non-PostScript printers contain
1364 an additional line, starting with the keyword
1365 <i class=
"parameter"><tt>*cupsFilter
</tt></i> . This line tells the CUPS print
1366 system which printer-specific filter to use for the interpretation of
1367 the supplied PostScript. Thus CUPS lets all its printers appear as
1368 PostScript devices to its clients, because it can act as a PostScript
1369 RIP for those printers, processing the received PostScript code into a
1370 proper raster print format.
1371 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2958646"></a>PPDs for non-PS Printers on Windows
</h3></div></div><div></div></div><p>
1372 CUPS-PPDs can also be used on Windows-Clients, on top of a
1373 "core
" PostScript driver (now recommended is the
"CUPS PostScript
1374 Driver for WindowsNT/
2K/XP
"; you can also use the Adobe one, with
1375 limitations). This feature enables CUPS to do a few tricks no other
1377 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p>act as a networked PostScript RIP (Raster Image
1378 Processor), handling printfiles from all client platforms in a uniform
1379 way;
</p></li><li><p>act as a central accounting and billing server, since
1380 all files are passed through the pstops filter and are therefore
1381 logged in the CUPS
<tt class=
"filename">page_log
</tt> file.
1382 <span class=
"emphasis"><em>NOTE:
</em></span> this can not happen with
"raw
" print jobs,
1383 which always remain unfiltered per definition;
</p></li><li><p>enable clients to consolidate on a single PostScript
1384 driver, even for many different target printers.
</p></li></ul></div><p>
1385 Using CUPS PPDs on Windows clients enables these to control
1386 all print job settings just as a UNIX client can do too.
1387 </p></div></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><div><h2 class=
"title" style=
"clear: both"><a name=
"id2958712"></a>Windows Terminal Servers (WTS) as CUPS Clients
</h2></div></div><div></div></div><p>
1388 This setup may be of special interest to people experiencing major
1389 problems in WTS environments. WTS need often a multitude of
1390 non-PostScript drivers installed to run their clients' variety of
1391 different printer models. This often imposes the price of much
1392 increased instability.
1393 </p><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2958729"></a>Printer Drivers running in
"Kernel Mode
" cause many
1394 Problems
</h3></div></div><div></div></div><p>
1395 The reason is that in Win NT printer drivers run in
"Kernel
1396 Mode
", this introduces a high risk for the stability of the system
1397 if the driver is not really stable and well-tested. And there are a
1398 lot of bad drivers out there! Especially notorious is the example
1399 of the PCL printer driver that had an additional sound module
1400 running, to notify users via soundcard of their finished jobs. Do I
1401 need to say that this one was also reliably causing
"Blue Screens
1402 of Death
" on a regular basis?
1404 PostScript drivers generally are very well tested. They are not known
1405 to cause any problems, even though they run in Kernel Mode too. This
1406 might be because there have so far only been
2 different PostScript
1407 drivers the ones from Adobe and the one from Microsoft. Both are
1408 very well tested and are as stable as you ever can imagine on
1409 Windows. The CUPS driver is derived from the Microsoft one.
1410 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2958763"></a>Workarounds impose Heavy Limitations
</h3></div></div><div></div></div><p>
1411 In many cases, in an attempt to work around this problem, site
1412 administrators have resorted to restrict the allowed drivers installed
1413 on their WTS to one generic PCL- and one PostScript driver. This
1414 however restricts the clients in the amount of printer options
1415 available for them; often they can't get out more than simplex
1416 prints from one standard paper tray, while their devices could do much
1417 better, if driven by a different driver! )
1418 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2958784"></a>CUPS: a
"Magical Stone
"?
</h3></div></div><div></div></div><p>
1419 Using a PostScript driver, enabled with a CUPS-PPD, seems to be a very
1420 elegant way to overcome all these shortcomings. There are, depending
1421 on the version of Windows OS you use, up to
3 different PostScript
1422 drivers available: Adobe, Microsoft and CUPS PostScript drivers. None
1423 of them is known to cause major stability problems on WTS (even if
1424 used with many different PPDs). The clients will be able to (again)
1425 chose paper trays, duplex printing and other settings. However, there
1426 is a certain price for this too: a CUPS server acting as a PostScript
1427 RIP for its clients requires more CPU and RAM than when just acting as
1428 a
"raw spooling
" device. Plus, this setup is not yet widely tested,
1429 although the first feedbacks look very promising.
1430 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2958811"></a>PostScript Drivers with no major problems -- even in Kernel
1431 Mode
</h3></div></div><div></div></div><p>
1432 More recent printer drivers on W2K and XP don't run in Kernel mode
1433 (unlike Win NT) any more. However, both operating systems can still
1434 use the NT drivers, running in Kernel mode (you can roughly tell which
1435 is which as the drivers in subdirectory
"2" of
"W32X86
" are
"old
"
1436 ones). As was said before, the Adobe as well as the Microsoft
1437 PostScript drivers are not known to cause any stability problems. The
1438 CUPS driver is derived from the Microsoft one. There is a simple
1439 reason for this: The MS DDK (Device Development Kit) for Win NT (which
1440 used to be available at no cost to licensees of Visual Studio)
1441 includes the source code of the Microsoft driver, and licensees of
1442 Visual Studio are allowed to use and modify it for their own driver
1443 development efforts. This is what the CUPS people have done. The
1444 license doesn't allow them to publish the whole of the source code.
1445 However, they have released the
"diff
" under the GPL, and if you are
1446 owner of an
"MS DDK for Win NT
", you can check the driver yourself.
1447 </p></div></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><div><h2 class=
"title" style=
"clear: both"><a name=
"id2958865"></a> Setting up CUPS for driver Download
</h2></div></div><div></div></div><p>
1448 As we have said before: all previously known methods to prepare client
1449 printer drivers on the Samba server for download and
"Point'n'Print
"
1450 convenience of Windows workstations are working with CUPS too. These
1451 methods were described in the previous chapter. In reality, this is a
1452 pure Samba business, and only relates to the Samba/Win client
1454 </p><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2958884"></a><span class=
"emphasis"><em>cupsaddsmb
</em></span>: the unknown Utility
</h3></div></div><div></div></div><p>
1455 The cupsaddsmb utility (shipped with all current CUPS versions) is an
1456 alternative method to transfer printer drivers into the Samba
1457 <i class=
"parameter"><tt>[print$]
</tt></i> share. Remember, this share is where
1458 clients expect drivers deposited and setup for download and
1459 installation. It makes the sharing of any (or all) installed CUPS
1460 printers very easy. cupsaddsmb can use the Adobe PostScript driver as
1461 well as the newly developed
<span class=
"emphasis"><em>CUPS PostScript Driver for
1462 WinNT/
2K/XP
</em></span>. Note, that cupsaddsmb does
1463 <span class=
"emphasis"><em>not
</em></span> work with arbitrary vendor printer drivers,
1464 but only with the
<span class=
"emphasis"><em>exact
</em></span> driver files that are
1465 named in its man page.
1467 The CUPS printer driver is available from the CUPS download site. Its
1468 package name is
<tt class=
"filename">cups-samba-[version].tar.gz
</tt> . It
1469 is preferred over the Adobe drivers since it has a number of
1471 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p>it supports a much more accurate page
1472 accounting;
</p></li><li><p>it supports banner pages, and page labels on all
1473 printers;
</p></li><li><p>it supports the setting of a number of job IPP
1474 attributes (such as job-priority, page-label and
1475 job-billing)
</p></li></ul></div><p>
1476 However, currently only Windows NT,
2000, and XP are supported by the
1477 CUPS drivers. You will need to get the respective part of Adobe driver
1478 too if you need to support Windows
95,
98, and ME clients.
1479 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2958976"></a>Prepare your
<tt class=
"filename">smb.conf
</tt> for
1480 cupsaddsmb
</h3></div></div><div></div></div><p>
1481 Prior to running cupsaddsmb, you need the following settings in
1482 <tt class=
"filename">smb.conf
</tt>:
1483 </p><pre class=
"screen">
1488 printcap name = cups
1491 comment = All Printers
1492 path = /var/spool/samba
1495 guest ok = yes # setting depends on your requirements
1498 printer admin = root
1501 comment = Printer Drivers
1502 path = /etc/samba/drivers
1508 </pre></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2959022"></a>CUPS Package of
"PostScript Driver for WinNT/
2k/XP
"</h3></div></div><div></div></div><p>
1509 CUPS users may get the exactly same packages from
<a href=
"http://www.cups.org/software.html" target=
"_top"><span class=
"emphasis"><em>http://www.cups.org/software.html
</em></span></a>.
1510 It is a separate package from the CUPS base software files, tagged as
1511 <span class=
"emphasis"><em>CUPS
1.1.x Windows NT/
2k/XP Printer Driver for SAMBA
1512 (tar.gz,
192k)
</em></span>. The filename to download is
1513 <tt class=
"filename">cups-samba-
1.1.x.tar.gz
</tt>. Upon untar-/unzip-ing,
1514 it will reveal these files:
1515 </p><pre class=
"screen">
1517 # tar xvzf cups-samba-
1.1.19.tar.gz
1526 These have been packaged with the ESP meta packager software
1527 "EPM
". The
<tt class=
"filename">*.install
</tt> and
1528 <tt class=
"filename">*.remove
</tt> files are simple shell scripts, which
1529 untars the
<tt class=
"filename">*.ss
</tt> (the
<tt class=
"filename">*.ss
</tt> is
1530 nothing else but a tar-archive, which can be untar-ed by
"tar
"
1531 too). Then it puts the content into
1532 <tt class=
"filename">/usr/share/cups/drivers/
</tt>. This content includes
3
1534 </p><pre class=
"screen">
1536 # tar tv cups-samba.ss
1543 The
<span class=
"emphasis"><em>cups-samba.install
</em></span> shell scripts is easy to
1545 </p><pre class=
"screen">
1547 # ./cups-samba.install
1550 Installing software...
1551 Updating file permissions...
1552 Running post-install commands...
1553 Installation is complete.
1556 The script should automatically put the driver files into the
1557 <tt class=
"filename">/usr/share/cups/drivers/
</tt> directory.
1558 </p><div class=
"warning" style=
"margin-left: 0.5in; margin-right: 0.5in;"><h3 class=
"title">Warning
</h3><p>
1559 Due to a bug, one recent CUPS release puts the
1560 <tt class=
"filename">cups.hlp
</tt> driver file
1561 into
<tt class=
"filename">/usr/share/drivers/
</tt> instead of
1562 <tt class=
"filename">/usr/share/cups/drivers/
</tt>. To work around this,
1563 copy/move the file (after running the
1564 <b class=
"command">./cups-samba.install
</b> script) manually to the
1566 </p></div><pre class=
"screen">
1568 cp /usr/share/drivers/cups.hlp /usr/share/cups/drivers/
1571 This new CUPS PostScript driver is currently binary-only, but free of
1572 charge. No complete source code is provided (yet). The reason is this:
1573 it has been developed with the help of the
<span class=
"emphasis"><em>Microsoft Driver
1574 Developer Kit
</em></span> (DDK) and compiled with Microsoft Visual
1575 Studio
6. Driver developers are not allowed to distribute the whole of
1576 the source code as Free Software. However, CUPS developers released
1577 the
"diff
" in source code under the GPL, so anybody with a license of
1578 Visual Studio and a DDK will be able to compile for him/herself.
1579 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2959220"></a>Recognize the different Driver Files
</h3></div></div><div></div></div><p>
1580 The CUPS drivers don't support the
"older
" Windows
95/
98/ME, but only
1581 the Windows NT/
2000/XP client:
1582 </p><pre class=
"screen">
1584 [Windows NT,
2000, and XP are supported by:]
1590 Adobe drivers are available for the older Windows
95/
98/ME as well as
1591 the Windows NT/
2000/XP clients. The set of files is different for the
1592 different platforms.
1593 </p><pre class=
"screen">
1595 [Windows
95,
98, and Me are supported by:]
1603 [Windows NT,
2000, and XP are supported by:]
1608 </pre><div class=
"note" style=
"margin-left: 0.5in; margin-right: 0.5in;"><h3 class=
"title">Note
</h3><p>
1609 If both, the Adobe driver files and the CUPS driver files for the
1610 support of WinNT/
2k/XP are present in , the Adobe ones will be ignored
1611 and the CUPS ones will be used. If you prefer -- for whatever reason
1612 -- to use Adobe-only drivers, move away the
3 CUPS driver files. The
1613 Win95/
98/ME clients use the Adobe drivers in any case.
1614 </p></div></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2959278"></a>Acquiring the Adobe Driver Files
</h3></div></div><div></div></div><p>
1615 Acquiring the Adobe driver files seems to be unexpectedly difficult
1616 for many users. They are not available on the Adobe website as single
1617 files and the self-extracting and/or self-installing Windows-exe is
1618 not easy to locate either. Probably you need to use the included
1619 native installer and run the installation process on one client
1620 once. This will install the drivers (and one Generic PostScript
1621 printer) locally on the client. When they are installed, share the
1622 Generic PostScript printer. After this, the client's
1623 <i class=
"parameter"><tt>[print$]
</tt></i> share holds the Adobe files, from
1624 where you can get them with smbclient from the CUPS host. A more
1625 detailed description about this is in the next (the CUPS printing)
1627 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2959310"></a>ESP Print Pro Package of
"PostScript Driver for
1628 WinNT/
2k/XP
"</h3></div></div><div></div></div><p>
1629 Users of the ESP Print Pro software are able to install their
"Samba
1630 Drivers
" package for this purpose with no problem. Retrieve the driver
1631 files from the normal download area of the ESP Print Pro software
1632 at
<a href=
"http://www.easysw.com/software.html" target=
"_top">http://www.easysw.com/software.html
</a>.
1633 You need to locate the link labelled
"SAMBA
" amongst the
1634 <span class=
"emphasis"><em>Download Printer Drivers for ESP Print Pro
4.x
</em></span>
1635 area and download the package. Once installed, you can prepare any
1636 driver by simply highlighting the printer in the Printer Manager GUI
1637 and select
<span class=
"emphasis"><em>Export Driver...
</em></span> from the menu. Of
1638 course you need to have prepared Samba beforehand too to handle the
1639 driver files; i.e. mainly setup the
<i class=
"parameter"><tt>[print$]
</tt></i>
1640 share, etc. The ESP Print Pro package includes the CUPS driver files
1641 as well as a (licensed) set of Adobe drivers for the Windows
95/
98/ME
1643 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2959360"></a>Caveats to be considered
</h3></div></div><div></div></div><p>
1644 Once you have run the install script (and possibly manually
1645 moved the
<tt class=
"filename">cups.hlp
</tt> file to
1646 <tt class=
"filename">/usr/share/cups/drivers/
</tt>), the driver is
1647 ready to be put into Samba's
<i class=
"parameter"><tt>[print$]
</tt></i> share (which often maps to
1648 <tt class=
"filename">/etc/samba/drivers/
</tt> and contains a subdir
1649 tree with
<span class=
"emphasis"><em>WIN40
</em></span> and
1650 <span class=
"emphasis"><em>W32X86
</em></span> branches): You do this by running
1651 "cupsaddsmb
" (see also
<b class=
"command">man cupsaddsmb
</b> for
1652 CUPS since release
1.1.16).
1653 </p><div class=
"tip" style=
"margin-left: 0.5in; margin-right: 0.5in;"><h3 class=
"title">Tip
</h3><p>
1654 You may need to put root into the smbpasswd file by running
1655 <b class=
"command">smbpasswd
</b>; this is especially important if you
1656 should run this whole procedure for the first time, and are not
1657 working in an environment where everything is configured for
1658 <span class=
"emphasis"><em>Single Sign On
</em></span> to a Windows Domain Controller.
1660 Once the driver files are in the
<i class=
"parameter"><tt>[print$]
</tt></i> share
1661 and are initialized, they are ready to be downloaded and installed by
1662 the Win NT/
2k/XP clients.
1663 </p><div class=
"note" style=
"margin-left: 0.5in; margin-right: 0.5in;"><h3 class=
"title">Note
</h3><p>
1664 </p><div class=
"orderedlist"><ol type=
"1"><li><p>
1665 Win
9x/ME clients won't work with the CUPS PostScript driver. For
1666 these you'd still need to use the
<tt class=
"filename">ADOBE*.*
</tt>
1667 drivers as previously.
1669 It is not harmful if you still have the
1670 <tt class=
"filename">ADOBE*.*
</tt> driver files from previous
1671 installations in the
<tt class=
"filename">/usr/share/cups/drivers/
</tt>
1672 directory. The new
<span class=
"emphasis"><em>cupsaddsmb
</em></span> (from
1.1.16) will
1673 automatically prefer
"its own
" drivers if it finds both.
1675 Should your Win clients have had the old
<tt class=
"filename">ADOBE*.*
</tt>
1676 files for the Adobe PostScript driver installed, the download and
1677 installation of the new CUPS PostScript driver for Windows NT/
2k/XP
1678 will fail at first. You need to wipe the old driver from the clients
1679 first. It is not enough to
"delete
" the printer, as the driver files
1680 will still be kept by the clients and re-used if you try to re-install
1681 the printer. To really get rid of the Adobe driver files on the
1682 clients, open the
"Printers
" folder (possibly via
<span class=
"emphasis"><em>Start
1683 --
> Settings --
> Control Panel --
> Printers
</em></span>),
1684 right-click onto the folder background and select
<span class=
"emphasis"><em>Server
1685 Properties
</em></span>. When the new dialog opens, select the
1686 <span class=
"emphasis"><em>Drivers
</em></span> tab. On the list select the driver you
1687 want to delete and click on the
<span class=
"emphasis"><em>Delete
</em></span>
1688 button. This will only work if there is not one single printer left
1689 which uses that particular driver. You need to
"delete
" all printers
1690 using this driver in the
"Printers
" folder first. You will need
1691 Administrator privileges to do this.
1693 Once you have successfully downloaded the CUPS PostScript driver to a
1694 client, you can easily switch all printers to this one by proceeding
1695 as described elsewhere in the
"Samba HOWTO Collection
": either change
1696 a driver for an existing printer by running the
"Printer Properties
"
1697 dialog, or use
<b class=
"command">rpcclient
</b> with the
1698 <b class=
"command">setdriver
</b> sub-command.
1699 </p></li></ol></div><p>
1700 </p></div></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2959582"></a>What are the Benefits of using the
"CUPS PostScript Driver for
1701 Windows NT/
2k/XP
" as compared to the Adobe Driver?
</h3></div></div><div></div></div><p>
1702 You are interested in a comparison between the CUPS and the Adobe
1703 PostScript drivers? For our purposes these are the most important
1704 items which weigh in favor of the CUPS ones:
1705 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p>no hassle with the Adobe EULA
</p></li><li><p>no hassle with the question
“<span class=
"quote">Where do I
1706 get the ADOBE*.* driver files from?
</span>”</p></li><li><p>the Adobe drivers (on request of the printer PPD
1707 associated with them) often put a PJL header in front of the main
1708 PostScript part of the print file. Thus the printfile starts with
1709 <i class=
"parameter"><tt><1B
>%-
12345X
</tt></i> or
1710 <i class=
"parameter"><tt><escape
>%-
12345X
</tt></i> instead
1711 of
<i class=
"parameter"><tt>%!PS
</tt></i>). This leads to the
1712 CUPS daemon auto-typing the incoming file as a print-ready file,
1713 not initiating a pass through the
"pstops
" filter (to speak more
1714 technically, it is not regarded as the generic MIME type
1715 <span class=
"emphasis"><em>application/postscript
</em></span>, but as
1716 the more special MIME type
1717 <span class=
"emphasis"><em>application/cups.vnd-postscript
</em></span>),
1718 which therefore also leads to the page accounting in
1719 <span class=
"emphasis"><em>/var/log/cups/page_log
</em></span> not
1720 receiving the exact number of pages; instead the dummy page number
1721 of
"1" is logged in a standard setup)
</p></li><li><p>the Adobe driver has more options to
"mis-configure
" the
1722 PostScript generated by it (like setting it inadvertently to
1723 <span class=
"emphasis"><em>Optimize for Speed
</em></span>, instead of
1724 <span class=
"emphasis"><em>Optimize for Portability
</em></span>, which
1725 could lead to CUPS being unable to process it)
</p></li><li><p>the CUPS PostScript driver output sent by Windows
1726 clients to the CUPS server will be guaranteed to be auto-typed always
1727 as generic MIME type
<span class=
"emphasis"><em>application/postscript
</em></span>,
1728 thusly passing through the CUPS
"pstops
" filter and logging the
1729 correct number of pages in the
<tt class=
"filename">page_log
</tt> for
1730 accounting and quota purposes
</p></li><li><p>the CUPS PostScript driver supports the sending of
1731 additional standard (IPP) print options by Win NT/
2k/XP clients. Such
1732 additional print options are: naming the CUPS standard
1733 <span class=
"emphasis"><em>banner pages
</em></span> (or the custom ones, should they be
1734 installed at the time of driver download), using the CUPS
1735 <span class=
"emphasis"><em>page-label
</em></span> option, setting a
1736 <span class=
"emphasis"><em>job-priority
</em></span> and setting the
<span class=
"emphasis"><em>scheduled
1737 time of printing
</em></span> (with the option to support additional
1738 useful IPP job attributes in the future).
</p></li><li><p>the CUPS PostScript driver supports the inclusion of
1739 the new
<span class=
"emphasis"><em>*cupsJobTicket
</em></span> comments at the
1740 beginning of the PostScript file (which could be used in the future
1741 for all sort of beneficial extensions on the CUPS side, but which will
1742 not disturb any other applications as they will regard it as a comment
1743 and simply ignore it).
</p></li><li><p>the CUPS PostScript driver will be the heart of the
1744 fully fledged CUPS IPP client for Windows NT/
2K/XP to be released soon
1745 (probably alongside the first Beta release for CUPS
1746 1.2).
</p></li></ul></div></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2959764"></a>Run
"cupsaddsmb
" (quiet Mode)
</h3></div></div><div></div></div><p>
1747 The cupsaddsmb command copies the needed files into your
1748 <i class=
"parameter"><tt>[print$]
</tt></i> share. Additionally, the PPD
1749 associated with this printer is copied from
1750 <tt class=
"filename">/etc/cups/ppd/
</tt> to
1751 <i class=
"parameter"><tt>[print$]
</tt></i>. There the files wait for convenient
1752 Windows client installations via Point'n'Print. Before we can run the
1753 command successfully, we need to be sure that we can authenticate
1754 towards Samba. If you have a small network you are probably using user
1755 level security (
<i class=
"parameter"><tt>security = user
</tt></i>). Probably your
1756 root has already a Samba account. Otherwise, create it now, using
1757 <b class=
"command">smbpasswd
</b>:
1758 </p><pre class=
"screen">
1761 New SMB password: [type in password 'secret']
1762 Retype new SMB password: [type in password 'secret']
1765 Here is an example of a successfully run cupsaddsmb command.
1766 </p><pre class=
"screen">
1768 # cupsaddsmb -U root infotec_IS2027
1769 Password for root required to access localhost via SAMBA: [type in password 'secret']
1772 To share
<span class=
"emphasis"><em>all
</em></span> printers and drivers, use the
1773 <i class=
"parameter"><tt>-a
</tt></i> parameter instead of a printer name. Since
1774 cupsaddsmb
"exports
" the printer drivers to Samba, it should be
1775 obvious that it only works for queues with a CUPS driver associated.
1776 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2959865"></a>Run
"cupsaddsmb
" with verbose Output
</h3></div></div><div></div></div><p>
1777 Probably you want to see what's going on. Use the
1778 <i class=
"parameter"><tt>-v
</tt></i> parameter to get a more verbose output. The
1779 output below was edited for better readability: all
"\
" at the end of
1780 a line indicate that I inserted an artificial line break plus some
1782 </p><div class=
"warning" style=
"margin-left: 0.5in; margin-right: 0.5in;"><h3 class=
"title">Warning
</h3><p>
1783 You will see the root password for the Samba account printed on
1784 screen. If you use remote access, the password will go over the wire
1786 </p></div><pre class=
"screen">
1788 # cupsaddsmb -U root -v infotec_2105
1789 Password for root required to access localhost via SAMBA:
1790 Running command: smbclient //localhost/print\$ -N -U'root%secret' -c 'mkdir W32X86;put \
1791 /var/spool/cups/tmp/
3e98bf2d333b5 W32X86/infotec_2105.ppd;put \
1792 /usr/share/cups/drivers/cupsdrvr.dll W32X86/cupsdrvr.dll;put \
1793 /usr/share/cups/drivers/cupsui.dll W32X86/cupsui.dll;put \
1794 /usr/share/cups/drivers/cups.hlp W32X86/cups.hlp'
1795 added interface ip=
10.160.51.60 bcast=
10.160.51.255 nmask=
255.255.252.0
1796 Domain=[CUPS-PRINT] OS=[Unix] Server=[Samba
2.2.7a]
1797 NT_STATUS_OBJECT_NAME_COLLISION making remote directory \W32X86
1798 putting file /var/spool/cups/tmp/
3e98bf2d333b5 as \W32X86/infotec_2105.ppd (
2328.8 kb/s) \
1799 (average
2328.8 kb/s)
1800 putting file /usr/share/cups/drivers/cupsdrvr.dll as \W32X86/cupsdrvr.dll (
9374.3 kb/s) \
1801 (average
5206.6 kb/s)
1802 putting file /usr/share/cups/drivers/cupsui.dll as \W32X86/cupsui.dll (
8107.2 kb/s) \
1803 (average
5984.1 kb/s)
1804 putting file /usr/share/cups/drivers/cups.hlp as \W32X86/cups.hlp (
3475.0 kb/s) \
1805 (average
5884.7 kb/s)
1807 Running command: rpcclient localhost -N -U'root%secret' -c 'adddriver
"Windows NT x86
" \
1808 "infotec_2105:cupsdrvr.dll:infotec_2105.ppd:cupsui.dll:cups.hlp:NULL: \
1810 cmd = adddriver
"Windows NT x86
" "infotec_2105:cupsdrvr.dll:infotec_2105.ppd:cupsui.dll: \
1811 cups.hlp:NULL:RAW:NULL
"
1812 Printer Driver infotec_2105 successfully installed.
1814 Running command: smbclient //localhost/print\$ -N -U'root%secret' -c 'mkdir WIN40;put \
1815 /var/spool/cups/tmp/
3e98bf2d333b5 WIN40/infotec_2105.PPD; put \
1816 /usr/share/cups/drivers/ADFONTS.MFM WIN40/ADFONTS.MFM;put \
1817 /usr/share/cups/drivers/ADOBEPS4.DRV WIN40/ADOBEPS4.DRV;put \
1818 /usr/share/cups/drivers/ADOBEPS4.HLP WIN40/ADOBEPS4.HLP;put \
1819 /usr/share/cups/drivers/DEFPRTR2.PPD WIN40/DEFPRTR2.PPD;put \
1820 /usr/share/cups/drivers/ICONLIB.DLL
1821 WIN40/ICONLIB.DLL;put /usr/share/cups/drivers/PSMON.DLL WIN40/PSMON.DLL;'
1822 added interface ip=
10.160.51.60 bcast=
10.160.51.255 nmask=
255.255.252.0
1823 Domain=[CUPS-PRINT] OS=[Unix] Server=[Samba
2.2.7a]
1824 NT_STATUS_OBJECT_NAME_COLLISION making remote directory \WIN40
1825 putting file /var/spool/cups/tmp/
3e98bf2d333b5 as \WIN40/infotec_2105.PPD (
2328.8 kb/s) \
1826 (average
2328.8 kb/s)
1827 putting file /usr/share/cups/drivers/ADFONTS.MFM as \WIN40/ADFONTS.MFM (
9368.0 kb/s) \
1828 (average
6469.6 kb/s)
1829 putting file /usr/share/cups/drivers/ADOBEPS4.DRV as \WIN40/ADOBEPS4.DRV (
9958.2 kb/s) \
1830 (average
8404.3 kb/s)
1831 putting file /usr/share/cups/drivers/ADOBEPS4.HLP as \WIN40/ADOBEPS4.HLP (
8341.5 kb/s) \
1832 (average
8398.6 kb/s)
1833 putting file /usr/share/cups/drivers/DEFPRTR2.PPD as \WIN40/DEFPRTR2.PPD (
2195.9 kb/s) \
1834 (average
8254.3 kb/s)
1835 putting file /usr/share/cups/drivers/ICONLIB.DLL as \WIN40/ICONLIB.DLL (
8239.9 kb/s) \
1836 (average
8253.6 kb/s)
1837 putting file /usr/share/cups/drivers/PSMON.DLL as \WIN40/PSMON.DLL (
6222.2 kb/s) \
1838 (average
8188.5 kb/s)
1840 Running command: rpcclient localhost -N -U'root%secret' -c 'adddriver
"Windows
4.0" \
1841 "infotec_2105:ADOBEPS4.DRV:infotec_2105.PPD:NULL:ADOBEPS4.HLP: \
1842 PSMON.DLL:RAW:ADOBEPS4.DRV,infotec_2105.PPD,ADOBEPS4.HLP,PSMON.DLL, \
1843 ADFONTS.MFM,DEFPRTR2.PPD,ICONLIB.DLL
"'
1844 cmd = adddriver
"Windows
4.0" "infotec_2105:ADOBEPS4.DRV:infotec_2105.PPD:NULL: \
1845 ADOBEPS4.HLP:PSMON.DLL:RAW:ADOBEPS4.DRV,infotec_2105.PPD,ADOBEPS4.HLP, \
1846 PSMON.DLL,ADFONTS.MFM,DEFPRTR2.PPD,ICONLIB.DLL
"
1847 Printer Driver infotec_2105 successfully installed.
1849 Running command: rpcclient localhost -N -U'root%secret' \
1850 -c 'setdriver infotec_2105 infotec_2105'
1851 cmd = setdriver infotec_2105 infotec_2105
1852 Successfully set infotec_2105 to driver infotec_2105.
1855 If you look closely, you'll discover your root password was transfered
1856 unencrypted over the wire, so beware! Also, if you look further her,
1857 you'll discover error messages like NT_STATUS_OBJECT_NAME_COLLISION in
1858 between. They occur, because the directories WIN40 and W32X86 already
1859 existed in the
<i class=
"parameter"><tt>[print$]
</tt></i> driver download share
1860 (from a previous driver installation). They are harmless here.
1861 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2960092"></a>Understanding cupsaddsmb
</h3></div></div><div></div></div><p>
1862 What has happened? What did cupsaddsmb do? There are five stages of
1864 </p><div class=
"orderedlist"><ol type=
"1"><li><p>call the CUPS server via IPP and request the
1865 driver files and the PPD file for the named printer;
</p></li><li><p>store the files temporarily in the local
1866 TEMPDIR (as defined in
1867 <tt class=
"filename">cupsd.conf
</tt>);
</p></li><li><p>connect via smbclient to the Samba server's
1868 <i class=
"parameter"><tt>[print$]
</tt></i> share and put the files into the
1869 share's WIN40 (for Win95/
98/ME) and W32X86/ (for WinNT/
2k/XP) sub
1870 directories;
</p></li><li><p>connect via rpcclient to the Samba server and
1871 execute the
"adddriver
" command with the correct
1872 parameters;
</p></li><li><p>connect via rpcclient to the Samba server a second
1873 time and execute the
"setdriver
" command.
</p></li></ol></div><p>
1874 Note, that you can run the cupsaddsmb utility with parameters to
1875 specify one remote host as Samba host and a second remote host as CUPS
1876 host. Especially if you want to get a deeper understanding, it is a
1877 good idea try it and see more clearly what is going on (though in real
1878 life most people will have their CUPS and Samba servers run on the
1880 </p><pre class=
"screen">
1882 # cupsaddsmb -H sambaserver -h cupsserver -v printername
1884 </pre></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2960186"></a>How to recognize if cupsaddsm completed successfully
</h3></div></div><div></div></div><p>
1885 You
<span class=
"emphasis"><em>must
</em></span> always check if the utility completed
1886 successfully in all fields. You need as a minimum these
3 messages
1888 </p><div class=
"orderedlist"><ol type=
"1"><li><p><span class=
"emphasis"><em>Printer Driver infotec_2105 successfully
1889 installed.
</em></span> # (for the W32X86 == WinNT/
2K/XP
1890 architecture...)
</p></li><li><p><span class=
"emphasis"><em>Printer Driver infotec_2105 successfully
1891 installed.
</em></span> # (for the WIN40 == Win9x/ME
1892 architecture...)
</p></li><li><p><span class=
"emphasis"><em>Successfully set [printerXPZ] to driver
1893 [printerXYZ].
</em></span></p></li></ol></div><p>
1894 These messages probably not easily recognized in the general
1895 output. If you run cupsaddsmb with the
<i class=
"parameter"><tt>-a
</tt></i>
1896 parameter (which tries to prepare
<span class=
"emphasis"><em>all
</em></span> active CUPS
1897 printer drivers for download), you might miss if individual printers
1898 drivers had problems to install properly. Here a redirection of the
1899 output will help you analyze the results in retrospective.
1900 </p><div class=
"note" style=
"margin-left: 0.5in; margin-right: 0.5in;"><h3 class=
"title">Note
</h3><p>
1901 It is impossible to see any diagnostic output if you don't run
1902 cupsaddsmb in verbose mode. Therefore we strongly recommend to not
1903 use the default quiet mode. It will hide any problems from you which
1905 </p></div></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2960273"></a>cupsaddsmb with a Samba PDC
</h3></div></div><div></div></div><p>
1906 You can't get the standard cupsaddsmb command to run on a Samba PDC?
1907 You are asked for the password credential all over again and again and
1908 the command just will not take off at all? Try one of these
1910 </p><pre class=
"screen">
1912 # cupsaddsmb -U DOMAINNAME\\root -v printername
1913 # cupsaddsmb -H SAMBA-PDC -U DOMAINNAME\\root -v printername
1914 # cupsaddsmb -H SAMBA-PDC -U DOMAINNAME\\root -h cups-server -v printername
1917 (Note the two backslashes: the first one is required to
1918 "escape
" the second one).
1919 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2960308"></a>cupsaddsmb Flowchart
</h3></div></div><div></div></div><p>
1920 Here is a chart about the procedures, commandflows and
1921 dataflows of the
"cupaddsmb
" command. Note again: cupsaddsmb is
1922 not intended to, and does not work with,
"raw
" queues!
1924 </p><div class=
"figure"><a name=
"id2960326"></a><p class=
"title"><b>Figure
19.14. cupsaddsmb flowchart
</b></p><div class=
"mediaobject"><img src=
"projdoc/imagefiles/1small.png" alt=
"cupsaddsmb flowchart"></div></div><p>
1925 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2960361"></a>Installing the PostScript Driver on a Client
</h3></div></div><div></div></div><p>
1926 After cupsaddsmb completed, your driver is prepared for the clients to
1927 use. Here are the steps you must perform to download and install it
1928 via
"Point'n'Print
". From a Windows client, browse to the CUPS/Samba
1930 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p>open the
<span class=
"emphasis"><em>Printers
</em></span>
1931 share of Samba in Network Neighbourhood;
</p></li><li><p>right-click on the printer in
1932 question;
</p></li><li><p>from the opening context-menu select
1933 <span class=
"emphasis"><em>Install...
</em></span> or
1934 <span class=
"emphasis"><em>Connect...
</em></span> (depending on the Windows version you
1935 use).
</p></li></ul></div><p>
1936 After a few seconds, there should be a new printer in your
1937 client's
<span class=
"emphasis"><em>local
</em></span> "Printers
" folder: On Windows
1938 XP it will follow a naming convention of
<span class=
"emphasis"><em>PrinterName on
1939 SambaServer
</em></span>. (In my current case it is
"infotec_2105 on
1940 kde-bitshop
"). If you want to test it and send your first job from
1941 an application like Winword, the new printer will appears in a
1942 <tt class=
"filename">\\SambaServer\PrinterName
</tt> entry in the
1943 dropdown list of available printers.
1944 </p><div class=
"note" style=
"margin-left: 0.5in; margin-right: 0.5in;"><h3 class=
"title">Note
</h3><p>
1945 cupsaddsmb will only reliably work with CUPS version
1.1.15 or higher
1946 and Samba from
2.2.4. If it doesn't work, or if the automatic printer
1947 driver download to the clients doesn't succeed, you can still manually
1948 install the CUPS printer PPD on top of the Adobe PostScript driver on
1949 clients. Then point the client's printer queue to the Samba printer
1950 share for a UNC type of connection:
1951 </p></div><pre class=
"screen">
1953 net use lpt1: \\sambaserver\printershare /user:ntadmin
1956 should you desire to use the CUPS networked PostScript RIP
1957 functions. (Note that user
"ntadmin
" needs to be a valid Samba user
1958 with the required privileges to access the printershare) This would
1959 set up the printer connection in the traditional
1960 <span class=
"emphasis"><em>LanMan
</em></span> way (not using MS-RPC).
1961 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2960474"></a>Avoiding critical PostScript Driver Settings on the
1962 Client
</h3></div></div><div></div></div><p>
1963 Soooo: printing works, but there are still problems. Most jobs print
1964 well, some don't print at all. Some jobs have problems with fonts,
1965 which don't look very good. Some jobs print fast, and some are
1966 dead-slow. Many of these problems can be greatly reduced or even
1967 completely eliminated if you follow a few guidelines. Remember, if
1968 your print device is not PostScript-enabled, you are treating your
1969 Ghostscript installation on your CUPS host with the output your client
1970 driver settings produce. Treat it well:
1971 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p>Avoid the
<span class=
"emphasis"><em>PostScript Output Option: Optimize
1972 for Speed
</em></span> setting. Rather use the
<span class=
"emphasis"><em>Optimize for
1973 Portability
</em></span> instead (Adobe PostScript
1974 driver).
</p></li><li><p>Don't use the
<span class=
"emphasis"><em>Page Independence:
1975 NO
</em></span> setting. Instead use
<span class=
"emphasis"><em>Page Independence
1976 YES
</em></span> (CUPS PostScript Driver)
</p></li><li><p>Recommended is the
<span class=
"emphasis"><em>True Type Font
1977 Downloading Option: Native True Type
</em></span> over
1978 <span class=
"emphasis"><em>Automatic
</em></span> and
<span class=
"emphasis"><em>Outline
</em></span>; you
1979 should by all means avoid
<span class=
"emphasis"><em>Bitmap
</em></span> (Adobe
1980 PostScript Driver)
</p></li><li><p>Choose
<span class=
"emphasis"><em>True Type Font: Download as Softfont
1981 into Printer
</em></span> over the default
<span class=
"emphasis"><em>Replace by Device
1982 Font
</em></span> (for exotic fonts you may need to change it back to
1983 get a printout at all) (Adobe)
</p></li><li><p>Sometimes you can choose
<span class=
"emphasis"><em>PostScript Language
1984 Level
</em></span>: in case of problems try
<span class=
"emphasis"><em>2</em></span>
1985 instead of
<span class=
"emphasis"><em>3</em></span> (the latest ESP Ghostscript package
1986 handles Level
3 PostScript very well) (Adobe).
</p></li><li><p>Say
<span class=
"emphasis"><em>Yes
</em></span> to
<span class=
"emphasis"><em>PostScript
1987 Error Handler
</em></span> (Adobe)
</p></li></ul></div></div></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><div><h2 class=
"title" style=
"clear: both"><a name=
"id2960608"></a>Installing PostScript Driver Files manually (using
1988 rpcclient)
</h2></div></div><div></div></div><p>
1989 Of course you can run all the commands which are embedded into the
1990 cupsaddsmb convenience utility yourself, one by one, and hereby upload
1991 and prepare the driver files for future client downloads.
1992 </p><div class=
"orderedlist"><ol type=
"1"><li><p>prepare Samba (a CUPS printqueue with the name of the
1993 printer should be there. We are providing the driver
1994 now);
</p></li><li><p>copy all files to
1995 <i class=
"parameter"><tt>[print$]:
</tt></i></p></li><li><p>run
<b class=
"command">rpcclient adddriver
</b>
1996 (for each client architecture you want to support):
</p></li><li><p>run
<b class=
"command">rpcclient
1997 setdriver.
</b></p></li></ol></div><p>
1998 We are going to do this now. First, read the man page on
"rpcclient
"
1999 to get a first idea. Look at all the printing related
2000 sub-commands.
<b class=
"command">enumprinters
</b>,
2001 <b class=
"command">enumdrivers
</b>,
<b class=
"command">enumports
</b>,
2002 <b class=
"command">adddriver
</b>,
<b class=
"command">setdriver
</b> are amongst
2003 the most interesting ones. rpcclient implements an important part of
2004 the MS-RPC protocol. You can use it to query (and command) a Win NT
2005 (or
2K/XP) PC too. MS-RPC is used by Windows clients, amongst other
2006 things, to benefit from the
"Point'n'Print
" features. Samba can now
2008 </p><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2960723"></a>A Check of the rpcclient man Page
</h3></div></div><div></div></div><p>
2009 First let's have a little check of the rpcclient man page. Here are
2010 two relevant passages:
2012 <b class=
"command">adddriver
<arch
> <config
></b> Execute an
2013 AddPrinterDriver() RPC to install the printer driver information on
2014 the server. Note that the driver files should already exist in the
2015 directory returned by
<b class=
"command">getdriverdir
</b>. Possible
2016 values for
<i class=
"parameter"><tt>arch
</tt></i> are the same as those for the
2017 <b class=
"command">getdriverdir
</b> command. The
2018 <i class=
"parameter"><tt>config
</tt></i> parameter is defined as follows:
2019 </p><pre class=
"screen">
2025 Language Monitor Name:\
2027 Comma Separated list of Files
2028 </pre><p>Any empty fields should be enter as the string
"NULL
".
</p><p>Samba does not need to support the concept of Print Monitors
2029 since these only apply to local printers whose driver can make use of
2030 a bi-directional link for communication. This field should be
"NULL
".
2031 On a remote NT print server, the Print Monitor for a driver must
2032 already be installed prior to adding the driver or else the RPC will
2035 <b class=
"command">setdriver
<printername
> <drivername
></b>
2036 Execute a
<b class=
"command">SetPrinter()
</b> command to update the
2037 printer driver associated with an installed printer. The printer
2038 driver must already be correctly installed on the print server.
2039 </p><p> See also the enumprinters and enumdrivers commands for
2040 obtaining a list of installed printers and drivers.
2041 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2960836"></a>Understanding the rpcclient man Page
</h3></div></div><div></div></div><p>
2042 The
<span class=
"emphasis"><em>exact
</em></span> format isn't made too clear by the man
2043 page, since you have to deal with some parameters containing
2044 spaces. Here is a better description for it. We have line-broken the
2045 command and indicated the breaks with
"\
". Usually you would type the
2046 command in one line without the linebreaks:
2047 </p><pre class=
"screen">
2049 adddriver
"Architecture
" \
2050 "LongPrinterName:DriverFile:DataFile:ConfigFile:HelpFile:\
2051 LanguageMonitorFile:DataType:ListOfFiles,Comma-separated
"
2054 What the man pages denotes as a simple
<config
>
2055 keyword, does in reality consist of
8 colon-separated fields. The
2056 last field may take multiple (in some, very insane, cases, even
2057 20 different additional files. This might sound confusing at first.
2058 Note, that what the man pages names the
"LongPrinterName
" in
2059 reality should rather be called the
"Driver Name
". You can name it
2060 anything you want, as long as you use this name later in the
2061 <span class=
"emphasis"><em>rpcclient ... setdriver
</em></span> command. For
2062 practical reasons, many name the driver the same as the
2065 True: it isn't simple at all. I hear you asking:
2066 <span class=
"emphasis"><em>How do I know which files are
"Driver
2067 File
",
"Data File
",
"Config File
",
"Help File
" and
"Language
2068 Monitor File
" in each case?
</em></span> -- For an answer you may
2069 want to have a look at how a Windows NT box with a shared printer
2070 presents the files to us. Remember, that this whole procedure has
2071 to be developed by the Samba Team by overhearing the traffic caused
2072 by Windows computers on the wire. We may as well turn to a Windows
2073 box now, and access it from a UNIX workstation. We will query it
2074 with
<b class=
"command">rpcclient
</b> to see what it tells us and
2075 try to understand the man page more clearly which we've read just
2077 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2960925"></a>Producing an Example by querying a Windows Box
</h3></div></div><div></div></div><p>
2078 We could run
<b class=
"command">rpcclient
</b> with a
2079 <b class=
"command">getdriver
</b> or a
<b class=
"command">getprinter
</b>
2080 subcommand (in level
3 verbosity) against it. Just sit down at UNIX or
2081 Linux workstation with the Samba utilities installed. Then type the
2083 </p><pre class=
"screen">
2085 rpcclient -U'USERNAME%PASSWORD' NT-SERVER-NAME -c 'getdriver printername
3'
2088 From the result it should become clear which is which. Here is an
2089 example from my installation:
2090 </p><pre class=
"screen">
2092 # rpcclient -U'Danka%xxxx' W2KSERVER -c'getdriver
"DANKA InfoStream Virtual Printer
" 3'
2093 cmd = getdriver
"DANKA InfoStream Virtual Printer
" 3
2096 Printer Driver Info
3:
2098 Driver Name: [DANKA InfoStream]
2099 Architecture: [Windows NT x86]
2100 Driver Path: [C:\WINNT\System32\spool\DRIVERS\W32X86\
2\PSCRIPT.DLL]
2101 Datafile: [C:\WINNT\System32\spool\DRIVERS\W32X86\
2\INFOSTRM.PPD]
2102 Configfile: [C:\WINNT\System32\spool\DRIVERS\W32X86\
2\PSCRPTUI.DLL]
2103 Helpfile: [C:\WINNT\System32\spool\DRIVERS\W32X86\
2\PSCRIPT.HLP]
2117 Some printer drivers list additional files under the label
2118 "Dependentfiles
": these would go into the last field
2119 <span class=
"emphasis"><em>ListOfFiles,Comma-separated
</em></span>. For the CUPS
2120 PostScript drivers we don't need any (nor would we for the Adobe
2121 PostScript driver): therefore the field will get a
"NULL
" entry.
2122 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2961015"></a>What is required for adddriver and setdriver to succeed
</h3></div></div><div></div></div><p>
2123 From the manpage (and from the quoted output
2124 of
<span class=
"emphasis"><em>cupsaddsmb
</em></span>, above) it becomes clear that you
2125 need to have certain conditions in order to make the manual uploading
2126 and initializing of the driver files succeed. The two rpcclient
2127 subcommands (
<b class=
"command">adddriver
</b> and
2128 <b class=
"command">setdriver
</b>) need to encounter the following
2129 pre-conditions to complete successfully:
2130 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p>you are connected as
"printer admin
", or root (note,
2131 that this is
<span class=
"emphasis"><em>not
</em></span> the
"Printer Operators
" group in
2132 NT, but the
<span class=
"emphasis"><em>printer admin
</em></span> group, as defined in
2133 the
<i class=
"parameter"><tt>[global]
</tt></i> section of
2134 <tt class=
"filename">smb.conf
</tt>);
</p></li><li><p>copy all required driver files to
2135 <tt class=
"filename">\\sambaserver\print$\w32x86
</tt> and
2136 <tt class=
"filename">\\sambaserver\print$\win40
</tt> as appropriate. They
2137 will end up in the
"0" respective
"2" subdirectories later -- for now
2138 <span class=
"emphasis"><em>don't
</em></span> put them there, they'll be automatically
2139 used by the
<b class=
"command">adddriver
</b> subcommand.! (if you use
2140 "smbclient
" to put the driver files into the share, note that you need
2141 to escape the
"$
":
<b class=
"command">smbclient //sambaserver/print\$ -U
2142 root
</b>);
</p></li><li><p>the user you're connecting as must be able to write to
2143 the
<i class=
"parameter"><tt>[print$]
</tt></i> share and create
2144 subdirectories;
</p></li><li><p>the printer you are going to setup for the Windows
2145 clients, needs to be installed in CUPS already;
</p></li><li><p>the CUPS printer must be known to Samba, otherwise the
2146 <b class=
"command">setdriver
</b> subcommand fails with an
2147 NT_STATUS_UNSUCCESSFUL error. To check if the printer is known by
2148 Samba you may use the
<b class=
"command">enumprinters
</b> subcommand to
2149 rpcclient. A long-standing bug prevented a proper update of the
2150 printer list until every smbd process had received a SIGHUP or was
2151 restarted. Remember this in case you've created the CUPS printer just
2152 shortly ago and encounter problems: try restarting
2153 Samba.
</p></li></ul></div></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2961177"></a>Manual Commandline Driver Installation in
15 little Steps
</h3></div></div><div></div></div><p>
2154 We are going to install a printer driver now by manually executing all
2155 required commands. As this may seem a rather complicated process at
2156 first, we go through the procedure step by step, explaining every
2157 single action item as it comes up.
2158 </p><div class=
"sect3" lang=
"en"><div class=
"titlepage"><div><div><h4 class=
"title"><a name=
"id2961194"></a>First Step: Install the Printer on CUPS
</h4></div></div><div></div></div><pre class=
"screen">
2160 # lpadmin -p mysmbtstprn -v socket://
10.160.51.131:
9100 -E -P /home/kurt/canonIR85.ppd
2163 This installs printer with the name
<span class=
"emphasis"><em>mysmbtstprn
</em></span>
2164 to the CUPS system. The printer is accessed via a socket
2165 (a.k.a. JetDirect or Direct TCP/IP) connection. You need to be root
2167 </p></div><div class=
"sect3" lang=
"en"><div class=
"titlepage"><div><div><h4 class=
"title"><a name=
"id2961224"></a>Second Step (optional): Check if the Printer is recognized by
2168 Samba
</h4></div></div><div></div></div><pre class=
"screen">
2170 # rpcclient -Uroot%xxxx -c 'enumprinters' localhost | grep -C2 mysmbtstprn
2173 name:[\\kde-bitshop\mysmbtstprn]
2174 description:[\\kde-bitshop\mysmbtstprn,,mysmbtstprn]
2175 comment:[mysmbtstprn]
2178 This should show the printer in the list. If not, stop and re-start
2179 the Samba daemon (smbd), or send a HUP signal:
<b class=
"command">kill -HUP
2180 `pidof smbd`
</b>. Check again. Troubleshoot and repeat until
2181 success. Note the
"empty
" field between the two commas in the
2182 "description
" line. Here would the driver name appear if there was one
2183 already. You need to know root's Samba password (as set by the
2184 <b class=
"command">smbpasswd
</b> command) for this step and most of the
2185 following steps. Alternatively you can authenticate as one of the
2186 users from the
"write list
" as defined in
<tt class=
"filename">smb.conf
</tt> for
2187 <i class=
"parameter"><tt>[print$]
</tt></i>.
2188 </p></div><div class=
"sect3" lang=
"en"><div class=
"titlepage"><div><div><h4 class=
"title"><a name=
"id2961288"></a>Third Step (optional): Check if Samba knows a Driver for the
2189 Printer
</h4></div></div><div></div></div><pre class=
"screen">
2191 # rpcclient -Uroot%xxxx -c 'getprinter mysmbtstprn
2' localhost | grep driver
2194 # rpcclient -Uroot%xxxx -c 'getprinter mysmbtstprn
2' localhost | grep -C4 driv
2195 servername:[\\kde-bitshop]
2196 printername:[\\kde-bitshop\mysmbtstprn]
2197 sharename:[mysmbtstprn]
2198 portname:[Samba Printer Port]
2200 comment:[mysmbtstprn]
2203 printprocessor:[winprint]
2205 # rpcclient -U root%xxxx -c 'getdriver mysmbtstprn' localhost
2206 result was WERR_UNKNOWN_PRINTER_DRIVER
2209 Neither method of the three commands shown above should show a driver.
2210 This step was done for the purpose of demonstrating this condition. An
2211 attempt to connect to the printer at this stage will prompt the
2212 message along the lines:
"The server has not the required printer
2213 driver installed
".
2214 </p></div><div class=
"sect3" lang=
"en"><div class=
"titlepage"><div><div><h4 class=
"title"><a name=
"id2961326"></a>Fourth Step: Put all required Driver Files into Samba's
2215 [print$]
</h4></div></div><div></div></div><pre class=
"screen">
2217 # smbclient //localhost/print\$ -U 'root%xxxx' \
2219 put /etc/cups/ppd/mysmbtstprn.ppd mysmbtstprn.PPD; \
2220 put /usr/share/cups/drivers/cupsui.dll cupsui.dll; \
2221 put /usr/share/cups/drivers/cupsdrvr.dll cupsdrvr.dll; \
2222 put /usr/share/cups/drivers/cups.hlp cups.hlp'
2225 (Note that this command should be entered in one long single
2226 line. Line-breaks and the line-end indicating
"\
" has been inserted
2227 for readability reasons.) This step is
<span class=
"emphasis"><em>required
</em></span>
2228 for the next one to succeed. It makes the driver files physically
2229 present in the
<i class=
"parameter"><tt>[print$]
</tt></i> share. However, clients
2230 would still not be able to install them, because Samba does not yet
2231 treat them as driver files. A client asking for the driver would still
2232 be presented with a
"not installed here
" message.
2233 </p></div><div class=
"sect3" lang=
"en"><div class=
"titlepage"><div><div><h4 class=
"title"><a name=
"id2961377"></a>Fifth Step: Verify where the Driver Files are now
</h4></div></div><div></div></div><pre class=
"screen">
2235 # ls -l /etc/samba/drivers/W32X86/
2237 drwxr-sr-x
2 root ntadmin
532 May
25 23:
08 2
2238 drwxr-sr-x
2 root ntadmin
670 May
16 03:
15 3
2239 -rwxr--r--
1 root ntadmin
14234 May
25 23:
21 cups.hlp
2240 -rwxr--r--
1 root ntadmin
278380 May
25 23:
21 cupsdrvr.dll
2241 -rwxr--r--
1 root ntadmin
215848 May
25 23:
21 cupsui.dll
2242 -rwxr--r--
1 root ntadmin
169458 May
25 23:
21 mysmbtstprn.PPD
2245 The driver files now are in the W32X86 architecture
"root
" of
2246 <i class=
"parameter"><tt>[print$]
</tt></i>.
2247 </p></div><div class=
"sect3" lang=
"en"><div class=
"titlepage"><div><div><h4 class=
"title"><a name=
"id2961415"></a>Sixth Step: Tell Samba that these are
2248 <span class=
"emphasis"><em>Driver
</em></span> Files
2249 (
<b class=
"command">adddriver
</b>)
</h4></div></div><div></div></div><pre class=
"screen">
2251 # rpcclient -Uroot%xxxx -c `adddriver
"Windows NT x86
" "mydrivername: \
2252 cupsdrvr.dll:mysmbtstprn.PPD: \
2253 cupsui.dll:cups.hlp:NULL:RAW[
<span class=
"citation">:
</span>]NULL
" \
2256 Printer Driver mydrivername successfully installed.
2259 Note that your cannot repeat this step if it fails. It could fail even
2260 as a result of a simple typo. It will most likely have moved a part of
2261 the driver files into the
"2" subdirectory. If this step fails, you
2262 need to go back to the fourth step and repeat it, before you can try
2263 this one again. In this step you need to choose a name for your
2264 driver. It is normally a good idea to use the same name as is used for
2265 the printername; however, in big installations you may use this driver
2266 for a number of printers which have obviously different names. So the
2267 name of the driver is not fixed.
2268 </p></div><div class=
"sect3" lang=
"en"><div class=
"titlepage"><div><div><h4 class=
"title"><a name=
"id2961469"></a>Seventh Step: Verify where the Driver Files are now
</h4></div></div><div></div></div><pre class=
"screen">
2270 # ls -l /etc/samba/drivers/W32X86/
2272 drwxr-sr-x
2 root ntadmin
532 May
25 23:
22 2
2273 drwxr-sr-x
2 root ntadmin
670 May
16 03:
15 3
2276 # ls -l /etc/samba/drivers/W32X86/
2
2279 -rwxr--r--
1 root ntadmin
14234 May
25 23:
21 cups.hlp
2280 -rwxr--r--
1 root ntadmin
278380 May
13 13:
53 cupsdrvr.dll
2281 -rwxr--r--
1 root ntadmin
215848 May
13 13:
53 cupsui.dll
2282 -rwxr--r--
1 root ntadmin
169458 May
25 23:
21 mysmbtstprn.PPD
2285 Notice how step
6 did also move the driver files to the appropriate
2286 subdirectory. Compare with the situation after step
5.
2287 </p></div><div class=
"sect3" lang=
"en"><div class=
"titlepage"><div><div><h4 class=
"title"><a name=
"id2961503"></a>Eighth Step (optional): Verify if Samba now recognizes the
2288 Driver
</h4></div></div><div></div></div><pre class=
"screen">
2290 # rpcclient -Uroot%xxxx -c 'enumdrivers
3' localhost | grep -B2 -A5 mydrivername
2292 Printer Driver Info
3:
2294 Driver Name: [mydrivername]
2295 Architecture: [Windows NT x86]
2296 Driver Path: [\\kde-bitshop\print$\W32X86\
2\cupsdrvr.dll]
2297 Datafile: [\\kde-bitshop\print$\W32X86\
2\mysmbtstprn.PPD]
2298 Configfile: [\\kde-bitshop\print$\W32X86\
2\cupsui.dll]
2299 Helpfile: [\\kde-bitshop\print$\W32X86\
2\cups.hlp]
2302 Remember, this command greps for the name you did choose for the
2303 driver in step Six. This command must succeed before you can proceed.
2304 </p></div><div class=
"sect3" lang=
"en"><div class=
"titlepage"><div><div><h4 class=
"title"><a name=
"id2961536"></a>Ninth Step: Tell Samba which Printer should use these Driver
2305 Files (
<b class=
"command">setdriver
</b>)
</h4></div></div><div></div></div><pre class=
"screen">
2307 # rpcclient -Uroot%xxxx -c 'setdriver mysmbtstprn mydrivername' localhost
2309 Successfully set mysmbtstprn to driver mydrivername
2312 Since you can bind any printername (=printqueue) to any driver, this
2313 is a very convenient way to setup many queues which use the same
2314 driver. You don't need to repeat all the previous steps for the
2315 setdriver command to succeed. The only pre-conditions are:
2316 <b class=
"command">enumdrivers
</b> must find the driver and
2317 <b class=
"command">enumprinters
</b> must find the printer.
2318 </p></div><div class=
"sect3" lang=
"en"><div class=
"titlepage"><div><div><h4 class=
"title"><a name=
"id2961586"></a>Tenth Step (optional): Verify if Samba has this Association
2319 recognized
</h4></div></div><div></div></div><pre class=
"screen">
2321 # rpcclient -Uroot%xxxx -c 'getprinter mysmbtstprn
2' localhost | grep driver
2322 drivername:[mydrivername]
2324 # rpcclient -Uroot%xxxx -c 'getprinter mysmbtstprn
2' localhost | grep -C4 driv
2325 servername:[\\kde-bitshop]
2326 printername:[\\kde-bitshop\mysmbtstprn]
2327 sharename:[mysmbtstprn]
2329 drivername:[mydrivername]
2330 comment:[mysmbtstprn]
2333 printprocessor:[winprint]
2335 # rpcclient -U root%xxxx -c 'getdriver mysmbtstprn' localhost
2337 Printer Driver Info
3:
2339 Driver Name: [mydrivername]
2340 Architecture: [Windows NT x86]
2341 Driver Path: [\\kde-bitshop\print$\W32X86\
2\cupsdrvr.dll]
2342 Datafile: [\\kde-bitshop\print$\W32X86\
2\mysmbtstprn.PPD]
2343 Configfile: [\\kde-bitshop\print$\W32X86\
2\cupsui.dll]
2344 Helpfile: [\\kde-bitshop\print$\W32X86\
2\cups.hlp]
2346 Defaultdatatype: [RAW]
2348 Defaultdatatype: [RAW]
2350 # rpcclient -Uroot%xxxx -c 'enumprinters' localhost | grep mysmbtstprn
2351 name:[\\kde-bitshop\mysmbtstprn]
2352 description:[\\kde-bitshop\mysmbtstprn,mydrivername,mysmbtstprn]
2353 comment:[mysmbtstprn]
2356 Compare these results with the ones from steps
2 and
3. Note that
2357 every single of these commands show the driver is installed. Even
2358 the
<b class=
"command">enumprinters
</b> command now lists the driver
2359 on the
"description
" line.
2360 </p></div><div class=
"sect3" lang=
"en"><div class=
"titlepage"><div><div><h4 class=
"title"><a name=
"id2961666"></a>Eleventh Step (optional): Tickle the Driver into a correct
2361 Device Mode
</h4></div></div><div></div></div><p>
2362 You certainly know how to install the driver on the client. In case
2363 you are not particularly familiar with Windows, here is a short
2364 recipe: browse the Network Neighbourhood, go to the Samba server, look
2365 for the shares. You should see all shared Samba printers.
2366 Double-click on the one in question. The driver should get
2367 installed, and the network connection set up. An alternative way is to
2368 open the
"Printers (and Faxes)
" folder, right-click on the printer in
2369 question and select
"Connect
" or
"Install
". As a result, a new printer
2370 should have appeared in your client's local
"Printers (and Faxes)
"
2371 folder, named something like
"printersharename on Sambahostname
".
2373 It is important that you execute this step as a Samba printer admin
2374 (as defined in
<tt class=
"filename">smb.conf
</tt>). Here is another method
2375 to do this on Windows XP. It uses a commandline, which you may type
2376 into the
"DOS box
" (type root's smbpassword when prompted):
2377 </p><pre class=
"screen">
2379 C:\
> runas /netonly /user:root
"rundll32 printui.dll,PrintUIEntry /in /n \\sambacupsserver\mysmbtstprn
"
2382 Change any printer setting once (like
<span class=
"emphasis"><em>"portrait
"
2383 --
> "landscape
"</em></span>), click
"Apply
"; change the setting
2385 </p></div><div class=
"sect3" lang=
"en"><div class=
"titlepage"><div><div><h4 class=
"title"><a name=
"id2961731"></a>Twelfth Step: Install the Printer on a Client
2386 (
"Point'n'Print
")
</h4></div></div><div></div></div><pre class=
"screen">
2388 C:\
> rundll32 printui.dll,PrintUIEntry /in /n
"\\sambacupsserver\mysmbtstprn
"
2391 If it doesn't work it could be a permission problem with the
2392 <i class=
"parameter"><tt>[print$]
</tt></i> share.
2393 </p></div><div class=
"sect3" lang=
"en"><div class=
"titlepage"><div><div><h4 class=
"title"><a name=
"id2961764"></a>Thirteenth Step (optional): Print a Test Page
</h4></div></div><div></div></div><pre class=
"screen">
2395 C:\
> rundll32 printui.dll,PrintUIEntry /p /n
"\\sambacupsserver\mysmbtstprn
"
2398 Then hit [TAB]
5 times, [ENTER] twice, [TAB] once and [ENTER] again
2399 and march to the printer.
2400 </p></div><div class=
"sect3" lang=
"en"><div class=
"titlepage"><div><div><h4 class=
"title"><a name=
"id2961790"></a>Fourteenth Step (recommended): Study the Test Page
</h4></div></div><div></div></div><p>
2401 Hmmm.... just kidding! By now you know everything about printer
2402 installations and you don't need to read a word. Just put it in a
2403 frame and bolt it to the wall with the heading
"MY FIRST
2404 RPCCLIENT-INSTALLED PRINTER
" - why not just throw it away!
2405 </p></div><div class=
"sect3" lang=
"en"><div class=
"titlepage"><div><div><h4 class=
"title"><a name=
"id2961808"></a>Fifteenth Step (obligatory): Enjoy. Jump. Celebrate your
2406 Success
</h4></div></div><div></div></div><pre class=
"screen">
2408 # echo
"Cheeeeerioooooo! Success...
" >> /var/log/samba/log.smbd
2410 </pre></div></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2961830"></a>Troubleshooting revisited
</h3></div></div><div></div></div><p>
2411 The setdriver command will fail, if in Samba's mind the queue is not
2412 already there. You had promising messages about the:
2413 </p><pre class=
"screen">
2415 Printer Driver ABC successfully installed.
2418 after the
"adddriver
" parts of the procedure? But you are also seeing
2419 a disappointing message like this one beneath?
2420 </p><pre class=
"screen">
2422 result was NT_STATUS_UNSUCCESSFUL
2425 It is not good enough that
<span class=
"emphasis"><em>you
</em></span>
2426 can see the queue
<span class=
"emphasis"><em>in CUPS
</em></span>, using
2427 the
<b class=
"command">lpstat -p ir85wm
</b> command. A
2428 bug in most recent versions of Samba prevents the proper update of
2429 the queuelist. The recognition of newly installed CUPS printers
2430 fails unless you re-start Samba or send a HUP to all smbd
2431 processes. To verify if this is the reason why Samba doesn't
2432 execute the setdriver command successfully, check if Samba
"sees
"
2434 </p><pre class=
"screen">
2436 # rpcclient transmeta -N -U'root%secret' -c 'enumprinters
0'| grep ir85wm
2437 printername:[ir85wm]
2440 An alternative command could be this:
2441 </p><pre class=
"screen">
2443 # rpcclient transmeta -N -U'root%secret' -c 'getprinter ir85wm'
2444 cmd = getprinter ir85wm
2446 name:[\\transmeta\ir85wm]
2447 description:[\\transmeta\ir85wm,ir85wm,DPD]
2448 comment:[CUPS PostScript-Treiber for WinNT/
2K/XP]
2451 BTW, you can use these commands, plus a few more, of course,
2452 to install drivers on remote Windows NT print servers too!
2453 </p></div></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><div><h2 class=
"title" style=
"clear: both"><a name=
"id2961930"></a>The printing
<tt class=
"filename">*.tdb
</tt> Files
</h2></div></div><div></div></div><p>
2454 Some mystery is associated with the series of files with a
2455 tdb-suffix appearing in every Samba installation. They are
2456 <tt class=
"filename">connections.tdb
</tt>,
2457 <tt class=
"filename">printing.tdb
</tt>,
2458 <tt class=
"filename">share_info.tdb
</tt> ,
2459 <tt class=
"filename">ntdrivers.tdb
</tt>,
2460 <tt class=
"filename">unexpected.tdb
</tt>,
2461 <tt class=
"filename">brlock.tdb
</tt> ,
2462 <tt class=
"filename">locking.tdb
</tt>,
2463 <tt class=
"filename">ntforms.tdb
</tt>,
2464 <tt class=
"filename">messages.tdb
</tt> ,
2465 <tt class=
"filename">ntprinters.tdb
</tt>,
2466 <tt class=
"filename">sessionid.tdb
</tt> and
2467 <tt class=
"filename">secrets.tdb
</tt>. What is their purpose?
2468 </p><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2962033"></a>Trivial DataBase Files
</h3></div></div><div></div></div><p>
2469 A Windows NT (Print) Server keeps track of all information needed to serve
2470 its duty toward its clients by storing entries in the Windows
2471 "Registry
". Client queries are answered by reading from the registry,
2472 Administrator or user configuration settings are saved by writing into
2473 the Registry. Samba and Unix obviously don't have such a kind of
2474 Registry. Samba instead keeps track of all client related information in a
2475 series of
<tt class=
"filename">*.tdb
</tt> files. (TDB = Trivial Data
2476 Base). These are often located in
<tt class=
"filename">/var/lib/samba/
</tt>
2477 or
<tt class=
"filename">/var/lock/samba/
</tt> . The printing related files
2478 are
<tt class=
"filename">ntprinters.tdb
</tt>,
2479 <tt class=
"filename">printing.tdb
</tt>,
<tt class=
"filename">ntforms.tdb
</tt> and
2480 <tt class=
"filename">ntdrivers.tdb
</tt>.
2481 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2962103"></a>Binary Format
</h3></div></div><div></div></div><p>
2482 <tt class=
"filename">*.tdb
</tt> files are not human readable. They are
2483 written in a binary format.
"Why not ASCII?
", you may ask.
"After all,
2484 ASCII configuration files are a good and proofed tradition on UNIX.
"
2485 -- The reason for this design decision by the Samba Team is mainly
2486 performance. Samba needs to be fast; it runs a separate
2487 <b class=
"command">smbd
</b> process for each client connection, in some
2488 environments many thousand of them. Some of these smbds might need to
2489 write-access the same
<tt class=
"filename">*.tdb
</tt> file
<span class=
"emphasis"><em>at the
2490 same time
</em></span>. The file format of Samba's
2491 <tt class=
"filename">*.tdb
</tt> files allows for this provision. Many smbd
2492 processes may write to the same
<tt class=
"filename">*.tdb
</tt> file at the
2493 same time. This wouldn't be possible with pure ASCII files.
2494 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2962165"></a>Losing
<tt class=
"filename">*.tdb
</tt> Files
</h3></div></div><div></div></div><p>
2495 It is very important that all
<tt class=
"filename">*.tdb
</tt> files remain
2496 consistent over all write and read accesses. However, it may happen
2497 that these files
<span class=
"emphasis"><em>do
</em></span> get corrupted. (A
2498 <b class=
"command">kill -
9 `pidof smbd`
</b> while a write access is in
2499 progress could do the damage as well as a power interruption,
2500 etc.). In cases of trouble, a deletion of the old printing-related
2501 <tt class=
"filename">*.tdb
</tt> files may be the only option. You need to
2502 re-create all print related setup after that. Or you have made a
2503 backup of the
<tt class=
"filename">*.tdb
</tt> files in time.
2504 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2962224"></a>Using
<span class=
"emphasis"><em>tdbbackup
</em></span></h3></div></div><div></div></div><p>
2505 Samba ships with a little utility which helps the root user of your
2506 system to back up your
<tt class=
"filename">*.tdb
</tt> files. If you run it
2507 with no argument, it prints a little usage message:
2508 </p><pre class=
"screen">
2511 Usage: tdbbackup [options]
<fname...
>
2514 -h this help message
2515 -s suffix set the backup suffix
2516 -v verify mode (restore if corrupt)
2519 Here is how I backed up my printing.tdb file:
2520 </p><pre class=
"screen">
2523 . browse.dat locking.tdb ntdrivers.tdb printing.tdb share_info.tdb
2524 .. connections.tdb messages.tdb ntforms.tdb printing.tdbkp unexpected.tdb
2525 brlock.tdb gmon.out namelist.debug ntprinters.tdb sessionid.tdb
2527 kde-bitshop:/var/lock/samba # tdbbackup -s .bak printing.tdb
2528 printing.tdb :
135 records
2530 kde-bitshop:/var/lock/samba # ls -l printing.tdb*
2531 -rw-------
1 root root
40960 May
2 03:
44 printing.tdb
2532 -rw-------
1 root root
40960 May
2 03:
44 printing.tdb.bak
2534 </pre></div></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><div><h2 class=
"title" style=
"clear: both"><a name=
"id2962290"></a>CUPS Print Drivers from Linuxprinting.org
</h2></div></div><div></div></div><p>
2535 CUPS ships with good support for HP LaserJet type printers. You can
2536 install the generic driver as follows:
2537 </p><pre class=
"screen">
2539 lpadmin -p laserjet4plus -v parallel:/dev/lp0 -E -m laserjet.ppd
2542 The
<i class=
"parameter"><tt>-m
</tt></i> switch will retrieve the
2543 <tt class=
"filename">laserjet.ppd
</tt> from the standard repository for
2544 not-yet-installed-PPDs, which CUPS typically stores in
2545 <tt class=
"filename">/usr/share/cups/model
</tt>. Alternatively, you may use
2546 <i class=
"parameter"><tt>-P /path/to/your.ppd
</tt></i>.
2548 The generic laserjet.ppd however does not support every special option
2549 for every LaserJet-compatible model. It constitutes a sort of
"least
2550 denominator
" of all the models. If for some reason it is ruled out to
2551 you to pay for the commercially available ESP Print Pro drivers, your
2552 first move should be to consult the database on
<a href=
"http://www.linuxprinting.org/printer_list.cgi" target=
"_top">http://www.linuxprinting.org/printer_list.cgi
</a>.
2553 Linuxprinting.org has excellent recommendations about which driver is
2554 best used for each printer. Its database is kept current by the
2555 tireless work of Till Kamppeter from MandrakeSoft, who is also the
2556 principal author of the foomatic-rip utility.
2557 </p><div class=
"note" style=
"margin-left: 0.5in; margin-right: 0.5in;"><h3 class=
"title">Note
</h3><p>
2558 The former
"cupsomatic
" concept is now be replaced by the new, much
2559 more powerful
"foomatic-rip
". foomatic-rip is the successor of
2560 cupsomatic. cupsomatic is no longer maintained. Here is the new URL
2561 to the Foomatic-
3.0 database:
<a href=
"http://www.linuxprinting.org/driver_list.cgi" target=
"_top">http://www.linuxprinting.org/driver_list.cgi
</a>.
2562 If you upgrade to foomatic-rip, don't forget to also upgrade to the
2563 new-style PPDs for your foomatic-driven printers. foomatic-rip will
2564 not work with PPDs generated for the old cupsomatic. The new-style
2565 PPDs are
100% compliant to the Adobe PPD specification. They are
2566 intended to be used by Samba and the cupsaddsmb utility also, to
2567 provide the driver files for the Windows clients also!
2568 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2962398"></a>foomatic-rip and Foomatic explained
</h3></div></div><div></div></div><p>
2569 Nowadays most Linux distros rely on the utilities of Linuxprinting.org
2570 to create their printing related software (which, BTW, works on all
2571 UNIXes and on Mac OS X or Darwin too). It is not known as well as it
2572 should be, that it also has a very end-user friendly interface which
2573 allows for an easy update of drivers and PPDs, for all supported
2574 models, all spoolers, all operating systems and all package formats
2575 (because there is none). Its history goes back a few years.
2577 Recently Foomatic has achieved the astonishing milestone of
<a href=
"http://www.linuxprinting.org/printer_list.cgi?make=Anyone" target=
"_top">1000
2578 listed
</a> printer models. Linuxprinting.org keeps all the
2579 important facts about printer drivers, supported models and which
2580 options are available for the various driver/printer combinations in
2581 its
<a href=
"http://www.linuxprinting.org/foomatic.html" target=
"_top">Foomatic
</a>
2582 database. Currently there are
<a href=
"http://www.linuxprinting.org/driver_list.cgi" target=
"_top">245 drivers
</a>
2583 in the database: many drivers support various models, and many models
2584 may be driven by different drivers; it's your choice!
2585 </p><div class=
"sect3" lang=
"en"><div class=
"titlepage"><div><div><h4 class=
"title"><a name=
"id2962453"></a>690 "perfect
" Printers
</h4></div></div><div></div></div><p>
2586 At present there are
690 devices dubbed as working
"perfectly
",
181
2587 "mostly
",
96 "partially
" and
46 are
"Paperweights
". Keeping in mind
2588 that most of these are non-PostScript models (PostScript printers are
2589 automatically supported supported by CUPS to perfection, by using
2590 their own manufacturer-provided Windows-PPD...), and that a
2591 multifunctional device never qualifies as working
"perfectly
" if it
2592 doesn't also scan and copy and fax under GNU/Linux: then this is a
2593 truly astonishing achievement. Three years ago the number was not
2594 more than
500, and Linux or UNIX
"printing
" at the time wasn't
2595 anywhere near the quality it is today!
2596 </p></div><div class=
"sect3" lang=
"en"><div class=
"titlepage"><div><div><h4 class=
"title"><a name=
"id2962477"></a>How the
"Printing HOWTO
" started it all
</h4></div></div><div></div></div><p>
2597 A few years ago
<a href=
"http://www2.picante.com:81/~gtaylor/" target=
"_top">Grant Taylor
</a>
2598 started it all. The roots of today's Linuxprinting.org are in the
2599 first
<a href=
"http://www.linuxprinting.org/foomatic2.9/howto/" target=
"_top">Linux Printing
2600 HOWTO
</a> which he authored. As a side-project to this document,
2601 which served many Linux users and admins to guide their first steps in
2602 this complicated and delicate setup (to a scientist, printing is
2603 "applying a structured deposition of distinct patterns of ink or toner
2604 particles on paper substrates
" <span class=
"emphasis"><em>;-)
</em></span>, he started to
2605 build in a little Postgres database with information about the
2606 hardware and driver zoo that made up Linux printing of the time. This
2607 database became the core component of today's Foomatic collection of
2608 tools and data. In the meantime it has moved to an XML representation
2610 </p></div><div class=
"sect3" lang=
"en"><div class=
"titlepage"><div><div><h4 class=
"title"><a name=
"id2962522"></a>Foomatic's strange Name
</h4></div></div><div></div></div><p>
2611 "Why the funny name?
", you ask. When it really took off, around spring
2612 2000, CUPS was far less popular than today, and most systems used LPD,
2613 LPRng or even PDQ to print. CUPS shipped with a few generic
"drivers
"
2614 (good for a few hundred different printer models). These didn't
2615 support many device-specific options. CUPS also shipped with its own
2616 built-in rasterization filter (
"pstoraster
", derived from
2617 Ghostscript). On the other hand, CUPS provided brilliant support for
2618 <span class=
"emphasis"><em>controlling
</em></span> all printer options through
2619 standardized and well-defined
"PPD files
" (PostScript Printers
2620 Description files). Plus, CUPS was designed to be easily extensible.
2622 Grant already had in his database a respectable compilation
2623 of facts about a many more printers, and the Ghostscript
"drivers
"
2624 they run with. His idea, to generate PPDs from the database info
2625 and use them to make standard Ghostscript filters work within CUPS,
2626 proved to work very well. It also
"killed several birds with one
2628 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p>It made all current and future Ghostscript filter
2629 developments available for CUPS;
</p></li><li><p>It made available a lot of additional printer models
2630 to CUPS users (because often the
"traditional
" Ghostscript way of
2631 printing was the only one available);
</p></li><li><p>It gave all the advanced CUPS options (web interface,
2632 GUI driver configurations) to users wanting (or needing) to use
2633 Ghostscript filters.
</p></li></ul></div></div><div class=
"sect3" lang=
"en"><div class=
"titlepage"><div><div><h4 class=
"title"><a name=
"id2962589"></a>cupsomatic, pdqomatic, lpdomatic, directomatic
</h4></div></div><div></div></div><p>
2634 CUPS worked through a quickly-hacked up filter script named
<a href=
"http://www.linuxprinting.org/download.cgi?filename=cupsomatic&show=0" target=
"_top">cupsomatic
</a>.
2635 cupsomatic ran the printfile through Ghostscript, constructing
2636 automatically the rather complicated command line needed. It just
2637 required to be copied into the CUPS system to make it work. To
2638 "configure
" the way cupsomatic controls the Ghostscript rendering
2639 process, it needs a CUPS-PPD. This PPD is generated directly from the
2640 contents of the database. For CUPS and the respective printer/filter
2641 combo another Perl script named
"CUPS-O-Matic
" did the PPD
2642 generation. After that was working, Grant implemented within a few
2643 days a similar thing for two other spoolers. Names chosen for the
2644 config-generator scripts were
<a href=
"http://www.linuxprinting.org/download.cgi?filename=lpdomatic&show=0" target=
"_top">PDQ-O-Matic
</a>
2645 (for PDQ) and
<a href=
"http://www.linuxprinting.org/download.cgi?filename=lpdomatic&show=0" target=
"_top">LPD-O-Matic
</a>
2646 (for - you guessed it - LPD); the configuration here didn't use PPDs
2647 but other spooler-specific files.
2649 From late summer of that year,
<a href=
"http://www.linuxprinting.org/till/" target=
"_top">Till Kamppeter
</a>
2650 started to put work into the database. Till had been newly employed by
2651 <a href=
"http://www.mandrakesoft.com/" target=
"_top">MandrakeSoft
</a> to
2652 convert their printing system over to CUPS, after they had seen his
2653 <a href=
"http://www.fltk.org/" target=
"_top">FLTK
</a>-based
<a href=
"http://cups.sourceforge.net/xpp/" target=
"_top">XPP
</a> (a GUI frontend to
2654 the CUPS lp-command). He added a huge amount of new information and new
2655 printers. He also developed the support for other spoolers, like
2656 <a href=
"http://ppr.sourceforge.net/" target=
"_top">PPR
</a> (via ppromatic),
2657 <a href=
"http://sourceforge.net/projects/lpr/" target=
"_top">GNUlpr
</a> and
2658 <a href=
"http://www.lprng.org/" target=
"_top">LPRng
</a> (both via an extended
2659 lpdomatic) and
"spoolerless
" printing (
<a href=
"http://www.linuxprinting.org/download.cgi?filename=directomatic&show=0" target=
"_top">directomatic
</a>)....
2661 So, to answer your question:
"Foomatic
" is the general name for all
2662 the overlapping code and data behind the
"*omatic
" scripts.... --
2663 Foomatic up to versions
2.0.x required (ugly) Perl data structures
2664 attached the Linuxprinting.org PPDs for CUPS. It had a different
2665 "*omatic
" script for every spooler, as well as different printer
2666 configuration files..
2667 </p></div><div class=
"sect3" lang=
"en"><div class=
"titlepage"><div><div><h4 class=
"title"><a name=
"id2962725"></a>7.13.1.5.The
<span class=
"emphasis"><em>Grand Unification
</em></span>
2668 achieved...
</h4></div></div><div></div></div><p>
2669 This all has changed in Foomatic versions
2.9 (Beta) and released as
2670 "stable
" 3.0. This has now achieved the convergence of all *omatic
2671 scripts: it is called the
<a href=
"http://www.linuxprinting.org/foomatic2.9/download.cgi?filename=foomatic-rip&show=0" target=
"_top">foomatic-rip
</a>.
2672 This single script is the unification of the previously different
2673 spooler-specific *omatic scripts. foomatic-rip is used by all the
2674 different spoolers alike. Because foomatic-rip can read PPDs (both the
2675 original PostScript printer PPDs and the Linuxprinting.org-generated
2676 ones), all of a sudden all supported spoolers can have the power of
2677 PPDs at their disposal; users only need to plug
"foomatic-rip
" into
2678 their system.... For users there is improved media type and source
2679 support; paper sizes and trays are easier to configure.
2681 Also, the New Generation of Linuxprinting.org PPDs doesn't contain
2682 Perl data structures any more. If you are a distro maintainer and have
2683 used the previous version of Foomatic, you may want to give the new
2684 one a spin: but don't forget to generate a new-version set of PPDs,
2685 via the new
<a href=
"http://www.linuxprinting.org/download/foomatic/foomatic-db-engine-3.0.0beta1.tar.gz" target=
"_top">foomatic-db-engine
</a>!
2686 Individual users just need to generate a single new PPD specific to
2687 their model by
<a href=
"http://www.linuxprinting.org/kpfeifle/LinuxKongress2002/Tutorial/II.Foomatic-User/II.tutorial-handout-foomatic-user.html" target=
"_top">following
2688 the steps
</a> outlined in the Foomatic tutorial or further
2689 below. This new development is truly amazing.
2691 foomatic-rip is a very clever wrapper around the need to run
2692 Ghostscript with a different syntax, different options, different
2693 device selections and/or different filters for each different printer
2694 or different spooler. At the same time it can read the PPD associated
2695 with a print queue and modify the print job according to the user
2696 selections. Together with this comes the
100% compliance of the new
2697 Foomatic PPDs with the Adobe spec. Some really innovative features of
2698 the Foomatic concept will surprise users: it will support custom paper
2699 sizes for many printers; and it will support printing on media drawn
2700 from different paper trays within the same job (in both cases: even
2701 where there is no support for this from Windows-based vendor printer
2703 </p></div><div class=
"sect3" lang=
"en"><div class=
"titlepage"><div><div><h4 class=
"title"><a name=
"id2962810"></a>Driver Development outside
</h4></div></div><div></div></div><p>
2704 Most driver development itself does not happen within
2705 Linuxprinting.org. Drivers are written by independent maintainers.
2706 Linuxprinting.org just pools all the information, and stores it in its
2707 database. In addition, it also provides the Foomatic glue to integrate
2708 the many drivers into any modern (or legacy) printing system known to
2711 Speaking of the different driver development groups: most of
2712 the work is currently done in three projects. These are:
2713 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p><a href=
"http://www-124.ibm.com/developerworks/oss/linux/projects/omni/" target=
"_top">Omni
</a>
2714 -- a Free Software project by IBM which tries to convert their printer
2715 driver knowledge from good-ol' OS/
2 times into a modern, modular,
2716 universal driver architecture for Linux/Unix (still Beta). This
2717 currently supports
437 models.
</p></li><li><p><a href=
"http://hpinkjet.sf.net/" target=
"_top">HPIJS
</a> --
2718 a Free Software project by HP to provide the support for their own
2719 range of models (very mature, printing in most cases is perfect and
2720 provides true photo quality). This currently supports
369
2721 models.
</p></li><li><p><a href=
"http://gimp-print.sf.net/" target=
"_top">Gimp-Print
</a> -- a Free software
2722 effort, started by Michael Sweet (also lead developer for CUPS), now
2723 directed by Robert Krawitz, which has achieved an amazing level of
2724 photo print quality (many Epson users swear that its quality is
2725 better than the vendor drivers provided by Epson for the Microsoft
2726 platforms). This currently supports
522 models.
</p></li></ul></div></div><div class=
"sect3" lang=
"en"><div class=
"titlepage"><div><div><h4 class=
"title"><a name=
"id2962892"></a>Forums, Downloads, Tutorials, Howtos -- also for Mac OS X and
2727 commercial Unix
</h4></div></div><div></div></div><p>
2728 Linuxprinting.org today is the one-stop
"shop
" to download printer
2729 drivers. Look for printer information and
<a href=
"http://www.linuxprinting.org//kpfeifle/LinuxKongress2002/Tutorial/" target=
"_top">tutorials
</a>
2730 or solve printing problems in its popular
<a href=
"http://www.linuxprinting.org/newsportal/" target=
"_top">forums
</a>. But
2731 it's not just for GNU/Linux: users and admins of
<a href=
"http://www.linuxprinting.org/macosx/" target=
"_top">commercial UNIX
2732 systems
</a> are also going there, and the relatively new
<a href=
"http://www.linuxprinting.org/newsportal/thread.php3?name=linuxprinting.macosx.general" target=
"_top">Mac
2733 OS X forum
</a> has turned out to be one of the most frequented
2734 fora after only a few weeks.
2736 Linuxprinting.org and the Foomatic driver wrappers around Ghostscript
2737 are now a standard toolchain for printing on all the important
2738 distros. Most of them also have CUPS underneath. While in recent years
2739 most printer data had been added by Till (who works at Mandrake), many
2740 additional contributions came from engineers with SuSE, RedHat,
2741 Connectiva, Debian and others. Vendor-neutrality is an important goal
2742 of the Foomatic project.
2743 </p><div class=
"note" style=
"margin-left: 0.5in; margin-right: 0.5in;"><h3 class=
"title">Note
</h3><p>
2744 Till Kamppeter from MandrakeSoft is doing an excellent job in his
2745 spare time to maintain Linuxprinting.org and Foomatic. So if you use
2746 it often, please send him a note showing your appreciation.
2747 </p></div></div><div class=
"sect3" lang=
"en"><div class=
"titlepage"><div><div><h4 class=
"title"><a name=
"id2962963"></a>Foomatic Database generated PPDs
</h4></div></div><div></div></div><p>
2748 The Foomatic database is an amazing piece of ingenuity in itself. Not
2749 only does it keep the printer and driver information, but it is
2750 organized in a way that it can generate
"PPD
" files
"on the fly
" from
2751 its internal XML-based datasets. While these PPDs are modelled to the
2752 Adobe specification of
"PostScript Printer Descriptions
" (PPDs), the
2753 Linuxprinting.org/Foomatic-PPDs don't normally drive PostScript
2754 printers: they are used to describe all the bells and whistles you
2755 could ring or blow on an Epson Stylus inkjet, or a HP Photosmart or
2756 what-have-you. The main
"trick
" is one little additional line, not
2757 envisaged by the PPD specification, starting with the
"*cupsFilter
"
2758 keyword: it tells the CUPS daemon how to proceed with the PostScript
2759 print file (old-style Foomatic-PPDs named the
2760 <span class=
"emphasis"><em>cupsomatic
</em></span> filter script, while the new-style
2761 PPDs now call
<span class=
"emphasis"><em>foomatic-rip
</em></span>). This filter
2762 script calls Ghostscript on the host system (the recommended variant
2763 is ESP Ghostscript) to do the rendering work. foomatic-rip knows which
2764 filter or internal device setting it should ask from Ghostscript to
2765 convert the PostScript printjob into a raster format ready for the
2766 target device. This usage of PPDs to describe the options of non-PS
2767 printers was the invention of the CUPS developers. The rest is easy:
2768 GUI tools (like KDE's marvellous
<a href=
"http://printing.kde.org/overview/kprinter.phtml" target=
"_top">"kprinter
"</a>,
2769 or the GNOME
<a href=
"http://gtklp.sourceforge.net/" target=
"_top">"gtklp
"</a>,
"xpp
" and the CUPS
2770 web interface) read the PPD too and use this information to present
2771 the available settings to the user as an intuitive menu selection.
2772 </p></div></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2963027"></a>foomatic-rip and Foomatic-PPD Download and Installation
</h3></div></div><div></div></div><p>
2773 Here are the steps to install a foomatic-rip driven
"LaserJet
4 Plus
"
2774 compatible printer in CUPS (note that recent distributions of SuSE,
2775 UnitedLinux and Mandrake may ship with a complete package of
2776 Foomatic-PPDs plus the foomatic-rip utility. going directly to
2777 Linuxprinting.org ensures you to get the latest driver/PPD files):
2778 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p>Surf to
<a href=
"http://www.linuxprinting.org/printer_list.cgi" target=
"_top">http://www.linuxprinting.org/printer_list.cgi
</a>
2779 </p></li><li><p>Check the complete list of printers in the database:
2780 <a href=
"http://www.linuxprinting.org/printer_list.cgi?make=Anyone" target=
"_top">http://www.linuxprinting.org/printer_list.cgi?make=Anyone
</a>
2781 </p></li><li><p>There select your model and click on the
2782 link.
</p></li><li><p>You'll arrive at a page listing all drivers working
2783 with this model (for all printers, there will always be
2784 <span class=
"emphasis"><em>one
</em></span> recommended driver. Try this one
2785 first).
</p></li><li><p>In our case (
"HP LaserJet
4 Plus
"), we'll arrive here:
2786 <a href=
"http://www.linuxprinting.org/show_printer.cgi?recnum=HP-LaserJet_4_Plus" target=
"_top">http://www.linuxprinting.org/show_printer.cgi?recnum=HP-LaserJet_4_Plus
</a>
2787 </p></li><li><p>The recommended driver is
"ljet4
".
</p></li><li><p>There are several links provided here. You should
2788 visit them all, if you are not familiar with the Linuxprinting.org
2789 database.
</p></li><li><p>There is a link to the database page for the
"ljet4
":
2790 <a href=
"http://www.linuxprinting.org/show_driver.cgi?driver=ljet4" target=
"_top">http://www.linuxprinting.org/show_driver.cgi?driver=ljet4
</a>
2791 On the driver's page, you'll find important and detailed information
2792 about how to use that driver within the various available
2793 spoolers.
</p></li><li><p>Another link may lead you to the homepage of the
2794 driver author or the driver.
</p></li><li><p>Important links are the ones which provide hints with
2795 setup instructions for CUPS (
<a href=
"http://www.linuxprinting.org/cups-doc.html" target=
"_top">http://www.linuxprinting.org/cups-doc.html
</a>),
2796 PDQ (
<a href=
"http://www.linuxprinting.org/pdq-doc.html" target=
"_top">http://www.linuxprinting.org/pdq-doc.html
</a>),
2797 LPD, LPRng and GNUlpr (
<a href=
"http://www.linuxprinting.org/lpd-doc.html" target=
"_top">http://www.linuxprinting.org/lpd-doc.html
</a>)
2798 as well as PPR (
<a href=
"http://www.linuxprinting.org/ppr-doc.html" target=
"_top">http://www.linuxprinting.org/ppr-doc.html)
</a>
2799 or
"spooler-less
" printing (
<a href=
"http://www.linuxprinting.org/direct-doc.html" target=
"_top">http://www.linuxprinting.org/direct-doc.html
</a>
2800 ).
</p></li><li><p>You can view the PPD in your browser through this
2801 link:
<a href=
"http://www.linuxprinting.org/ppd-o-matic.cgi?driver=ljet4&printer=HP-LaserJet_4_Plus&show=1" target=
"_top">http://www.linuxprinting.org/ppd-o-matic.cgi?driver=ljet4
&printer=HP-LaserJet_4_Plus
&show=
1</a>
2802 </p></li><li><p>You can also (most importantly)
2803 generate and download the PPD:
<a href=
"http://www.linuxprinting.org/ppd-o-matic.cgi?driver=ljet4&printer=HP-LaserJet_4_Plus&show=0" target=
"_top">http://www.linuxprinting.org/ppd-o-matic.cgi?driver=ljet4
&printer=HP-LaserJet_4_Plus
&show=
0</a>
2804 </p></li><li><p>The PPD contains all the information needed to use our
2805 model and the driver; this is, once installed, working transparently
2806 for the user. Later you'll only need to choose resolution, paper size
2807 etc. from the web-based menu, or from the print dialog GUI, or from
2808 the commandline.
</p></li><li><p>Should you have ended up on the driver's page (
<a href=
"http://www.linuxprinting.org/show_driver.cgi?driver=ljet4" target=
"_top">http://www.linuxprinting.org/show_driver.cgi?driver=ljet4
</a>),
2809 you can choose to use the
"PPD-O-Matic
" online PPD generator
2810 program.
</p></li><li><p>Select the exact model and check either
"download
" or
2811 "display PPD file
" and click on
"Generate PPD file
".
</p></li><li><p>If you save the PPD file from the browser view, please
2812 don't use
"cut'n'past
" (since it could possibly damage line endings
2813 and tabs, which makes the PPD likely to fail its duty), but use
"Save
2814 as...
" in your browser's menu. (Best is to use the
"download
" option
2815 from the web page directly).
</p></li><li><p>Another very interesting part on each driver page is
2816 the
<span class=
"emphasis"><em>Show execution details
</em></span> button. If you
2817 select your printer model and click that button, you will get
2818 displayed a complete Ghostscript command line, enumerating all options
2819 available for that driver/printermodel combo. This is a great way to
2820 "Learn Ghostscript By Doing
". It is also an excellent
"cheat sheet
"
2821 for all experienced users who need to re-construct a good command line
2822 for that damn printing script, but can't remember the exact
2823 syntax. ;-)
</p></li><li><p>Some time during your visit to Linuxprinting.org, save
2824 the PPD to a suitable place on your harddisk, say
2825 <tt class=
"filename">/path/to/my-printer.ppd
</tt> (if you prefer to install
2826 your printers with the help of the CUPS web interface, save the PPD to
2827 the
<tt class=
"filename">/usr/share/cups/model/
</tt> path and re-start
2828 cupsd).
</p></li><li><p>Then install the printer with a suitable commandline,
2830 </p><pre class=
"screen">
2832 lpadmin -p laserjet4plus -v parallel:/dev/lp0 -E -P path/to/my-printer.ppd
2834 </pre></li><li><p>Note again this: for all the new-style
"Foomatic-PPDs
"
2835 from Linuxprinting.org, you also need a special
"CUPS filter
" named
2836 "foomatic-rip
".Get the latest version of
"foomatic-rip
" from:
<a href=
"http://www.linuxprinting.org/foomatic2.9/download.cgi?filename=foomatic-rip&show=0" target=
"_top">http://www.linuxprinting.org/foomatic2.9/download.cgi?filename=foomatic-rip
&show=
0</a>
2837 </p></li><li><p>The foomatic-rip Perlscript itself also makes some
2838 interesting reading (
<a href=
"http://www.linuxprinting.org/foomatic2.9/download.cgi?filename=foomatic-rip&show=1" target=
"_top">http://www.linuxprinting.org/foomatic2.9/download.cgi?filename=foomatic-rip
&show=
1</a>),
2839 because it is very well documented by Till's inline comments (even
2840 non-Perl hackers will learn quite a bit about printing by reading
2841 it... ;-)
</p></li><li><p>Save foomatic-rip either directly in
2842 <tt class=
"filename">/usr/lib/cups/filter/foomatic-rip
</tt> or somewhere in
2843 your $PATH (and don't forget to make it world-executable). Again,
2844 don't save by
"copy'n'paste
" but use the appropriate link, or the
2845 "Save as...
" menu item in your browser.
</p></li><li><p>If you save foomatic-rip in your $PATH, create a symlink:
2846 <b class=
"command">cd /usr/lib/cups/filter/ ; ln -s `which
2847 foomatic-rip`
</b>. For CUPS to discover this new
2848 available filter at startup, you need to re-start
2849 cupsd.
</p></li></ul></div><p>
2850 Once you print to a printqueue set up with the Foomatic-PPD, CUPS will
2851 insert the appropriate commands and comments into the resulting
2852 PostScript jobfile. foomatic-rip is able to read and act upon
2853 these. foomatic-rip uses some specially encoded Foomatic comments,
2854 embedded in the jobfile. These in turn are used to construct
2855 (transparently for you, the user) the complicated ghostscript command
2856 line telling for the printer driver how exactly the resulting raster
2857 data should look like and which printer commands to embed into the
2861 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p>A
"foomatic+something
" PPD -- but it this not enough
2862 to print with CUPS (it is only
<span class=
"emphasis"><em>one
</em></span> important
2863 component)
</p></li><li><p>The
"foomatic-rip
" filter script (Perl) in
2864 /usr/lib/cups/filters/
</p></li><li><p>Perl to make foomatic-rip run
</p></li><li><p>Ghostscript (because it is doing the main work,
2865 controlled by the PPD/foomatic-rip combo) to produce the raster data
2866 fit for your printermodel's consumption
</p></li><li><p>Ghostscript
<span class=
"emphasis"><em>must
</em></span> (depending on
2867 the driver/model) contain support for a certain
"device
", representing
2868 the selected
"driver
" for your model (as shown by
"gs
2869 -h
")
</p></li><li><p>foomatic-rip needs a new version of PPDs (PPD versions
2870 produced for cupsomatic don't work with
2871 foomatic-rip).
</p></li></ul></div></div></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><div><h2 class=
"title" style=
"clear: both"><a name=
"id2963488"></a>Page Accounting with CUPS
</h2></div></div><div></div></div><p>
2872 Often there are questions regarding
"print quotas
" wherein Samba users
2873 (that is, Windows clients) should not be able to print beyond a
2874 certain amount of pages or data volume per day, week or month. This
2875 feature is dependent on the real print subsystem you're using.
2876 Samba's part is always to receive the job files from the clients
2877 (filtered
<span class=
"emphasis"><em>or
</em></span> unfiltered) and hand it over to this
2880 Of course one could
"hack
" things with one's own scripts. But then
2881 there is CUPS. CUPS supports
"quotas
" which can be based on sizes of
2882 jobs or on the number of pages or both, and are spanning any time
2884 </p><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2963519"></a>Setting up Quotas
</h3></div></div><div></div></div><p>
2885 This is an example command how root would set a print quota in CUPS,
2886 assuming an existing printer named
"quotaprinter
":
2887 </p><pre class=
"screen">
2889 lpadmin -p quotaprinter -o job-quota-period=
604800 -o job-k-limit=
1024 -o job-page-limit=
100
2892 This would limit every single user to print
100 pages or
1024 KB of
2893 data (whichever comes first) within the last
604,
800 seconds ( =
1
2895 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2963551"></a>Correct and incorrect Accounting
</h3></div></div><div></div></div><p>
2896 For CUPS to count correctly, the printfile needs to pass the CUPS
2897 "pstops
" filter, otherwise it uses a
"dummy
" count of
"1". Some
2898 printfiles don't pass it (eg: image files) but then those are mostly
1
2899 page jobs anyway. This also means that proprietary drivers for the
2900 target printer running on the client computers and CUPS/Samba, which
2901 then spool these files as
"raw
" (i.e. leaving them untouched, not
2902 filtering them), will be counted as
"1-pagers
" too!
2904 You need to send PostScript from the clients (i.e. run a PostScript
2905 driver there) to have the chance to get accounting done. If the
2906 printer is a non-PostScript model, you need to let CUPS do the job to
2907 convert the file to a print-ready format for the target printer. This
2908 will be working for currently about
1,
000 different printer models,
2909 see
<a href=
"http://www.linuxprinting.org/printer_list.cgi" target=
"_top">http://www.linuxprinting.org/printer_list.cgi
</a>).
2910 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2963592"></a>Adobe and CUPS PostScript Drivers for Windows Clients
</h3></div></div><div></div></div><p>
2911 Before CUPS-
1.1.16 your only option was to use the Adobe PostScript
2912 Driver on the Windows clients. The output of this driver was not
2913 always passed through the
"pstops
" filter on the CUPS/Samba side, and
2914 therefore was not counted correctly (the reason is that it often,
2915 depending on the
"PPD
" being used, wrote a
"PJL
"-header in front of
2916 the real PostScript which caused CUPS to skip pstops and go directly
2917 to the
"pstoraster
" stage).
2919 From CUPS-
1.1.16 onward you can use the
"CUPS PostScript Driver for
2920 Windows NT/
2K/XP clients
" (which is tagged in the download area of
2921 http://www.cups.org/ as the
"cups-samba-
1.1.16.tar.gz
" package). It does
2922 <span class=
"emphasis"><em>not
</em></span> work for Win9x/ME clients. But it guarantees:
2923 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p>to not write an PJL-header
</p></li><li><p>to still read and support all PJL-options named in the
2924 driver PPD with its own means
</p></li><li><p> that the file will pass through the
"pstops
" filter
2925 on the CUPS/Samba server
</p></li><li><p>to page-count correctly the
2926 printfile
</p></li></ul></div><p>
2927 You can read more about the setup of this combination in the manpage
2928 for
"cupsaddsmb
" (which is only present with CUPS installed, and only
2929 current from CUPS
1.1.16).
2930 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2963663"></a>The page_log File Syntax
</h3></div></div><div></div></div><p>
2931 These are the items CUPS logs in the
"page_log
" for every
2932 single
<span class=
"emphasis"><em>page
</em></span> of a job:
2933 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p>Printer name
</p></li><li><p>User name
</p></li><li><p>Job ID
</p></li><li><p>Time of printing
</p></li><li><p>the page number
</p></li><li><p>the number of copies
</p></li><li><p>a billing information string
2934 (optional)
</p></li><li><p>the host which sent the job (included since version
2935 1.1.19)
</p></li></ul></div><p>
2936 Here is an extract of my CUPS server's page_log file to illustrate the
2937 format and included items:
2938 </p><pre class=
"screen">
2940 infotec_IS2027 kurt
401 [
22/Apr/
2003:
10:
28:
43 +
0100]
1 3 #marketing
10.160.50.13
2941 infotec_IS2027 kurt
401 [
22/Apr/
2003:
10:
28:
43 +
0100]
2 3 #marketing
10.160.50.13
2942 infotec_IS2027 kurt
401 [
22/Apr/
2003:
10:
28:
43 +
0100]
3 3 #marketing
10.160.50.13
2943 infotec_IS2027 kurt
401 [
22/Apr/
2003:
10:
28:
43 +
0100]
4 3 #marketing
10.160.50.13
2944 DigiMaster9110 boss
402 [
22/Apr/
2003:
10:
33:
22 +
0100]
1 440 finance-dep
10.160.51.33
2947 This was job ID
"401", printed on
"infotec_IS2027
" by user
"kurt
", a
2948 64-page job printed in
3 copies and billed to
"#marketing
", sent
2949 from IP address
10.160.50.13. The next job had ID
"402", was sent by
2950 user
"boss
" from IP address
10.160.51.33,printed from one page
440
2951 copies and is set to be billed to
"finance-dep
".
2952 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2963765"></a>Possible Shortcomings
</h3></div></div><div></div></div><p>
2953 What flaws or shortcomings are there with this quota system?
2954 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p>the ones named above (wrongly logged job in case of
2955 printer hardware failure, etc.)
</p></li><li><p>in reality, CUPS counts the job pages that are being
2956 processed in
<span class=
"emphasis"><em>software
</em></span> (that is, going through the
2957 "RIP
") rather than the physical sheets successfully leaving the
2958 printing device. Thus if there is a jam while printing the
5th sheet out
2959 of
1000 and the job is aborted by the printer, the
"page count
" will
2960 still show the figure of
1000 for that job
</p></li><li><p>all quotas are the same for all users (no flexibility
2961 to give the boss a higher quota than the clerk) no support for
2962 groups
</p></li><li><p>no means to read out the current balance or the
2963 "used-up
" number of current quota
</p></li><li><p>a user having used up
99 sheets of
100 quota will
2964 still be able to send and print a
1,
000 sheet job
</p></li><li><p>a user being denied a job because of a filled-up quota
2965 doesn't get a meaningful error message from CUPS other than
2966 "client-error-not-possible
".
</p></li></ul></div></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2963836"></a>Future Developments
</h3></div></div><div></div></div><p>
2967 This is the best system currently available, and there are huge
2968 improvements under development for CUPS
1.2:
2969 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p>page counting will go into the
"backends
" (these talk
2970 directly to the printer and will increase the count in sync with the
2971 actual printing process: thus a jam at the
5th sheet will lead to a
2972 stop in the counting)
</p></li><li><p>quotas will be handled more flexibly
</p></li><li><p>probably there will be support for users to inquire
2973 their
"accounts
" in advance
</p></li><li><p>probably there will be support for some other tools
2974 around this topic
</p></li></ul></div></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2963884"></a>Other Accounting Tools
</h3></div></div><div></div></div><p>
2975 PrintAnalyzer, pyKota, printbill, LogReport.
2976 </p></div></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><div><h2 class=
"title" style=
"clear: both"><a name=
"id2963899"></a>Additional Material
</h2></div></div><div></div></div><p>
2977 A printer queue with
<span class=
"emphasis"><em>no
</em></span> PPD associated to it is a
2978 "raw
" printer and all files will go directly there as received by the
2979 spooler. The exceptions are file types
"application/octet-stream
"
2980 which need
"passthrough feature
" enabled.
"Raw
" queues don't do any
2981 filtering at all, they hand the file directly to the CUPS backend.
2982 This backend is responsible for the sending of the data to the device
2983 (as in the
"device URI
" notation:
<tt class=
"filename">lpd://, socket://,
2984 smb://, ipp://, http://, parallel:/, serial:/, usb:/
</tt> etc.)
2986 "cupsomatic
"/Foomatic are
<span class=
"emphasis"><em>not
</em></span> native CUPS drivers
2987 and they don't ship with CUPS. They are a Third Party add-on,
2988 developed at Linuxprinting.org. As such, they are a brilliant hack to
2989 make all models (driven by Ghostscript drivers/filters in traditional
2990 spoolers) also work via CUPS, with the same (good or bad!) quality as
2991 in these other spoolers.
"cupsomatic
" is only a vehicle to execute a
2992 ghostscript commandline at that stage in the CUPS filtering chain,
2993 where
"normally
" the native CUPS
"pstoraster
" filter would kick
2994 in. cupsomatic by-passes pstoraster,
"kidnaps
" the printfile from CUPS
2995 away and re-directs it to go through Ghostscript. CUPS accepts this,
2996 because the associated CUPS-O-Matic-/Foomatic-PPD specifies:
2997 </p><pre class=
"screen">
2999 *cupsFilter:
"application/vnd.cups-postscript
0 cupsomatic
"
3002 This line persuades CUPS to hand the file to cupsomatic, once it has
3003 successfully converted it to the MIME type
3004 "application/vnd.cups-postscript
". This conversion will not happen for
3005 Jobs arriving from Windows which are auto-typed
3006 "application/octet-stream
", with the according changes in
3007 <tt class=
"filename">/etc/cups/mime.types
</tt> in place.
3009 CUPS is widely configurable and flexible, even regarding its filtering
3010 mechanism. Another workaround in some situations would be to have in
3011 <tt class=
"filename">/etc/cups/mime.types
</tt> entries as follows:
3012 </p><pre class=
"screen">
3014 application/postscript application/vnd.cups-raw
0 -
3015 application/vnd.cups-postscript application/vnd.cups-raw
0 -
3018 This would prevent all Postscript files from being filtered (rather,
3019 they will through the virtual
<span class=
"emphasis"><em>nullfilter
</em></span>
3020 denoted with
"-
"). This could only be useful for PS printers. If you
3021 want to print PS code on non-PS printers (provided they support ASCII
3022 text printing) an entry as follows could be useful:
3023 </p><pre class=
"screen">
3025 */* application/vnd.cups-raw
0 -
3028 and would effectively send
<span class=
"emphasis"><em>all
</em></span> files to the
3029 backend without further processing.
3031 Lastly, you could have the following entry:
3032 </p><pre class=
"screen">
3034 application/vnd.cups-postscript application/vnd.cups-raw
0 my_PJL_stripping_filter
3037 You will need to write a
<span class=
"emphasis"><em>my_PJL_stripping_filter
</em></span>
3038 (could be a shellscript) that parses the PostScript and removes the
3039 unwanted PJL. This would need to conform to CUPS filter design
3040 (mainly, receive and pass the parameters printername, job-id,
3041 username, jobtitle, copies, print options and possibly the
3042 filename). It would be installed as world executable into
3043 <tt class=
"filename">/usr/lib/cups/filters/
</tt> and will be called by CUPS
3044 if it encounters a MIME type
"application/vnd.cups-postscript
".
3046 CUPS can handle
<span class=
"emphasis"><em>-o job-hold-until=indefinite
</em></span>.
3047 This keeps the job in the queue
"on hold
". It will only be printed
3048 upon manual release by the printer operator. This is a requirement in
3049 many
"central reproduction departments
", where a few operators manage
3050 the jobs of hundreds of users on some big machine, where no user is
3051 allowed to have direct access (such as when the operators often need
3052 to load the proper paper type before running the
10,
000 page job
3053 requested by marketing for the mailing, etc.).
3054 </p></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><div><h2 class=
"title" style=
"clear: both"><a name=
"id2964092"></a>Auto-Deletion or Preservation of CUPS Spool Files
</h2></div></div><div></div></div><p>
3055 Samba print files pass through two
"spool
" directories. One is the
3056 incoming directory managed by Samba, (set in the
<span class=
"emphasis"><em>path =
3057 /var/spool/samba
</em></span> directive in the
3058 <span class=
"emphasis"><em>[printers]
</em></span> section of
3059 <tt class=
"filename">smb.conf
</tt>). The other is the spool directory of
3060 your UNIX print subsystem. For CUPS it is normally
3061 <tt class=
"filename">/var/spool/cups/
</tt>, as set by the cupsd.conf
3062 directive
<tt class=
"filename">RequestRoot /var/spool/cups
</tt>.
3063 </p><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2964138"></a>CUPS Configuration Settings explained
</h3></div></div><div></div></div><p>
3064 Some important parameter settings in the CUPS configuration file
3065 <tt class=
"filename">cupsd.conf
</tt> are:
3066 </p><div class=
"variablelist"><dl><dt><span class=
"term">PreserveJobHistory Yes
</span></dt><dd><p>
3067 This keeps some details of jobs in cupsd's mind (well it keeps the
3068 "c12345
",
"c12346
" etc. files in the CUPS spool directory, which do a
3069 similar job as the old-fashioned BSD-LPD control files). This is set
3070 to
"Yes
" as a default.
3071 </p></dd><dt><span class=
"term">PreserveJobFiles Yes
</span></dt><dd><p>
3072 This keeps the job files themselves in cupsd's mind
3073 (well it keeps the
"d12345
",
"d12346
" etc. files in the CUPS spool
3074 directory...). This is set to
"No
" as the CUPS
3076 </p></dd><dt><span class=
"term"><span class=
"emphasis"><em>"MaxJobs
500"</em></span></span></dt><dd><p>
3077 This directive controls the maximum number of jobs
3078 that are kept in memory. Once the number of jobs reaches the limit,
3079 the oldest completed job is automatically purged from the system to
3080 make room for the new one. If all of the known jobs are still
3081 pending or active then the new job will be rejected. Setting the
3082 maximum to
0 disables this functionality. The default setting is
3084 </p></dd></dl></div><p>
3085 (There are also additional settings for
"MaxJobsPerUser
" and
3086 "MaxJobsPerPrinter
"...)
3087 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2964221"></a>Pre-conditions
</h3></div></div><div></div></div><p>
3088 For everything to work as announced, you need to have three
3090 </p><div class=
"itemizedlist"><ul type=
"disc"><li><p>a Samba-smbd which is compiled against
"libcups
" (Check
3091 on Linux by running
"ldd `which smbd`
")
</p></li><li><p>a Samba-
<tt class=
"filename">smb.conf
</tt> setting of
3092 "printing = cups
"</p></li><li><p>another Samba-
<tt class=
"filename">smb.conf
</tt> setting of
3093 "printcap = cups
"</p></li></ul></div><div class=
"note" style=
"margin-left: 0.5in; margin-right: 0.5in;"><h3 class=
"title">Note
</h3><p>
3094 In this case all other manually set printing-related commands (like
3095 "print command
",
"lpq command
",
"lprm command
",
"lppause command
" or
3096 "lpresume command
") are ignored and they should normally have no
3097 influence what-so-ever on your printing.
3098 </p></div></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2964281"></a>Manual Configuration
</h3></div></div><div></div></div><p>
3099 If you want to do things manually, replace the
"printing =
3100 cups
" by
"printing = bsd
". Then your manually set commands may work
3101 (haven't tested this), and a
"print command = lp -d %P %s; rm %s
"
3102 may do what you need.
3103 </p></div></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><div><h2 class=
"title" style=
"clear: both"><a name=
"id2964299"></a>When
<span class=
"emphasis"><em>not
</em></span> to use Samba to print to
3104 CUPS
</h2></div></div><div></div></div><p>
3106 </p></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><div><h2 class=
"title" style=
"clear: both"><a name=
"id2964316"></a>In Case of Trouble.....
</h2></div></div><div></div></div><p>
3107 If you have more problems, post the output of these commands
3108 to the CUPS or Samba mailing lists (choose the one which seems more
3109 relevant to your problem):
3110 </p><pre class=
"screen">
3112 grep -v ^# /etc/cups/cupsd.conf | grep -v ^$
3113 grep -v ^# /etc/samba/smb.conf | grep -v ^$ | grep -v
"^;
"
3116 (adapt paths as needed). These commands leave out the empty
3117 lines and lines with comments, providing the
"naked settings
" in a
3118 compact way. Don't forget to name the CUPS and Samba versions you
3119 are using! This saves bandwidth and makes for easier readability
3120 for experts (and you are expecting experts to read them, right?
3122 </p><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2964352"></a>Where to find Documentation
</h3></div></div><div></div></div><p>
3124 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2964364"></a>How to ask for Help
</h3></div></div><div></div></div><p>
3126 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2964377"></a>Where to find Help
</h3></div></div><div></div></div><p>
3128 </p></div></div><div class=
"sect1" lang=
"en"><div class=
"titlepage"><div><div><h2 class=
"title" style=
"clear: both"><a name=
"id2964391"></a>Appendix
</h2></div></div><div></div></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2964398"></a>Printing
<span class=
"emphasis"><em>from
</em></span> CUPS to Windows attached
3129 Printers
</h3></div></div><div></div></div><p>
3130 From time to time the question arises, how you can print
3131 <span class=
"emphasis"><em>to
</em></span> a Windows attached printer
3132 <span class=
"emphasis"><em>from
</em></span> Samba. Normally the local connection
3133 "Windows host
<--
> printer
" would be done by USB or parallel
3134 cable, but this doesn't matter to Samba. From here only an SMB
3135 connection needs to be opened to the Windows host. Of course, this
3136 printer must be
"shared
" first. As you have learned by now, CUPS uses
3137 <span class=
"emphasis"><em>backends
</em></span> to talk to printers and other
3138 servers. To talk to Windows shared printers you need to use the
3139 <span class=
"emphasis"><em>smb
</em></span> (surprise, surprise!) backend. Check if this
3140 is in the CUPS backend directory. This resides usually in
3141 <tt class=
"filename">/usr/lib/cups/backend/
</tt>. You need to find a
"smb
"
3142 file there. It should be a symlink to
<tt class=
"filename">smbspool
</tt>
3143 which file must exist and be executable:
3144 </p><pre class=
"screen">
3146 # ls -l /usr/lib/cups/backend/
3148 drwxr-xr-x
3 root root
720 Apr
30 19:
04 .
3149 drwxr-xr-x
6 root root
125 Dec
19 17:
13 ..
3150 -rwxr-xr-x
1 root root
10692 Feb
16 21:
29 canon
3151 -rwxr-xr-x
1 root root
10692 Feb
16 21:
29 epson
3152 lrwxrwxrwx
1 root root
3 Apr
17 22:
50 http -
> ipp
3153 -rwxr-xr-x
1 root root
17316 Apr
17 22:
50 ipp
3154 -rwxr-xr-x
1 root root
15420 Apr
20 17:
01 lpd
3155 -rwxr-xr-x
1 root root
8656 Apr
20 17:
01 parallel
3156 -rwxr-xr-x
1 root root
2162 Mar
31 23:
15 pdfdistiller
3157 lrwxrwxrwx
1 root root
25 Apr
30 19:
04 ptal -
> /usr/local/sbin/ptal-cups
3158 -rwxr-xr-x
1 root root
6284 Apr
20 17:
01 scsi
3159 lrwxrwxrwx
1 root root
17 Apr
2 03:
11 smb -
> /usr/bin/smbspool
3160 -rwxr-xr-x
1 root root
7912 Apr
20 17:
01 socket
3161 -rwxr-xr-x
1 root root
9012 Apr
20 17:
01 usb
3163 # ls -l `which smbspool`
3164 -rwxr-xr-x
1 root root
563245 Dec
28 14:
49 /usr/bin/smbspool
3167 If this symlink doesn't exist, create it:
3168 </p><pre class=
"screen">
3170 # ln -s `which smbspool` /usr/lib/cups/backend/smb
3173 smbspool has been written by Mike Sweet from the CUPS folks. It is
3174 included and ships with Samba. It may also be used with print
3175 subsystems other than CUPS, to spool jobs to Windows printer shares. To
3176 set up printer
"winprinter
" on CUPS, you need to have a
"driver
" for
3177 it. Essentially this means to convert the print data on the CUPS/Samba
3178 host to a format that the printer can digest (the Windows host is
3179 unable to convert any files you may send). This also means you should
3180 be able to print to the printer if it were hooked directly at your
3181 Samba/CUPS host. For troubleshooting purposes, this is what you
3182 should do, to determine if that part of the process chain is in
3183 order. Then proceed to fix the network connection/authentication to
3184 the Windows host, etc.
3186 To install a printer with the smb backend on CUPS, use this command:
3187 </p><pre class=
"screen">
3189 # lpadmin -p winprinter -v smb://WINDOWSNETBIOSNAME/printersharename -P /path/to/PPD
3192 The
<span class=
"emphasis"><em>PPD
</em></span> must be able to direct CUPS to generate
3193 the print data for the target model. For PostScript printers just use
3194 the PPD that would be used with the Windows NT PostScript driver. But
3195 what can you do if the printer is only accessible with a password? Or
3196 if the printer's host is part of another workgroup? This is provided
3197 for: you can include the required parameters as part of the
3198 <tt class=
"filename">smb://
</tt> device-URI. Like this:
3199 </p><pre class=
"screen">
3201 smb://WORKGROUP/WINDOWSNETBIOSNAME/printersharename
3202 smb://username:password@WORKGROUP/WINDOWSNETBIOSNAME/printersharename
3203 smb://username:password@WINDOWSNETBIOSNAME/printersharename
3206 Note that the device-URI will be visible in the process list of the
3207 Samba server (e.g. when someone uses the
<b class=
"command">ps -aux
</b>
3208 command on Linux), even if the username and passwords are sanitized
3209 before they get written into the log files. So this is an inherently
3210 insecure option. However it is the only one. Don't use it if you want
3211 to protect your passwords. Better share the printer in a way that
3212 doesn't require a password! Printing will only work if you have a
3213 working netbios name resolution up and running. Note that this is a
3214 feature of CUPS and you don't necessarily need to have smbd running
3215 (but who wants that? :-).
3216 </p></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2964612"></a>More CUPS filtering Chains
</h3></div></div><div></div></div><p>
3217 The following diagrams reveal how CUPS handles print jobs.
3218 </p><pre class=
"screen">
3219 #########################################################################
3221 # CUPS in and of itself has this (general) filter chain (CAPITAL
3222 # letters are FILE-FORMATS or MIME types, other are filters (this is
3223 # true for pre-
1.1.15 of pre-
4.3 versions of CUPS and ESP PrintPro):
3225 # SOMETHNG-FILEFORMAT
3231 # APPLICATION/POSTSCRIPT
3237 # APPLICATION/VND.CUPS-POSTSCRIPT
3240 # pstoraster # as shipped with CUPS, independent from any Ghostscipt
3241 # | # installation on the system
3242 # | (=
"postscipt interpreter
")
3244 # APPLICATION/VND.CUPS-RASTER
3247 # rastertosomething (e.g. Gimp-Print filters may be plugged in here)
3248 # | (=
"raster driver
")
3250 # SOMETHING-DEVICE-SPECIFIC
3256 # ESP PrintPro has some enhanced
"rastertosomething
" filters as compared to
3257 # CUPS, and also a somewhat improved
"pstoraster
" filter.
3259 # NOTE: Gimp-Print and some other
3rd-Party-Filters (like TurboPrint) to
3260 # CUPS and ESP PrintPro plug-in where rastertosomething is noted.
3262 #########################################################################
3263 </pre><pre class=
"screen">
3264 #########################################################################
3266 # This is how
"cupsomatic
" comes into play:
3267 # =========================================
3269 # SOMETHNG-FILEFORMAT
3275 # APPLICATION/POSTSCRIPT
3281 # APPLICATION/VND.CUPS-POSTSCRIPT ----------------+
3284 # pstoraster (constructs complicated
3285 # | (=
"postscipt interpreter
") Ghostscript commandline
3286 # | to let the file be
3288 # APPLICATION/VND.CUPS-RASTER
"-sDEVICE=s.th.
"
3291 # rastertosomething V
3292 # | (=
"raster driver
") +-------------------------+
3293 # | | Ghostscript at work.... |
3295 # SOMETHING-DEVICE-SPECIFIC *-------------------------+
3298 # backend
<------------------------------------+
3304 # Note, that cupsomatic
"kidnaps
" the printfile after the
3305 #
"APPLICATION/VND.CUPS-POSTSCRPT
" stage and deviates it gh
3306 # the CUPS-external, systemwide Ghostscript installation, bypassing the
3307 #
"pstoraster
" filter (therefore also bypassing the CUPS-raster-drivers
3308 #
"rastertosomething
", and hands the rasterized file directly to the CUPS
3311 # cupsomatic is not made by the CUPS developers. It is an independent
3312 # contribution to printing development, made by people from
3313 # Linuxprinting.org. (see also http://www.cups.org/cups-help.html)
3315 # NOTE: Gimp-Print and some other
3rd-Party-Filters (like TurboPrint) to
3316 # CUPS and ESP PrintPro plug-in where rastertosomething is noted.
3318 #########################################################################
3319 </pre><pre class=
"screen">
3320 #########################################################################
3322 # And this is how it works for ESP PrintPro from
4.3:
3323 # ===================================================
3325 # SOMETHNG-FILEFORMAT
3331 # APPLICATION/POSTSCRIPT
3337 # APPLICATION/VND.CUPS-POSTSCRIPT
3341 # | (=
"postscipt interpreter
")
3343 # APPLICATION/VND.CUPS-RASTER
3346 # rastertosomething (e.g. Gimp-Print filters may be plugged in here)
3347 # | (=
"raster driver
")
3349 # SOMETHING-DEVICE-SPECIFIC
3354 # NOTE: Gimp-Print and some other
3rd-Party-Filters (like TurboPrint) to
3355 # CUPS and ESP PrintPro plug-in where rastertosomething is noted.
3357 #########################################################################
3358 </pre><pre class=
"screen">
3359 #########################################################################
3361 # This is how
"cupsomatic
" would come into play with ESP PrintPro:
3362 # ================================================================
3365 # SOMETHNG-FILEFORMAT
3371 # APPLICATION/POSTSCRIPT
3377 # APPLICATION/VND.CUPS-POSTSCRIPT ----------------+
3380 # gsrip (constructs complicated
3381 # | (=
"postscipt interpreter
") Ghostscript commandline
3382 # | to let the file be
3384 # APPLICATION/VND.CUPS-RASTER
"-sDEVICE=s.th.
"
3387 # rastertosomething V
3388 # | (=
"raster driver
") +-------------------------+
3389 # | | Ghostscript at work.... |
3391 # SOMETHING-DEVICE-SPECIFIC *-------------------------+
3394 # backend
<------------------------------------+
3399 # NOTE: Gimp-Print and some other
3rd-Party-Filters (like TurboPrint) to
3400 # CUPS and ESP PrintPro plug-in where rastertosomething is noted.
3402 #########################################################################
3403 </pre><pre class=
"screen">
3404 #########################################################################
3406 # And this is how it works for CUPS from
1.1.15:
3407 # ==============================================
3409 # SOMETHNG-FILEFORMAT
3415 # APPLICATION/POSTSCRIPT
3421 # APPLICATION/VND.CUPS-POSTSCRIPT-----+
3422 # +------------------v------------------------------+
3426 # |
"-sDEVICE=cups
") |
3428 # | (=
"postscipt interpreter
") |
3430 # +------------------v------------------------------+
3432 # APPLICATION/VND.CUPS-RASTER
>-------+
3436 # | (=
"raster driver
")
3438 # SOMETHING-DEVICE-SPECIFIC
3444 # NOTE: since version
1.1.15 CUPS
"outsourced
" the pstoraster process to
3445 # Ghostscript. GNU Ghostscript needs to be patched to handle the
3446 # CUPS requirement; ESP Ghostscript has this builtin. In any case,
3447 #
"gs -h
" needs to show up a
"cups
" device. pstoraster is now a
3448 # calling an appropriate
"gs -sDEVICE=cups...
" commandline to do
3449 # the job. It will output
"application/vnd.cup-raster
", which will
3450 # be finally processed by a CUPS raster driver
"rastertosomething
"
3451 # Note the difference to
"cupsomatic
", which will
<span class=
"emphasis"><em>not
</em></span> output
3452 # CUPS-raster, but a final version of the printfile, ready to be
3453 # sent to the printer. cupsomatic also doesn't use the
"cups
"
3454 # devicemode in Ghostscript, but one of the classical devicemodes....
3456 # NOTE: Gimp-Print and some other
3rd-Party-Filters (like TurboPrint) to
3457 # CUPS and ESP PrintPro plug-in where rastertosomething is noted.
3459 #########################################################################
3460 </pre><pre class=
"screen">
3461 #########################################################################
3463 # And this is how it works for CUPS from
1.1.15, with cupsomatic included:
3464 # ========================================================================
3466 # SOMETHNG-FILEFORMAT
3472 # APPLICATION/POSTSCRIPT
3478 # APPLICATION/VND.CUPS-POSTSCRIPT-----+
3479 # +------------------v------------------------------+
3480 # | Ghostscript . Ghostscript at work.... |
3481 # | at work... . (with
"-sDEVICE= |
3482 # | (with . s.th.
" |
3483 # |
"-sDEVICE=cups
") . |
3485 # | (CUPS standard) . (cupsomatic) |
3487 # | (=
"postscript interpreter
") |
3489 # +------------------v--------------v---------------+
3491 # APPLICATION/VND.CUPS-RASTER
>-------+ |
3494 # rastertosomething |
3495 # | (=
"raster driver
") |
3497 # SOMETHING-DEVICE-SPECIFIC
>------------------------+
3503 # NOTE: Gimp-Print and some other
3rd-Party-Filters (like TurboPrint) to
3504 # CUPS and ESP PrintPro plug-in where rastertosomething is noted.
3506 ##########################################################################
3507 </pre></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2964919"></a>Trouble Shooting Guidelines to fix typical Samba printing
3508 Problems
</h3></div></div><div></div></div><p>
3509 This is a short description of how to debug printing problems
3510 with Samba. This describes how to debug problems with printing from
3511 a SMB client to a Samba server, not the other way around.
3512 </p><div class=
"variablelist"><dl><dt><span class=
"term">Win9x client can't install driver
</span></dt><dd><p>For Win9x clients require the printer names to be
8
3513 chars (or
"8 plus
3 chars suffix
") max; otherwise the driver files
3514 won't get transferred when you want to download them from
3515 Samba.
</p></dd><dt><span class=
"term">testparm
</span></dt><dd><p>Run
<b class=
"command">testparm
</b>: It will tell you if
3516 <tt class=
"filename">smb.conf
</tt> parameters are in the wrong
3517 section. Many people have had the
"printer admin
" parameter in the
3518 <i class=
"parameter"><tt>[printers]
</tt></i> section and experienced
3519 problems.
"testparm
" will tell you if it sees
3520 this.
</p></dd><dt><span class=
"term">"cupsaddsmb
" keeps asking for a root password in a
3521 neverending loop
</span></dt><dd><p>Have you
<i class=
"parameter"><tt>security = user
</tt></i>? Have
3522 you used
<b class=
"command">smbpasswd
</b> to give root a Samba account?
3523 You can do
2 things: open another terminal and execute
3524 <b class=
"command">smbpasswd -a root
</b> to create the account, and
3525 continue with entering the password into the first terminal. Or break
3526 out of the loop by hitting ENTER twice (without trying to type a
3527 password).
</p></dd><dt><span class=
"term">"cupsaddsmb
" gives
"No PPD file for printer...
"
3528 message (but I swear there is one!)
</span></dt><dd><div class=
"itemizedlist"><ul type=
"disc"><li><p>Have you enabled printer sharing on CUPS? This means:
3529 do you have a
<i class=
"parameter"><tt><Location
3530 /printers
>....
</Location
></tt></i> section in CUPS
3531 server's
<tt class=
"filename">cupsd.conf
</tt> which doesn't deny access to
3532 the host you run
"cupsaddsmb
" from? It
<span class=
"emphasis"><em>could
</em></span> be
3533 an issue if you use cupsaddsmb remotely, or if you use it with a
3534 <i class=
"parameter"><tt>-h
</tt></i> parameter:
<b class=
"command">cupsaddsmb -H
3535 sambaserver -h cupsserver -v printername
</b>.
3536 </p></li><li><p>Is your
3537 "TempDir
" directive in
3538 <span class=
"emphasis"><em>cupsd.conf
</em></span>
3539 set to a valid value and is it writeable?
3540 </p></li></ul></div></dd><dt><span class=
"term">I can't connect client to Samba printer.
</span></dt><dd><p>Use
<b class=
"command">smbstatus
</b> to check which user
3541 you are from Samba's point of view. Do you have the privileges to
3542 write into the
<i class=
"parameter"><tt>[print$]
</tt></i>
3543 share?
</p></dd><dt><span class=
"term">I can't reconnect to Samba under a new account
3544 from Win2K/XP
</span></dt><dd><p>Once you are connected as the
"wrong
" user (for
3545 example as
"nobody
", which often occurs if you have
<i class=
"parameter"><tt>map to
3546 guest = bad user
</tt></i>), Windows Explorer will not accept an
3547 attempt to connect again as a different user. There won't be any byte
3548 transfered on the wire to Samba, but still you'll see a stupid error
3549 message which makes you think that Samba has denied access. Use
3550 <b class=
"command">smbstatus
</b> to check for active connections. Kill the
3551 PIDs. You still can't re-connect and get the dreaded
3552 <tt class=
"computeroutput">You can't connect with a second account from the same
3553 machine
</tt> message, as soon as you are trying? And you
3554 don't see any single byte arriving at Samba (see logs; use
"ethereal
")
3555 indicating a renewed connection attempt? Shut all Explorer Windows.
3556 This makes Windows forget what it has cached in its memory as
3557 established connections. Then re-connect as the right user. Best
3558 method is to use a DOS terminal window and
<span class=
"emphasis"><em>first
</em></span>
3559 do
<b class=
"command">net use z: \\SAMBAHOST\print$ /user:root
</b>. Check
3560 with
<b class=
"command">smbstatus
</b> that you are connected under a
3561 different account. Now open the
"Printers
" folder (on the Samba server
3562 in the
<span class=
"emphasis"><em>Network Neighbourhood
</em></span>), right-click the
3563 printer in question and select
3564 <span class=
"emphasis"><em>Connect...
</em></span></p></dd><dt><span class=
"term">Avoid being connected to the Samba server as the
3565 "wrong
" user
</span></dt><dd><p>You see per
<b class=
"command">smbstatus
</b> that you are
3566 connected as user
"nobody
"; while you wanted to be
"root
" or
3567 "printeradmin
"? This is probably due to
<i class=
"parameter"><tt>map to guest = bad
3568 user
</tt></i>, which silently connects you under the guest account,
3569 when you gave (maybe by accident) an incorrect username. Remove
3570 <i class=
"parameter"><tt>map to guest
</tt></i>, if you want to prevent
3571 this.
</p></dd><dt><span class=
"term">Upgrading to CUPS drivers from Adobe drivers on
3572 NT/
2K/XP clients gives problems
</span></dt><dd><p>First delete all
"old
" Adobe-using printers. Then
3573 delete all
"old
" Adobe drivers. (On Win2K/XP, right-click in
3574 background of
"Printers
" folder, select
"Server Properties...
", select
3575 tab
"Drivers
" and delete here).
</p></dd><dt><span class=
"term">I can't use
"cupsaddsmb
"on a Samba server which is
3576 a PDC
</span></dt><dd><p>Do you use the
"naked
" root user name? Try to do it
3577 this way:
<span class=
"emphasis"><em>cupsaddsmb -U DOMAINNAME\\root -v
3578 printername
</em></span> (note the two backslashes: the first one is
3579 required to
"escape
" the second one).
</p></dd><dt><span class=
"term">I deleted a printer on Win2K; but I still see
3580 its driver
</span></dt><dd><p>Deleting a printer on the client won't delete the
3581 driver too (to verify, right-click on the white background of the
3582 "Printers
" folder, select
"Server Properties
" and click on the
3583 "Drivers
" tab). These same old drivers will be re-used when you try to
3584 install a printer with the same name. If you want to update to a new
3585 driver, delete the old ones first. Deletion is only possible if no
3586 other printer uses the same driver.
</p></dd><dt><span class=
"term">Win2K/XP
"Local Security
3587 Policies
"</span></dt><dd><p><span class=
"emphasis"><em>Local Security Policies
</em></span> may not
3588 allow the installation of unsigned drivers.
"Local Security Policies
"
3589 may not allow the installation of printer drivers at
3590 all.
</p></dd><dt><span class=
"term">WinXP clients:
"Administrator can not install
3591 printers for all local users
"</span></dt><dd><p>Windows XP handles SMB printers on a
"per-user
" basis.
3592 This means every user needs to install the printer himself. To have a
3593 printer available for everybody, you might want to use the built-in
3594 IPP client capabilities of WinXP. Add a printer with the print path of
3595 <span class=
"emphasis"><em>http://cupsserver:
631/printers/printername
</em></span>.
3596 Still looking into this one: maybe a
"logon script
" could
3597 automatically install printers for all
3598 users.
</p></dd><dt><span class=
"term">"Print Change Notify
" functions on
3599 NT-clients
</span></dt><dd><p>For
"print change notify
" functions on NT++ clients,
3600 these need to run the
"Server
" service first (re-named to
3601 <span class=
"emphasis"><em>File
& Print Sharing for MS Networks
</em></span> in
3602 XP).
</p></dd><dt><span class=
"term">WinXP-SP1
</span></dt><dd><p>WinXP-SP1 introduced a
<span class=
"emphasis"><em>Point and Print
3603 Restriction Policy
</em></span> (this restriction doesn't apply to
3604 "Administrator
" or
"Power User
" groups of users). In Group Policy
3605 Object Editor: go to
<span class=
"emphasis"><em>User Configuration --
>
3606 Administrative Templates --
> Control Panel --
>
3607 Printers
</em></span>. The policy is automatically set to
3608 <span class=
"emphasis"><em>Enabled
</em></span> and the
<span class=
"emphasis"><em>Users can only Point
3609 and Print to machines in their Forest
</em></span> . You probably need
3610 to change it to
<span class=
"emphasis"><em>Disabled
</em></span> or
<span class=
"emphasis"><em>Users can
3611 only Point and Print to these servers
</em></span> in order to make
3612 driver downloads from Samba possible.
</p></dd><dt><span class=
"term">I can't set and save default print options for all
3613 users on Win2K/XP
</span></dt><dd><p>How are you doing it? I bet the wrong way (it is not
3614 very easy to find out, though). There are
3 different ways to bring
3615 you to a dialog that
<span class=
"emphasis"><em>seems
</em></span> to set everything. All
3616 three dialogs
<span class=
"emphasis"><em>look
</em></span> the same. Only one of them
3617 <span class=
"emphasis"><em>does
</em></span> what you intend. You need to be
3618 Administrator or Print Administrator to do this for all users. Here
3619 is how I do in on XP:
3620 </p><div class=
"orderedlist"><ol type=
"A"><li><p>The first
"wrong
" way:
3622 </p><div class=
"orderedlist"><ol type=
"1"><li><p>Open the
<span class=
"emphasis"><em>Printers
</em></span>
3623 folder.
</p></li><li><p>Right-click on the printer
3624 (
<span class=
"emphasis"><em>remoteprinter on cupshost
</em></span>) and
3625 select in context menu
<span class=
"emphasis"><em>Printing
3626 Preferences...
</em></span></p></li><li><p>Look at this dialog closely and remember what it looks
3627 like.
</p></li></ol></div><p>
3628 </p></li><li><p>The second
"wrong
" way:
3630 </p><div class=
"orderedlist"><ol type=
"1"><li><p>Open the
<span class=
"emphasis"><em>Printers
</em></span>
3631 folder.
</p></li><li><p>Right-click on the printer (
<span class=
"emphasis"><em>remoteprinter on
3632 cupshost
</em></span>) and select in the context menu
3633 <span class=
"emphasis"><em>Properties
</em></span></p></li><li><p>Click on the
<span class=
"emphasis"><em>General
</em></span>
3634 tab
</p></li><li><p>Click on the button
<span class=
"emphasis"><em>Printing
3635 Preferences...
</em></span></p></li><li><p>A new dialog opens. Keep this dialog open and go back
3636 to the parent dialog.
</p></li></ol></div><p>
3637 </p></li><li><p>The third, the
"correct
" way: (should you do
3638 this from the beginning, just carry out steps
1. and
2. from second
3639 "way
" above)
3641 </p><div class=
"orderedlist"><ol type=
"1"><li><p>Click on the
<span class=
"emphasis"><em>Advanced
</em></span>
3642 tab. (Hmmm... if everything is
"Grayed Out
", then you are not logged
3643 in as a user with enough privileges).
</p></li><li><p>Click on the
<span class=
"emphasis"><em>Printing
3644 Defaults...
</em></span> button.
</p></li><li><p>On any of the two new tabs, click on the
3645 <span class=
"emphasis"><em>Advanced...
</em></span>
3646 button.
</p></li><li><p>A new dialog opens. Compare this one to the other,
3647 identical looking one from
"B
.5" or A
.3".
</p></li></ol></div><p>
3648 </p></li></ol></div><p>
3649 Do you see any difference? I don't either... However, only the last
3650 one, which you arrived at with steps
"C
.1.-
6.
" will save any settings
3651 permanently and be the defaults for new users. If you want all clients
3652 to get the same defaults, you need to conduct these steps
<span class=
"emphasis"><em>as
3653 Administrator
</em></span> (
<i class=
"parameter"><tt>printer admin
</tt></i> in
3654 <tt class=
"filename">smb.conf
</tt>)
<span class=
"emphasis"><em>before
</em></span> a client
3655 downloads the driver (the clients can later set their own
3656 <span class=
"emphasis"><em>per-user defaults
</em></span> by following the
3657 procedures
<span class=
"emphasis"><em>A.
</em></span> or
<span class=
"emphasis"><em>B.
</em></span>
3658 above).
</p></dd><dt><span class=
"term">What are the most common blunders in driver
3659 settings on Windows clients?
</span></dt><dd><p>Don't use
<span class=
"emphasis"><em>Optimize for
3660 Speed
</em></span>: use
<span class=
"emphasis"><em>Optimize for
3661 Portability
</em></span> instead (Adobe PS Driver) Don't use
3662 <span class=
"emphasis"><em>Page Independence: No
</em></span>: always
3663 settle with
<span class=
"emphasis"><em>Page Independence:
3664 Yes
</em></span> (Microsoft PS Driver and CUPS PS Driver for
3665 WinNT/
2K/XP) If there are problems with fonts: use
3666 <span class=
"emphasis"><em>Download as Softfont into
3667 printer
</em></span> (Adobe PS Driver). For
3668 <span class=
"emphasis"><em>TrueType Download Options
</em></span>
3669 choose
<span class=
"emphasis"><em>Outline
</em></span>. Use PostScript
3670 Level
2, if you are having trouble with a non-PS printer, and if
3671 there is a choice.
</p></dd><dt><span class=
"term">I can't make
<b class=
"command">cupsaddsmb
</b> work
3672 with newly installed printer
</span></dt><dd><p>Symptom: the last command of
3673 <b class=
"command">cupsaddsmb
</b> doesn't complete successfully:
3674 <b class=
"command">cmd = setdriver printername printername
</b> result was
3675 NT_STATUS_UNSUCCESSFUL then possibly the printer was not yet
3676 "recognized
" by Samba. Did it show up in
<span class=
"emphasis"><em>Network
3677 Neighbourhood
</em></span>? Did it show up in
<b class=
"command">rpcclient
3678 hostname -c 'enumprinters'
</b>? Restart smbd (or send a
3679 <b class=
"command">kill -HUP
</b> to all processes listed by
3680 <b class=
"command">smbstatus
</b> and try
3681 again.
</p></dd><dt><span class=
"term">My permissions on
3682 <tt class=
"filename">/var/spool/samba/
</tt> get reset after each
3683 reboot
</span></dt><dd><p>Have you by accident set the CUPS spool directory to
3684 the same location? (
<i class=
"parameter"><tt>RequestRoot
3685 /var/spool/samba/
</tt></i> in
<tt class=
"filename">cupsd.conf
</tt> or
3686 the other way round:
<tt class=
"filename">/var/spool/cups/
</tt> is set as
3687 <i class=
"parameter"><tt>path
</tt></i> in the
<i class=
"parameter"><tt>[printers]
</tt></i>
3688 section). These
<span class=
"emphasis"><em>must
</em></span> be different. Set
3689 <i class=
"parameter"><tt>RequestRoot /var/spool/cups/
</tt></i> in
3690 <tt class=
"filename">cupsd.conf
</tt> and
<i class=
"parameter"><tt>path =
3691 /var/spool/samba
</tt></i> in the
<i class=
"parameter"><tt>[printers]
</tt></i>
3692 section of
<tt class=
"filename">smb.conf
</tt>. Otherwise cupsd will
3693 sanitize permissions to its spool directory with each restart, and
3694 printing will not work reliably.
</p></dd><dt><span class=
"term">My printers work fine: just the printer named
"lp
"
3695 intermittently swallows jobs and spits out completely different
3696 ones
</span></dt><dd><p>It is a very bad idea to name any printer
"lp
". This
3697 is the traditional Unix name for the default printer. CUPS may be set
3698 up to do an automatic creation of
"Implicit Classes
". This means, to
3699 group all printers with the same name to a pool of devices, and
3700 loadbalancing the jobs across them in a round-robin fashion. Chances
3701 are high that someone else has an
"lp
" named printer too. You may
3702 receive his jobs and send your own to his device unwittingly. To have
3703 tight control over the printer names, set
<i class=
"parameter"><tt>BrowseShortNames
3704 No
</tt></i>. It will present any printer as
"printername@cupshost
"
3705 then, giving you a better control over what may happen in a large
3706 networked environment.
</p></dd><dt><span class=
"term">How do I
"watch
" my Samba server?
</span></dt><dd><p>You can use
<b class=
"command">tail -f
3707 /var/log/samba/log.smbd
</b> (you may need a different path) to
3708 see a live scrolling of all log messages.
<b class=
"command">smbcontrol smbd
3709 debuglevel
</b> tells you which verbosity goes into the
3710 logs.
<b class=
"command">smbcontrol smbd debug
3</b> sets the verbosity to
3711 a quite high level (you can choose from
0 to
10 or
100). This works
3712 "on the fly
", without the need to restart the smbd daemon. Don't use
3713 more than
3 initially; or you'll drown in an ocean of
3714 messages.
</p></dd><dt><span class=
"term">I can't use Samba from my WinXP Home box, while
3715 access from WinXP Prof works flawlessly
</span></dt><dd><p>You have our condolences! WinXP home has been
3716 completely neutered by Microsoft as compared to WinXP Prof: you can
3717 not log into a WinNT domain. It cannot join a Win NT domain as a
3718 member server. While it is possible to access domain resources, users
3719 don't have
"single sign-on
". They need to supply username and password
3720 each time they connect to a resource. Logon scripts and roaming
3721 profiles are not supported. It can serve file and print shares; but
3722 only in
"share-mode security
" level. It can not use
"user-mode
3723 security
" (what Windows
95/
98/ME still can
3724 do).
</p></dd><dt><span class=
"term">Where do I find the Adobe PostScript driver files
3725 I need for
"cupsaddsmb
"?
</span></dt><dd><p>Use
<b class=
"command">smbclient
</b> to connect to any
3726 Windows box with a shared PostScript printer:
<b class=
"command">smbclient
3727 //windowsbox/print\$ -U guest
</b>. You can navigate to the
3728 <tt class=
"filename">W32X86/
2</tt> subdir to
<b class=
"command">mget ADOBE*
</b>
3729 and other files or to
<tt class=
"filename">WIN40/
0</tt> to do the same. --
3730 Another option is to download the
<tt class=
"filename">*.exe
</tt> packaged
3731 files from the Adobe website.
</p></dd></dl></div></div><div class=
"sect2" lang=
"en"><div class=
"titlepage"><div><div><h3 class=
"title"><a name=
"id2966041"></a>An Overview of the CUPS Printing Processes
</h3></div></div><div></div></div><p>
3732 </p><div class=
"figure"><a name=
"id2966052"></a><p class=
"title"><b>Figure
19.15. CUPS Printing Overview
</b></p><div class=
"mediaobject"><img src=
"projdoc/imagefiles/a_small.png" alt=
"CUPS Printing Overview"></div></div><p>
3733 </p></div></div></div><div class=
"navfooter"><hr><table width=
"100%" summary=
"Navigation footer"><tr><td width=
"40%" align=
"left"><a accesskey=
"p" href=
"printing.html">Prev
</a> </td><td width=
"20%" align=
"center"><a accesskey=
"u" href=
"optional.html">Up
</a></td><td width=
"40%" align=
"right"> <a accesskey=
"n" href=
"VFS.html">Next
</a></td></tr><tr><td width=
"40%" align=
"left" valign=
"top">Chapter
18. Classical Printing Support
</td><td width=
"20%" align=
"center"><a accesskey=
"h" href=
"index.html">Home
</a></td><td width=
"40%" align=
"right" valign=
"top"> Chapter
20. Stackable VFS modules
</td></tr></table></div></body></html>