regenerate
[Samba.git] / docs / htmldocs / CUPS-printing.html
blob19c9d7a021602dc4c74ce56d0392675a72b68742
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 19. CUPS Printing Support</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</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</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">&lt;<a href="mailto:kpfeifle@danka.de">kpfeifle@danka.de</a>&gt;</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">&lt;<a href="mailto:CVizitiu@gbif.org">CVizitiu@gbif.org</a>&gt;</tt></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Jelmer</span> <span class="othername">R.</span> <span class="surname">Vernooij</span></h3><span class="contrib">drawings</span><div class="affiliation"><span class="orgname">The Samba Team<br></span><div class="address"><p><tt class="email">&lt;<a href="mailto:jelmer@samba.org">jelmer@samba.org</a>&gt;</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#id2931072">Introduction</a></dt><dd><dl><dt><a href="CUPS-printing.html#id2931079">Features and Benefits</a></dt><dt><a href="CUPS-printing.html#id2931130">Overview</a></dt></dl></dd><dt><a href="CUPS-printing.html#id2931182">Basic CUPS Support Configuration</a></dt><dd><dl><dt><a href="CUPS-printing.html#id2931276">Linking smbd with libcups.so</a></dt><dt><a href="CUPS-printing.html#id2931526">Simple smb.conf Settings for CUPS</a></dt><dt><a href="CUPS-printing.html#id2931722">More Complex CUPS smb.conf Settings</a></dt></dl></dd><dt><a href="CUPS-printing.html#id2932089">Advanced Configuration</a></dt><dd><dl><dt><a href="CUPS-printing.html#id2932110">Central Spooling vs. Peer-to-Peer Printing</a></dt><dt><a href="CUPS-printing.html#id2932163">Raw Print Serving Vendor Drivers on Windows Clients</a></dt><dt><a href="CUPS-printing.html#id2932223">Installation of Windows Client Drivers</a></dt><dt><a href="CUPS-printing.html#cups-raw">Explicitly Enable raw Printing for application/octet-stream</a></dt><dt><a href="CUPS-printing.html#id2932552">Driver Upload Methods</a></dt></dl></dd><dt><a href="CUPS-printing.html#id2932699">Advanced Intelligent Printing with PostScript Driver Download</a></dt><dd><dl><dt><a href="CUPS-printing.html#gdipost">GDI on Windows -- PostScript on UNIX</a></dt><dt><a href="CUPS-printing.html#id2932876">Windows Drivers, GDI and EMF</a></dt><dt><a href="CUPS-printing.html#id2933049">UNIX Printfile Conversion and GUI Basics</a></dt><dt><a href="CUPS-printing.html#post-and-ghost">PostScript and Ghostscript</a></dt><dt><a href="CUPS-printing.html#id2933354">Ghostscript the Software RIP for Non-PostScript Printers</a></dt><dt><a href="CUPS-printing.html#id2933497">PostScript Printer Description (PPD) Specification</a></dt><dt><a href="CUPS-printing.html#id2933573">Using Windows-Formatted Vendor PPDs</a></dt><dt><a href="CUPS-printing.html#id2933679">CUPS Also Uses PPDs for Non-PostScript Printers</a></dt></dl></dd><dt><a href="CUPS-printing.html#id2933709">The CUPS Filtering Architecture</a></dt><dd><dl><dt><a href="CUPS-printing.html#id2933883">MIME Types and CUPS Filters</a></dt><dt><a href="CUPS-printing.html#id2934118">MIME Type Conversion Rules</a></dt><dt><a href="CUPS-printing.html#id2934287">Filtering Overview</a></dt><dt><a href="CUPS-printing.html#id2934481">Prefilters</a></dt><dt><a href="CUPS-printing.html#id2934591">pstops</a></dt><dt><a href="CUPS-printing.html#id2934715">pstoraster</a></dt><dt><a href="CUPS-printing.html#id2934912">imagetops and imagetoraster</a></dt><dt><a href="CUPS-printing.html#id2934991">rasterto [printers specific]</a></dt><dt><a href="CUPS-printing.html#id2935143">CUPS Backends</a></dt><dt><a href="CUPS-printing.html#id2935508">The Role of cupsomatic/foomatic</a></dt><dt><a href="CUPS-printing.html#id2935673">The Complete Picture</a></dt><dt><a href="CUPS-printing.html#id2935688">mime.convs</a></dt><dt><a href="CUPS-printing.html#id2935752">Raw Printing</a></dt><dt><a href="CUPS-printing.html#id2935861">application/octet-stream Printing</a></dt><dt><a href="CUPS-printing.html#id2936129">PostScript Printer Descriptions (PPDs) for Non-PS Printers</a></dt><dt><a href="CUPS-printing.html#id2936430">cupsomatic/foomatic-rip Versus native CUPS Printing</a></dt><dt><a href="CUPS-printing.html#id2936743">Examples for Filtering Chains</a></dt><dt><a href="CUPS-printing.html#id2937128">Sources of CUPS Drivers/PPDs</a></dt><dt><a href="CUPS-printing.html#id2937265">Printing with Interface Scripts</a></dt></dl></dd><dt><a href="CUPS-printing.html#id2937358">Network Printing (Purely Windows)</a></dt><dd><dl><dt><a href="CUPS-printing.html#id2937377">From Windows Clients to an NT Print Server</a></dt><dt><a href="CUPS-printing.html#id2937434">Driver Execution on the Client</a></dt><dt><a href="CUPS-printing.html#id2937506">Driver Execution on the Server</a></dt></dl></dd><dt><a href="CUPS-printing.html#id2937618">Network Printing (Windows Clients UNIX/Samba Print
2 Servers)</a></dt><dd><dl><dt><a href="CUPS-printing.html#id2937639">From Windows Clients to a CUPS/Samba Print Server</a></dt><dt><a href="CUPS-printing.html#id2937834">Samba Receiving Jobfiles and Passing Them to CUPS</a></dt></dl></dd><dt><a href="CUPS-printing.html#id2937924">Network PostScript RIP</a></dt><dd><dl><dt><a href="CUPS-printing.html#id2938025">PPDs for Non-PS Printers on UNIX</a></dt><dt><a href="CUPS-printing.html#id2938085">PPDs for Non-PS Printers on Windows</a></dt></dl></dd><dt><a href="CUPS-printing.html#id2938166">Windows Terminal Servers (WTS) as CUPS Clients</a></dt><dd><dl><dt><a href="CUPS-printing.html#id2938184">Printer Drivers Running in Kernel Mode Cause Many
3 Problems</a></dt><dt><a href="CUPS-printing.html#id2938229">Workarounds Impose Heavy Limitations</a></dt><dt><a href="CUPS-printing.html#id2938250">CUPS: A Magical Stone?</a></dt><dt><a href="CUPS-printing.html#id2938313">PostScript Drivers with No Major Problems Even in Kernel
4 Mode</a></dt></dl></dd><dt><a href="CUPS-printing.html#id2938378">Configuring CUPS for Driver Download</a></dt><dd><dl><dt><a href="CUPS-printing.html#id2938397">cupsaddsmb: The Unknown Utility</a></dt><dt><a href="CUPS-printing.html#id2938514">Prepare Your smb.conf for cupsaddsmb</a></dt><dt><a href="CUPS-printing.html#id2938755">CUPS PostScript Driver for Windows NT/200x/XP</a></dt><dt><a href="CUPS-printing.html#id2939044">Recognizing Different Driver Files</a></dt><dt><a href="CUPS-printing.html#id2939174">Acquiring the Adobe Driver Files</a></dt><dt><a href="CUPS-printing.html#id2939204">ESP Print Pro PostScript Driver for Windows NT/200x/XP</a></dt><dt><a href="CUPS-printing.html#id2939274">Caveats to be Considered</a></dt><dt><a href="CUPS-printing.html#id2939571">Windows CUPS PostScript Driver Versus Adobe Driver</a></dt><dt><a href="CUPS-printing.html#id2939801">Run cupsaddsmb (Quiet Mode)</a></dt><dt><a href="CUPS-printing.html#id2939946">Run cupsaddsmb with Verbose Output</a></dt><dt><a href="CUPS-printing.html#id2940175">Understanding cupsaddsmb</a></dt><dt><a href="CUPS-printing.html#id2940352">How to Recognize If cupsaddsmb Completed Successfully</a></dt><dt><a href="CUPS-printing.html#id2940450">cupsaddsmb with a Samba PDC</a></dt><dt><a href="CUPS-printing.html#id2940538">cupsaddsmb Flowchart</a></dt><dt><a href="CUPS-printing.html#id2940621">Installing the PostScript Driver on a Client</a></dt><dt><a href="CUPS-printing.html#id2940801">Avoiding Critical PostScript Driver Settings on the Client</a></dt></dl></dd><dt><a href="CUPS-printing.html#id2940875">Installing PostScript Driver Files Manually Using rpcclient</a></dt><dd><dl><dt><a href="CUPS-printing.html#id2941083">A Check of the rpcclient man Page</a></dt><dt><a href="CUPS-printing.html#id2941229">Understanding the rpcclient man Page</a></dt><dt><a href="CUPS-printing.html#id2941358">Producing an Example by Querying a Windows Box</a></dt><dt><a href="CUPS-printing.html#id2941534">Requirements for adddriver and setdriver to Succeed</a></dt><dt><a href="CUPS-printing.html#id2941782">Manual Driver Installation in 15 Steps</a></dt><dt><a href="CUPS-printing.html#id2942909">Troubleshooting Revisited</a></dt></dl></dd><dt><a href="CUPS-printing.html#id2943077">The Printing *.tdb Files</a></dt><dd><dl><dt><a href="CUPS-printing.html#id2943322">Trivial Database Files</a></dt><dt><a href="CUPS-printing.html#id2943400">Binary Format</a></dt><dt><a href="CUPS-printing.html#id2943470">Losing *.tdb Files</a></dt><dt><a href="CUPS-printing.html#id2943528">Using tdbbackup</a></dt></dl></dd><dt><a href="CUPS-printing.html#id2943673">CUPS Print Drivers from Linuxprinting.org</a></dt><dd><dl><dt><a href="CUPS-printing.html#id2943860">foomatic-rip and Foomatic Explained</a></dt><dt><a href="CUPS-printing.html#id2944657">foomatic-rip and Foomatic-PPD Download and Installation</a></dt></dl></dd><dt><a href="CUPS-printing.html#id2945207">Page Accounting with CUPS</a></dt><dd><dl><dt><a href="CUPS-printing.html#id2945248">Setting Up Quotas</a></dt><dt><a href="CUPS-printing.html#id2945318">Correct and Incorrect Accounting</a></dt><dt><a href="CUPS-printing.html#id2945366">Adobe and CUPS PostScript Drivers for Windows Clients</a></dt><dt><a href="CUPS-printing.html#id2945495">The page_log File Syntax</a></dt><dt><a href="CUPS-printing.html#id2945665">Possible Shortcomings</a></dt><dt><a href="CUPS-printing.html#id2945745">Future Developments</a></dt></dl></dd><dt><a href="CUPS-printing.html#id2945799">Additional Material</a></dt><dt><a href="CUPS-printing.html#id2946030">Auto-Deletion or Preservation of CUPS Spool Files</a></dt><dd><dl><dt><a href="CUPS-printing.html#id2946094">CUPS Configuration Settings Explained</a></dt><dt><a href="CUPS-printing.html#id2946198">Pre-Conditions</a></dt><dt><a href="CUPS-printing.html#id2946367">Manual Configuration</a></dt></dl></dd><dt><a href="CUPS-printing.html#id2946425">Printing from CUPS to Windows Attached Printers</a></dt><dt><a href="CUPS-printing.html#id2946721">More CUPS-Filtering Chains</a></dt><dt><a href="CUPS-printing.html#id2946814">Common Errors</a></dt><dd><dl><dt><a href="CUPS-printing.html#id2946820">Windows 9x/ME Client Can't Install Driver</a></dt><dt><a href="CUPS-printing.html#id2946839">cupsaddsmb Keeps Asking for Root Password in Never-ending Loop</a></dt><dt><a href="CUPS-printing.html#id2946889">cupsaddsmb Errors</a></dt><dt><a href="CUPS-printing.html#id2946973">Client Can't Connect to Samba Printer</a></dt><dt><a href="CUPS-printing.html#id2947002">New Account Reconnection from Windows 200x/XP Troubles</a></dt><dt><a href="CUPS-printing.html#id2947106">Avoid Being Connected to the Samba Server as the Wrong User</a></dt><dt><a href="CUPS-printing.html#id2947158">Upgrading to CUPS Drivers from Adobe Drivers</a></dt><dt><a href="CUPS-printing.html#id2947200">Can't Use cupsaddsmb on Samba Server Which Is a PDC</a></dt><dt><a href="CUPS-printing.html#id2947239">Deleted Windows 200x Printer Driver Is Still Shown</a></dt><dt><a href="CUPS-printing.html#id2947278">Windows 200x/XP "Local Security Policies"</a></dt><dt><a href="CUPS-printing.html#id2947293">Administrator Cannot Install Printers for All Local Users</a></dt><dt><a href="CUPS-printing.html#id2947323">Print Change Notify Functions on NT-clients</a></dt><dt><a href="CUPS-printing.html#id2947350">WinXP-SP1</a></dt><dt><a href="CUPS-printing.html#id2947402">Print Options for All Users Can't Be Set on Windows 200x/XP</a></dt><dt><a href="CUPS-printing.html#id2947717">Most Common Blunders in Driver Settings on Windows Clients</a></dt><dt><a href="CUPS-printing.html#id2947779">cupsaddsmb Does Not Work with Newly Installed Printer</a></dt><dt><a href="CUPS-printing.html#id2947835">Permissions on /var/spool/samba/ Get Reset After Each Reboot</a></dt><dt><a href="CUPS-printing.html#id2947951">Print Queue Called lp Mis-handles Print Jobs</a></dt><dt><a href="CUPS-printing.html#id2948008">Location of Adobe PostScript Driver Files for cupsaddsmb</a></dt></dl></dd><dt><a href="CUPS-printing.html#id2948065">Overview of the CUPS Printing Processes</a></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2931072"></a>Introduction</h2></div></div><div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2931079"></a>Features and Benefits</h3></div></div><div></div></div><p>
5 The Common UNIX Print System (<ulink url="http://www.cups.org/">CUPS</ulink>)
6 has become quite popular. All major Linux distributions now ship it as their default printing
7 system. To many, it is still a mystical tool. Mostly, it just works.
8 People tend to regard it as a &#8220;<span class="quote">black box</span>&#8221;
9 that they do not want to look into as long as it works. But once
10 there is a little problem, they are in trouble to find out where to
11 start debugging it. Refer to the chapter &#8220;<span class="quote">Classical Printing</span>&#8221; that
12 contains a lot of information that is relevant for CUPS.
13 </p><p>
14 CUPS sports quite a few unique and powerful features. While their
15 basic functions may be grasped quite easily, they are also
16 new. Because they are different from other, more traditional printing
17 systems, it is best not to try and apply any prior knowledge about
18 printing to this new system. Rather, try to understand CUPS
19 from the beginning. This documentation will lead you to a
20 complete understanding of CUPS. Let's start with the most basic
21 things first.
22 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2931130"></a>Overview</h3></div></div><div></div></div><p>
23 CUPS is more than just a print spooling system. It is a complete
24 printer management system that complies with the new
25 Internet Printing Protocol (IPP). IPP is an industry
26 and Internet Engineering Task Force (IETF)
27 standard for network printing. Many of its functions can be managed
28 remotely (or locally) via a Web browser (giving you a
29 platform-independent access to the CUPS print server). Additionally, it
30 has the traditional command line and several more modern GUI interfaces
31 (GUI interfaces developed by third parties, like KDE's
32 overwhelming <ulink url="http://printing.kde.org/">KDEPrint</ulink>).
33 </p><p>
34 CUPS allows creation of &#8220;<span class="quote">raw</span>&#8221; printers (i.e., no print file
35 format translation) as well as &#8220;<span class="quote">smart</span>&#8221; printers (i.e., CUPS does
36 file format conversion as required for the printer). In many ways
37 this gives CUPS similar capabilities to the MS Windows print
38 monitoring system. Of course, if you are a CUPS advocate, you would
39 argue that CUPS is better! In any case, let us now move on to
40 explore how one may configure CUPS for interfacing with MS Windows
41 print clients via Samba.
42 </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2931182"></a>Basic CUPS Support Configuration</h2></div></div><div></div></div><p>
43 Printing with CUPS in the most basic <tt class="filename">smb.conf</tt> setup in Samba-3.0 (as was true for 2.2.x) only needs two
44 settings: <a class="indexterm" name="id2931202"></a><i class="parameter"><tt>printing</tt></i> = cups and
45 <a class="indexterm" name="id2931216"></a><i class="parameter"><tt>printcap</tt></i> = cups. CUPS does not need a printcap file.
46 However, the <tt class="filename">cupsd.conf</tt> configuration file knows of two related directives that control
47 how such a file will be automatically created and maintained by CUPS for the convenience of third-party
48 applications (example: <i class="parameter"><tt>Printcap /etc/printcap</tt></i> and <i class="parameter"><tt>PrintcapFormat BSD</tt></i>).
49 Legacy programs often require the existence of a printcap file containing printer names or they will refuse to
50 print. Make sure CUPS is set to generate and maintain a printcap file. For details, see
51 <b class="command">man cupsd.conf</b> and other CUPS-related documentation, like the wealth of documents on your CUPS server
52 itself: <ulink url="http://localhost:631/documentation.html">http://localhost:631/documentation.html</ulink>.
53 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2931276"></a>Linking smbd with libcups.so</h3></div></div><div></div></div><p>
54 Samba has a special relationship to CUPS. Samba can be compiled with CUPS library support.
55 Most recent installations have this support enabled. Per default, CUPS linking is compiled
56 into smbd and other Samba binaries. Of course, you can use CUPS even
57 if Samba is not linked against <tt class="filename">libcups.so</tt> but
58 there are some differences in required or supported configuration.
59 </p><p>
60 When Samba is compiled against <tt class="filename">libcups</tt>, <a class="indexterm" name="id2931315"></a><i class="parameter"><tt>printcap</tt></i> = cups
61 uses the CUPS API to list printers, submit jobs, query queues, and so on. Otherwise it maps to the System V
62 commands with an additional <b class="command">-oraw</b> option for printing. On a Linux
63 system, you can use the <b class="command">ldd</b> utility to find out details (ldd may not be present on
64 other OS platforms, or its function may be embodied by a different command):
65 </p><pre class="screen">
66 <tt class="prompt">root# </tt><b class="userinput"><tt>ldd `which smbd`</tt></b>
67 libssl.so.0.9.6 =&gt; /usr/lib/libssl.so.0.9.6 (0x4002d000)
68 libcrypto.so.0.9.6 =&gt; /usr/lib/libcrypto.so.0.9.6 (0x4005a000)
69 libcups.so.2 =&gt; /usr/lib/libcups.so.2 (0x40123000)
70 [....]
71 </pre><p>
72 The line <tt class="computeroutput">libcups.so.2 =&gt; /usr/lib/libcups.so.2 (0x40123000)</tt> shows
73 there is CUPS support compiled into this version of Samba. If this is the case, and printing = cups
74 is set, then <span class="emphasis"><em>any otherwise manually set print command in <tt class="filename">smb.conf</tt> is ignored</em></span>.
75 This is an important point to remember!
76 </p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p> Should it be necessary, for any reason, to set your own print commands, you can do this by setting
77 <a class="indexterm" name="id2931409"></a><i class="parameter"><tt>printing</tt></i> = sysv. However, you will loose all the benefits
78 of tight CUPS/Samba integration. When you do this you must manually configure the printing system commands
79 (most important:
80 <a class="indexterm" name="id2931426"></a><i class="parameter"><tt>print command</tt></i>; other commands are
81 <a class="indexterm" name="id2931440"></a><i class="parameter"><tt>lppause command</tt></i>,
82 <a class="indexterm" name="id2931454"></a><i class="parameter"><tt>lpresume command</tt></i>,
83 <a class="indexterm" name="id2931468"></a><i class="parameter"><tt>lpq command</tt></i>,
84 <a class="indexterm" name="id2931482"></a><i class="parameter"><tt>lprm command</tt></i>,
85 <a class="indexterm" name="id2931496"></a><i class="parameter"><tt>queuepause command</tt></i> and
86 <a class="indexterm" name="id2931510"></a><i class="parameter"><tt>queue resume command</tt></i>).</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2931526"></a>Simple <tt class="filename">smb.conf</tt> Settings for CUPS</h3></div></div><div></div></div><p>
87 To summarize, <link linkend="cups-exam-simple"> shows simplest printing-related setup for <tt class="filename">smb.conf</tt> to enable basic CUPS support:
88 </p><div class="example"><a name="cups-exam-simple"></a><p class="title"><b>Example 19.1. Simplest printing-related smb.conf</b></p><table class="simplelist" border="0" summary="Simple list"><tr><td> </td></tr><tr><td><i class="parameter"><tt>[global]</tt></i></td></tr><tr><td><i class="parameter"><tt>load printers = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>printing = cups</tt></i></td></tr><tr><td><i class="parameter"><tt>printcap name = cups</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[printers]</tt></i></td></tr><tr><td><i class="parameter"><tt>comment = All Printers</tt></i></td></tr><tr><td><i class="parameter"><tt>path = /var/spool/samba</tt></i></td></tr><tr><td><i class="parameter"><tt>browseable = no</tt></i></td></tr><tr><td><i class="parameter"><tt>public = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>guest ok = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>writable = no</tt></i></td></tr><tr><td><i class="parameter"><tt>printable = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>printer admin = root, @ntadmins</tt></i></td></tr></table></div><p>
89 This is all you need for basic printing setup for CUPS. It will print
90 all graphic, text, PDF, and PostScript files submitted from Windows
91 clients. However, most of your Windows users would not know how to
92 send these kinds of files to print without opening a GUI
93 application. Windows clients tend to have local printer drivers
94 installed, and the GUI application's print buttons start a printer
95 driver. Your users also rarely send files from the command
96 line. Unlike UNIX clients, they hardly submit graphic, text or PDF
97 formatted files directly to the spooler. They nearly exclusively print
98 from GUI applications with a &#8220;<span class="quote">printer driver</span>&#8221; hooked in between the
99 application's native format and the print-data-stream. If the backend
100 printer is not a PostScript device, the print data stream is &#8220;<span class="quote">binary,</span>&#8221;
101 sensible only for the target printer. Read on to learn which problem
102 this may cause and how to avoid it.
103 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2931722"></a>More Complex CUPS <tt class="filename">smb.conf</tt> Settings</h3></div></div><div></div></div><p>
104 <link linkend="overridesettings"> is a slightly more complex printing-related setup
105 for <tt class="filename">smb.conf</tt>. It enables general CUPS printing
106 support for all printers, but defines one printer share, which is set
107 up differently.
108 </p><div class="example"><a name="overridesettings"></a><p class="title"><b>Example 19.2. Overriding global CUPS settings for one printer</b></p><table class="simplelist" border="0" summary="Simple list"><tr><td> </td></tr><tr><td><i class="parameter"><tt>[global]</tt></i></td></tr><tr><td><i class="parameter"><tt>printing = cups</tt></i></td></tr><tr><td><i class="parameter"><tt>printcap name = cups</tt></i></td></tr><tr><td><i class="parameter"><tt>load printers = yes</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[printers]</tt></i></td></tr><tr><td><i class="parameter"><tt>comment = All Printers</tt></i></td></tr><tr><td><i class="parameter"><tt>path = /var/spool/samba</tt></i></td></tr><tr><td><i class="parameter"><tt>public = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>guest ok = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>writable = no</tt></i></td></tr><tr><td><i class="parameter"><tt>printable = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>printer admin = root, @ntadmins</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[special_printer]</tt></i></td></tr><tr><td><i class="parameter"><tt>comment = A special printer with his own settings</tt></i></td></tr><tr><td><i class="parameter"><tt>path = /var/spool/samba-special</tt></i></td></tr><tr><td><i class="parameter"><tt>printing = sysv</tt></i></td></tr><tr><td><i class="parameter"><tt>printcap = lpstat</tt></i></td></tr><tr><td><i class="parameter"><tt>print command = echo "NEW: `date`: printfile %f" &gt;&gt; /tmp/smbprn.log ; \</tt></i></td></tr><tr><td><i class="parameter"><tt>echo " `date`: p-%p s-%s f-%f" &gt;&gt; /tmp/smbprn.log ; \</tt></i></td></tr><tr><td><i class="parameter"><tt>echo " `date`: j-%j J-%J z-%z c-%c" &gt;&gt; /tmp/smbprn.log : rm %f</tt></i></td></tr><tr><td><i class="parameter"><tt>public = no</tt></i></td></tr><tr><td><i class="parameter"><tt>guest ok = no</tt></i></td></tr><tr><td><i class="parameter"><tt>writeable = no</tt></i></td></tr><tr><td><i class="parameter"><tt>printable = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>printer admin = kurt</tt></i></td></tr><tr><td><i class="parameter"><tt>hosts deny = 0.0.0.0</tt></i></td></tr><tr><td><i class="parameter"><tt>hosts allow = turbo_xp, 10.160.50.23, 10.160.51.60</tt></i></td></tr></table></div><p>
109 This special share is only there for testing purposes. It does not write the print job to a file. It just logs the job parameters
110 known to Samba into the <tt class="filename">/tmp/smbprn.log</tt> file and deletes the jobfile. Moreover, the
111 <a class="indexterm" name="id2932031"></a><i class="parameter"><tt>printer admin</tt></i> of this share is &#8220;<span class="quote">kurt</span>&#8221; (not the &#8220;<span class="quote">@ntadmins</span>&#8221; group),
112 guest access is not allowed, the share isn't published to the Network Neighborhood (so you need to know it is there), and it only
113 allows access from only three hosts. To prevent CUPS kicking in and taking over the print jobs for that share, we need to set
114 <a class="indexterm" name="id2932058"></a><i class="parameter"><tt>printing</tt></i> = sysv and
115 <a class="indexterm" name="id2932072"></a><i class="parameter"><tt>printcap</tt></i> = lpstat.
116 </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2932089"></a>Advanced Configuration</h2></div></div><div></div></div><p>
117 Before we delve into all the configuration options, let us clarify a few
118 points. <span class="emphasis"><em>Network printing needs to be organized and setup
119 correctly</em></span>. This frequently doesn't happen. Legacy systems
120 or small business LAN environments often lack design and good housekeeping.
121 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2932110"></a>Central Spooling vs. &#8220;<span class="quote">Peer-to-Peer</span>&#8221; Printing</h3></div></div><div></div></div><p>
122 <a class="indexterm" name="id2932125"></a>
123 <a class="indexterm" name="id2932136"></a>
124 Many small office or home networks, as well as badly organized larger
125 environments, allow each client a direct access to available network
126 printers. This is generally a bad idea. It often blocks one client's
127 access to the printer when another client's job is printing. It might
128 freeze the first client's application while it is waiting to get
129 rid of the job. Also, there are frequent complaints about various jobs
130 being printed with their pages mixed with each other. A better concept
131 is the usage of a print server: it routes all jobs through one
132 central system, which responds immediately, takes jobs from multiple
133 concurrent clients at the same time, and in turn transfers them to the
134 printer(s) in the correct order.
135 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2932163"></a>Raw Print Serving Vendor Drivers on Windows Clients</h3></div></div><div></div></div><p>
136 <a class="indexterm" name="id2932178"></a>
137 <a class="indexterm" name="id2932186"></a>
138 Most traditionally configured UNIX print servers acting on behalf of
139 Samba's Windows clients represented a really simple setup. Their only
140 task was to manage the &#8220;<span class="quote">raw</span>&#8221; spooling of all jobs handed to them by
141 Samba. This approach meant that the Windows clients were expected to
142 prepare the print job file that its ready to be sent to the printing
143 device. Here is a native (vendor-supplied) Windows printer
144 driver for the target device needed to be installed on each and every
145 client.
146 </p><p>
147 It is possible to configure CUPS, Samba and your Windows clients in the
148 same traditional and simple way. When CUPS printers are configured
149 for RAW print-through mode operation, it is the responsibility of the
150 Samba client to fully render the print job (file). The file must be
151 sent in a format that is suitable for direct delivery to the
152 printer. Clients need to run the vendor-provided drivers to do
153 this. In this case, CUPS will not do any print file format conversion
154 work.
155 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2932223"></a>Installation of Windows Client Drivers</h3></div></div><div></div></div><p>
156 The printer drivers on the Windows clients may be installed
157 in two functionally different ways:
158 </p><div class="itemizedlist"><ul type="disc"><li><p>Manually install the drivers locally on each client,
159 one by one; this yields the old <span class="emphasis"><em>LanMan</em></span> style
160 printing and uses a <tt class="filename">\\sambaserver\printershare</tt>
161 type of connection.</p></li><li><p>
162 <a class="indexterm" name="id2932265"></a>
163 Deposit and prepare the drivers (for later download) on
164 the print server (Samba); this enables the clients to use
165 &#8220;<span class="quote">Point'n'Print</span>&#8221; to get drivers semi-automatically installed the
166 first time they access the printer; with this method NT/200x/XP
167 clients use the <span class="emphasis"><em>SPOOLSS/MS-RPC</em></span>
168 type printing calls.</p></li></ul></div><p>
169 The second method is recommended for use over the first.
170 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="cups-raw"></a>Explicitly Enable &#8220;<span class="quote">raw</span>&#8221; Printing for <span class="emphasis"><em>application/octet-stream</em></span></h3></div></div><div></div></div><p>
171 <a class="indexterm" name="id2932317"></a>
172 <a class="indexterm" name="id2932325"></a>
173 <a class="indexterm" name="id2932334"></a>
174 If you use the first option (drivers are installed on the client
175 side), there is one setting to take care of: CUPS needs to be told
176 that it should allow &#8220;<span class="quote">raw</span>&#8221; printing of deliberate (binary) file
177 formats. The CUPS files that need to be correctly set for RAW mode
178 printers to work are:
179 </p><div class="itemizedlist"><ul type="disc"><li><p><tt class="filename">/etc/cups/mime.types</tt></p></li><li><p><tt class="filename">/etc/cups/mime.convs</tt></p></li></ul></div><p>
180 Both contain entries (at the end of the respective files) which must
181 be uncommented to allow RAW mode operation.
182 In <tt class="filename">/etc/cups/mime.types</tt>, make sure this line is
183 present:
185 </p><pre class="programlisting">
186 application/octet-stream
187 </pre><p>
189 <a class="indexterm" name="id2932400"></a>
190 <a class="indexterm" name="id2932408"></a>
192 In <tt class="filename">/etc/cups/mime.convs</tt>,
193 have this line:
195 <a class="indexterm" name="id2932425"></a>
197 </p><pre class="programlisting">
198 application/octet-stream application/vnd.cups-raw 0 -
199 </pre><p>
201 If these two files are not set up correctly for raw Windows client
202 printing, you may encounter the dreaded <tt class="computeroutput">Unable to
203 convert file 0</tt> in your CUPS error_log file.
204 </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
205 <tt class="filename">mime.types</tt> file does not
206 <span class="emphasis"><em>enforce</em></span> &#8220;<span class="quote">raw</span>&#8221; printing, it only
207 <span class="emphasis"><em>allows</em></span> it.
208 </p></div><p><b>Background. </b>
209 <a class="indexterm" name="id2932493"></a>
210 CUPS being a more security-aware printing system than traditional ones
211 does not by default allow a user to send deliberate (possibly binary)
212 data to printing devices. This could be easily abused to launch a
213 &#8220;<span class="quote">Denial of Service</span>&#8221; attack on your printer(s), causing at least
214 the loss of a lot of paper and ink. &#8220;<span class="quote">Unknown</span>&#8221; data are tagged by CUPS
215 as <i class="parameter"><tt>MIME type: application/octet-stream</tt></i> and not
216 allowed to go to the printer. By default, you can only send other
217 (known) MIME types &#8220;<span class="quote">raw</span>&#8221;. Sending data &#8220;<span class="quote">raw</span>&#8221; means that CUPS does not
218 try to convert them and passes them to the printer untouched (see the next
219 chapter for even more background explanations).
220 </p><p>
221 This is all you need to know to get the CUPS/Samba combo printing
222 &#8220;<span class="quote">raw</span>&#8221; files prepared by Windows clients, which have vendor drivers
223 locally installed. If you are not interested in background information about
224 more advanced CUPS/Samba printing, simply skip the remaining sections
225 of this chapter.
226 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2932552"></a>Driver Upload Methods</h3></div></div><div></div></div><p>
227 This section describes three familiar methods, plus one new one, by which
228 printer drivers may be uploaded.
229 </p><p>
230 <a class="indexterm" name="id2932570"></a>
231 If you want to use the MS-RPC type printing, you must upload the
232 drivers onto the Samba server first (<i class="parameter"><tt>[print$]</tt></i>
233 share). For a discussion on how to deposit printer drivers on the
234 Samba host (so the Windows clients can download and use them via
235 &#8220;<span class="quote">Point'n'Print</span>&#8221;), please refer to the previous chapter of this
236 HOWTO Collection. There you will find a description or reference to
237 three methods of preparing the client drivers on the Samba server:
238 </p><div class="itemizedlist"><ul type="disc"><li><p>
239 <a class="indexterm" name="id2932606"></a>
240 The GUI, &#8220;<span class="quote">Add Printer Wizard</span>&#8221;
241 <span class="emphasis"><em>upload-from-a-Windows-client</em></span>
242 method.</p></li><li><p>The command line, &#8220;<span class="quote">smbclient/rpcclient</span>&#8221;
243 upload-from-a-UNIX-workstation method.</p></li><li><p>
244 <a class="indexterm" name="id2932640"></a>
245 The Imprints Toolset
246 method.</p></li></ul></div><p>
247 These three methods apply to CUPS all the same. A new and more
248 convenient way to load the Windows drivers into Samba is provided
249 if you use CUPS:
250 </p><div class="itemizedlist"><ul type="disc"><li><p>
251 <a class="indexterm" name="id2932666"></a>
252 the <i class="parameter"><tt>cupsaddsmb</tt></i>
253 utility.</p></li></ul></div><p>
254 <b class="command">cupsaddsmb</b> is discussed in much detail further below. But we first
255 explore the CUPS filtering system and compare the Windows and UNIX printing architectures.
256 </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2932699"></a>Advanced Intelligent Printing with PostScript Driver Download</h2></div></div><div></div></div><p>
257 <a class="indexterm" name="id2932710"></a>
258 We now know
259 how to set up a &#8220;<span class="quote">dump</span>&#8221; printserver, that is, a server which is spooling
260 printjobs &#8220;<span class="quote">raw</span>&#8221;, leaving the print data untouched.
261 </p><p>
262 Possibly you need to setup CUPS in a smarter way. The reasons could
263 be manifold:
264 </p><div class="itemizedlist"><ul type="disc"><li><p>Maybe your boss wants to get monthly statistics: Which
265 printer did how many pages? What was the average data size of a job?
266 What was the average print run per day? What are the typical hourly
267 peaks in printing? Which department prints how much?</p></li><li><p>Maybe you are asked to setup a print quota system:
268 Users should not be able to print more jobs, once they have surpassed
269 a given limit per period.</p></li><li><p>Maybe your previous network printing setup is a mess
270 and must be re-organized from a clean beginning.</p></li><li><p>Maybe you have experiencing too many &#8220;<span class="quote">blue screens</span>&#8221;
271 originating from poorly debugged printer drivers running in NT &#8220;<span class="quote">kernel mode</span>&#8221;?</p></li></ul></div><p>
272 These goals cannot be achieved by a raw print server. To build a
273 server meeting these requirements, you'll first need to learn about
274 how CUPS works and how you can enable its features.
275 </p><p>
276 What follows is the comparison of some fundamental concepts for
277 Windows and UNIX printing; then follows a description of the
278 CUPS filtering system, how it works and how you can tweak it.
279 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="gdipost"></a>GDI on Windows -- PostScript on UNIX</h3></div></div><div></div></div><p>
280 <a class="indexterm" name="id2932814"></a>
281 <a class="indexterm" name="id2932822"></a>
282 Network printing is one of the most complicated and error-prone
283 day-to-day tasks any user or administrator may encounter. This is
284 true for all OS platforms. And there are reasons for this.
285 </p><p>
286 <a class="indexterm" name="id2932838"></a>
287 <a class="indexterm" name="id2932846"></a>
288 You can't expect most file formats to just throw them toward
289 printers and they get printed. There needs to be a file format
290 conversion in between. The problem is that there is no common standard for
291 print file formats across all manufacturers and printer types. While
292 PostScript (trademark held by Adobe) and, to an
293 extent, PCL (trademark held by HP) have developed
294 into semi-official &#8220;<span class="quote">standards</span>&#8221; by being the most widely used PDLs
295 Page Description Languages (PDLs), there are still
296 many manufacturers who &#8220;<span class="quote">roll their own</span>&#8221; (their reasons may be
297 unacceptable license fees for using printer-embedded PostScript
298 interpreters, and so on).
299 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2932876"></a>Windows Drivers, GDI and EMF</h3></div></div><div></div></div><p>
300 <a class="indexterm" name="id2932888"></a>
301 <a class="indexterm" name="id2932896"></a>
302 <a class="indexterm" name="id2932904"></a>
303 In Windows OS, the format conversion job is done by the printer
304 drivers. On MS Windows OS platforms all application programmers have
305 at their disposal a built-in API, the Graphical Device
306 Interface (GDI), as part and parcel of the OS itself to base
307 themselves on. This GDI core is used as one common unified ground for
308 all Windows programs to draw pictures, fonts and documents
309 <span class="emphasis"><em>on screen</em></span> as well as <span class="emphasis"><em>on
310 paper</em></span> (print). Therefore, printer driver developers can
311 standardize on a well-defined GDI output for their own driver
312 input. Achieving WYSIWYG (&#8220;<span class="quote">What You See Is What You Get</span>&#8221;) is
313 relatively easy, because the on-screen graphic primitives, as well as
314 the on-paper drawn objects, come from one common source. This source,
315 the GDI, often produces a file format called Enhanced
316 MetaFile (EMF). The EMF is processed by the printer driver and
317 converted to the printer-specific file format.
318 </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
319 <a class="indexterm" name="id2932947"></a>
320 To the GDI foundation in MS Windows, Apple has chosen to
321 put paper and screen output on a common foundation for their
322 (BSD-UNIX-based, did you know?) Mac OS X and Darwin Operating
323 <a class="indexterm" name="id2932959"></a>
324 <a class="indexterm" name="id2932967"></a>
325 <a class="indexterm" name="id2932976"></a>
326 <a class="indexterm" name="id2932984"></a>
327 Systems. Their <span class="emphasis"><em>Core Graphic Engine</em></span> uses a
328 <span class="emphasis"><em>PDF</em></span> derivative for all display work.
329 </p></div><p>
331 </p><div class="figure"><a name="1small"></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" width="270" alt="Windows printing to a local printer."></div></div><p>
332 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2933049"></a>UNIX Printfile Conversion and GUI Basics</h3></div></div><div></div></div><p>
333 <a class="indexterm" name="id2933059"></a>
334 <a class="indexterm" name="id2933067"></a>
335 <a class="indexterm" name="id2933075"></a>
336 <a class="indexterm" name="id2933084"></a>
337 In UNIX and Linux, there is no comparable layer built into the OS
338 kernel(s) or the X (screen display) server. Every application is
339 responsible for itself to create its print output. Fortunately, most
340 use PostScript and that at least gives some common ground. Unfortunately,
341 there are many different levels of quality for this PostScript. And
342 worse, there is a huge difference (and no common root) in the way
343 the same document is displayed on screen and how it is presented on
344 paper. WYSIWYG is more difficult to achieve. This goes back to the
345 time, decades ago, when the predecessors of X.org,
346 designing the UNIX foundations and protocols for Graphical User
347 Interfaces, refused to take responsibility for &#8220;<span class="quote">paper output</span>&#8221;
348 also, as some had demanded at the time, and restricted itself to
349 &#8220;<span class="quote">on-screen only.</span>&#8221; (For some years now, the &#8220;<span class="quote">Xprint</span>&#8221; project has been
350 under development, attempting to build printing support into the X
351 framework, including a PostScript and a PCL driver, but it is not yet
352 ready for prime time.) You can see this unfavorable inheritance up to
353 the present day by looking into the various &#8220;<span class="quote">font</span>&#8221; directories on your
354 system; there are separate ones for fonts used for X display and fonts
355 to be used on paper.
356 </p><p><b>Background. </b>
357 <a class="indexterm" name="id2933141"></a>
358 The PostScript programming language is an &#8220;<span class="quote">invention</span>&#8221; by Adobe Inc.,
359 but its specifications have been published to the full. Its strength
360 lies in its powerful abilities to describe graphical objects (fonts,
361 shapes, patterns, lines, curves, and dots), their attributes (color,
362 linewidth) and the way to manipulate (scale, distort, rotate,
363 shift) them. Because of its open specification, anybody with the
364 skill can start writing his own implementation of a PostScript
365 interpreter and use it to display PostScript files on screen or on
366 paper. Most graphical output devices are based on the concept of
367 &#8220;<span class="quote">raster images</span>&#8221; or &#8220;<span class="quote">pixels</span>&#8221; (one notable exception is pen
368 plotters). Of course, you can look at a PostScript file in its textual
369 form and you will be reading its PostScript code, the language
370 instructions which need to be interpreted by a rasterizer. Rasterizers
371 produce pixel images, which may be displayed on screen by a viewer
372 program or on paper by a printer.
373 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="post-and-ghost"></a>PostScript and Ghostscript</h3></div></div><div></div></div><p>
374 <a class="indexterm" name="id2933199"></a>
375 <a class="indexterm" name="id2933207"></a>
376 <a class="indexterm" name="id2933218"></a>
377 So, UNIX is lacking a common ground for printing on paper and
378 displaying on screen. Despite this unfavorable legacy for UNIX, basic
379 printing is fairly easy if you have PostScript printers at your
380 disposal. The reason is these devices have a built-in PostScript
381 language &#8220;<span class="quote">interpreter,</span>&#8221; also called a Raster Image
382 Processor (RIP) (which makes them more expensive than
383 other types of printers); throw PostScript toward them, and they will
384 spit out your printed pages. Their RIP is doing all the hard work of
385 converting the PostScript drawing commands into a bitmap picture as
386 you see it on paper, in a resolution as done by your printer. This is
387 no different to PostScript printing a file from a Windows origin.
388 </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
389 <a class="indexterm" name="id2933261"></a>
390 Traditional UNIX programs and printing systems while
391 using PostScript are largely not PPD-aware. PPDs are &#8220;<span class="quote">PostScript
392 Printer Description</span>&#8221; files. They enable you to specify and control all
393 options a printer supports: duplexing, stapling and punching. Therefore,
394 UNIX users for a long time couldn't choose many of the supported
395 device and job options, unlike Windows or Apple users. But now there
396 is CUPS.
397 </p></div><p>
398 </p><div class="figure"><a name="2small"></a><p class="title"><b>Figure 19.2. Printing to a PostScript printer.</b></p><div class="mediaobject"><img src="projdoc/imagefiles/2small.png" width="270" alt="Printing to a PostScript printer."></div></div><p>
399 </p><p>
400 <a class="indexterm" name="id2933337"></a>
401 However, there are other types of printers out there. These do not know
402 how to print PostScript. They use their own Page Description
403 Language (PDL, often proprietary). To print to them is much
404 more demanding. Since your UNIX applications mostly produce
405 PostScript, and since these devices do not understand PostScript, you
406 need to convert the printfiles to a format suitable for your printer
407 on the host before you can send it away.
408 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2933354"></a>Ghostscript the Software RIP for Non-PostScript Printers</h3></div></div><div></div></div><p>
409 <a class="indexterm" name="id2933369"></a>
410 Here is where Ghostscript kicks in. Ghostscript is
411 the traditional (and quite powerful) PostScript interpreter used on
412 UNIX platforms. It is a RIP in software, capable of doing a
413 <span class="emphasis"><em>lot</em></span> of file format conversions for a very broad
414 spectrum of hardware devices as well as software file formats.
415 Ghostscript technology and drivers are what enable PostScript printing
416 to non-PostScript hardware.
417 </p><p>
418 </p><div class="figure"><a name="3small"></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" width="270" alt="Ghostscript as a RIP for non-postscript printers."></div></div><p>
419 </p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>
420 Use the &#8220;<span class="quote">gs -h</span>&#8221; command to check for all built-in &#8220;<span class="quote">devices</span>&#8221;
421 of your Ghostscript version. If you specify a parameter of
422 <i class="parameter"><tt>-sDEVICE=png256</tt></i> on your Ghostscript command
423 line, you are asking Ghostscript to convert the input into a PNG
424 file. Naming a &#8220;<span class="quote">device</span>&#8221; on the command line is the most important
425 single parameter to tell Ghostscript exactly how it should render the
426 input. New Ghostscript versions are released at fairly regular
427 intervals, now by artofcode LLC. They are initially put under the
428 &#8220;<span class="quote">AFPL</span>&#8221; license, but re-released under the GNU GPL as soon as the next
429 AFPL version appears. GNU Ghostscript is probably the version
430 installed on most Samba systems. But it has some deficiencies.
431 <a class="indexterm" name="id2933472"></a>
432 Therefore, ESP Ghostscript was developed as an
433 enhancement over GNU Ghostscript, with lots of bug-fixes, additional
434 devices and improvements. It is jointly maintained by developers from
435 CUPS, Gimp-Print, MandrakeSoft, SuSE, RedHat, and Debian. It includes
436 the &#8220;<span class="quote">cups</span>&#8221; device (essential to print to non-PS printers from CUPS).
437 </p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2933497"></a>PostScript Printer Description (PPD) Specification</h3></div></div><div></div></div><p>
438 <a class="indexterm" name="id2933509"></a>
439 While PostScript in essence is a Page Description
440 Language (PDL) to represent the page layout in a
441 device-independent way, real-world print jobs are
442 always ending up being output on hardware with device-specific
443 features. To take care of all the differences in hardware and to
444 allow for innovations, Adobe has specified a syntax and file format
445 for PostScript Printer Description (PPD)
446 files. Every PostScript printer ships with one of these files.
447 </p><p>
448 PPDs contain all the information about general and special features of the
449 given printer model: Which different resolutions can it handle? Does
450 it have a Duplexing Unit? How many paper trays are there? What media
451 types and sizes does it take? For each item, it also names the special
452 command string to be sent to the printer (mostly inside the PostScript
453 file) in order to enable it.
454 </p><p>
455 Information from these PPDs is meant to be taken into account by the
456 printer drivers. Therefore, installed as part of the Windows
457 PostScript driver for a given printer is the printer's PPD. Where it
458 makes sense, the PPD features are presented in the drivers' UI dialogs
459 to display to the user a choice of print options. In the end, the
460 user selections are somehow written (in the form of special
461 PostScript, PJL, JCL or vendor-dependent commands) into the PostScript
462 file created by the driver.
463 </p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>
464 <a class="indexterm" name="id2933556"></a>
465 A PostScript file that was created to contain device-specific commands
466 for achieving a certain print job output (e.g., duplexed, stapled and
467 punched) on a specific target machine, may not print as expected, or
468 may not be printable at all on other models; it also may not be fit
469 for further processing by software (e.g., by a PDF distilling program).
470 </p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2933573"></a>Using Windows-Formatted Vendor PPDs</h3></div></div><div></div></div><p>
471 CUPS can handle all spec-compliant PPDs as supplied by the
472 manufacturers for their PostScript models. Even if a
473 vendor might not have mentioned our favorite
474 OS in his manuals and brochures, you can safely trust this:
475 <span class="emphasis"><em>If you get the Windows NT version of the PPD, you
476 can use it unchanged in CUPS</em></span> and thus access the full
477 power of your printer just like a Windows NT user could!
478 </p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>
479 To check the spec compliance of any PPD online, go to <ulink url="http://www.cups.org/testppd.php">http://www.cups.org/testppd.php</ulink>
480 and upload your PPD. You will see the results displayed
481 immediately. CUPS in all versions after 1.1.19 has a much more strict
482 internal PPD parsing and checking code enabled; in case of printing
483 trouble, this online resource should be one of your first pitstops.
484 </p></div><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>
485 <a class="indexterm" name="id2933620"></a>
486 <a class="indexterm" name="id2933629"></a>
487 For real PostScript printers, <span class="emphasis"><em>do not</em></span> use the
488 <span class="emphasis"><em>Foomatic</em></span> or <span class="emphasis"><em>cupsomatic</em></span>
489 PPDs from Linuxprinting.org. With these devices, the original
490 vendor-provided PPDs are always the first choice!
491 </p></div><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>
492 If you are looking for an original vendor-provided PPD of a specific
493 device, and you know that an NT4 box (or any other Windows box) on
494 your LAN has the PostScript driver installed, just use
495 <b class="command">smbclient //NT4-box/print\$ -U username</b> to
496 access the Windows directory where all printer driver files are
497 stored. First look in the <tt class="filename">W32X86/2</tt> subdir for
498 the PPD you are seeking.
499 </p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2933679"></a>CUPS Also Uses PPDs for Non-PostScript Printers</h3></div></div><div></div></div><p>
500 CUPS also uses specially crafted PPDs to handle non-PostScript
501 printers. These PPDs are usually not available from the vendors (and
502 no, you can't just take the PPD of a PostScript printer with the same
503 model name and hope it works for the non-PostScript version too). To
504 understand how these PPDs work for non-PS printers, we first need to
505 dive deeply into the CUPS filtering and file format conversion
506 architecture. Stay tuned.
507 </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2933709"></a>The CUPS Filtering Architecture</h2></div></div><div></div></div><p>
508 The core of the CUPS filtering system is based on
509 Ghostscript. In addition to Ghostscript, CUPS
510 uses some other filters of its own. You (or your OS vendor) may have
511 plugged in even more filters. CUPS handles all data file formats under
512 the label of various MIME types. Every incoming
513 printfile is subjected to an initial
514 auto-typing. The auto-typing determines its given
515 MIME type. A given MIME type implies zero or more possible filtering
516 chains relevant to the selected target printer. This section discusses
517 how MIME types recognition and conversion rules interact. They are
518 used by CUPS to automatically setup a working filtering chain for any
519 given input data format.
520 </p><p>
521 If CUPS rasterizes a PostScript file natively to
522 a bitmap, this is done in two stages:
523 </p><div class="itemizedlist"><ul type="disc"><li><p>The first stage uses a Ghostscript device named &#8220;<span class="quote">cups</span>&#8221;
524 (this is since version 1.1.15) and produces a generic raster format
525 called &#8220;<span class="quote">CUPS raster</span>&#8221;.
526 </p></li><li><p>The second stage uses a &#8220;<span class="quote">raster driver</span>&#8221; that converts
527 the generic CUPS raster to a device-specific raster.</p></li></ul></div><p>
528 Make sure your Ghostscript version has the &#8220;<span class="quote">cups</span>&#8221; device compiled in
529 (check with <b class="command">gs -h | grep cups</b>). Otherwise you
530 may encounter the dreaded <tt class="computeroutput">Unable to convert file
531 0</tt> in your CUPS error_log file. To have &#8220;<span class="quote">cups</span>&#8221; as a
532 device in your Ghostscript, you either need to patch GNU
533 Ghostscript and re-compile, or use <a class="indexterm" name="id2933802"></a><ulink url="http://www.cups.org/ghostscript.php">ESP Ghostscript</ulink>. The
534 superior alternative is ESP Ghostscript. It supports not just CUPS,
535 but 300 other devices too (while GNU Ghostscript supports only about
536 180). Because of this broad output device support, ESP Ghostscript is
537 the first choice for non-CUPS spoolers, too. It is now recommended by
538 Linuxprinting.org for all spoolers.
539 </p><p>
540 <a class="indexterm" name="id2933830"></a>
541 <a class="indexterm" name="id2933839"></a>
542 CUPS printers may be setup to use external
543 rendering paths. One of the most common is provided by the
544 Foomatic/cupsomatic concept from <ulink url="http://www.linuxprinting.org/">Linuxprinting.org.</ulink> This
545 uses the classical Ghostscript approach, doing everything in one
546 step. It does not use the &#8220;<span class="quote">cups</span>&#8221; device, but one of the many
547 others. However, even for Foomatic/cupsomatic usage, best results and
548 <a class="indexterm" name="id2933864"></a>
549 broadest printer model support is provided by ESP Ghostscript (more
550 about cupsomatic/Foomatic, particularly the new version called now
551 <span class="emphasis"><em>foomatic-rip</em></span>, follows below).
552 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2933883"></a>MIME Types and CUPS Filters</h3></div></div><div></div></div><p>
553 <a class="indexterm" name="id2933894"></a>
554 <a class="indexterm" name="id2933905"></a>
555 CUPS reads the file <tt class="filename">/etc/cups/mime.types</tt>
556 (and all other files carrying a <tt class="filename">*.types</tt> suffix
557 in the same directory) upon startup. These files contain the MIME
558 type recognition rules that are applied when CUPS runs its
559 auto-typing routines. The rule syntax is explained in the man page
560 for <tt class="filename">mime.types</tt> and in the comments section of the
561 <tt class="filename">mime.types</tt> file itself. A simple rule reads
562 like this:
564 <a class="indexterm" name="id2933946"></a>
565 </p><pre class="programlisting">
566 application/pdf pdf string(0,%PDF)
567 </pre><p>
569 This means if a filename has either a
570 <tt class="filename">.pdf</tt> suffix or if the magic
571 string <span class="emphasis"><em>%PDF</em></span> is right at the
572 beginning of the file itself (offset 0 from the start), then it is
573 a PDF file (<i class="parameter"><tt>application/pdf</tt></i>).
574 Another rule is this:
576 </p><pre class="programlisting">
577 application/postscript ai eps ps string(0,%!) string(0,&lt;04&gt;%!)
578 </pre><p>
580 If the filename has one of the suffixes
581 <tt class="filename">.ai</tt>, <tt class="filename">.eps</tt>,
582 <tt class="filename">.ps</tt> or if the file itself starts with one of the
583 strings <span class="emphasis"><em>%!</em></span> or <span class="emphasis"><em>&lt;04&gt;%!</em></span>, it
584 is a generic PostScript file
585 (<i class="parameter"><tt>application/postscript</tt></i>).
586 </p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>
587 Don't confuse the other mime.types files your system might be using
588 with the one in the <tt class="filename">/etc/cups/</tt> directory.
589 </p></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
590 There is an important difference between two similar MIME types in
591 CUPS: one is <i class="parameter"><tt>application/postscript</tt></i>, the other is
592 <i class="parameter"><tt>application/vnd.cups-postscript</tt></i>. While
593 <i class="parameter"><tt>application/postscript</tt></i> is meant to be device
594 independent (job options for the file are still outside the PS file
595 content, embedded in command line or environment variables by CUPS),
596 <i class="parameter"><tt>application/vnd.cups-postscript</tt></i> may have the job
597 options inserted into the PostScript data itself (where
598 applicable). The transformation of the generic PostScript
599 (<i class="parameter"><tt>application/postscript</tt></i>) to the device-specific version
600 (<i class="parameter"><tt>application/vnd.cups-postscript</tt></i>) is the responsibility of the
601 CUPS <i class="parameter"><tt>pstops</tt></i> filter. pstops uses information
602 contained in the PPD to do the transformation.
603 </p></div><p>
604 CUPS can handle ASCII text, HP-GL, PDF, PostScript, DVI, and
605 many image formats (GIF. PNG, TIFF, JPEG, Photo-CD, SUN-Raster,
606 PNM, PBM, SGI-RGB, and more) and their associated MIME types
607 with its filters.
608 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2934118"></a>MIME Type Conversion Rules</h3></div></div><div></div></div><p>
609 <a class="indexterm" name="id2934130"></a>
610 <a class="indexterm" name="id2934138"></a>
611 CUPS reads the file <tt class="filename">/etc/cups/mime.convs</tt>
612 (and all other files named with a <tt class="filename">*.convs</tt>
613 suffix in the same directory) upon startup. These files contain
614 lines naming an input MIME type, an output MIME type, a format
615 conversion filter that can produce the output from the input type
616 and virtual costs associated with this conversion. One example line
617 reads like this:
619 </p><pre class="programlisting">
620 application/pdf application/postscript 33 pdftops
621 </pre><p>
623 This means that the <i class="parameter"><tt>pdftops</tt></i> filter will take
624 <i class="parameter"><tt>application/pdf</tt></i> as input and produce
625 <i class="parameter"><tt>application/postscript</tt></i> as output; the virtual
626 cost of this operation is 33 CUPS-$. The next filter is more
627 expensive, costing 66 CUPS-$:
629 <a class="indexterm" name="id2934198"></a>
631 </p><pre class="programlisting">
632 application/vnd.hp-HPGL application/postscript 66 hpgltops
633 </pre><p>
635 This is the <i class="parameter"><tt>hpgltops</tt></i>, which processes HP-GL
636 plotter files to PostScript.
638 <a class="indexterm" name="id2934222"></a>
640 </p><pre class="programlisting">
641 application/octet-stream
642 </pre><p>
644 Here are two more examples:
646 <a class="indexterm" name="id2934239"></a>
648 </p><pre class="programlisting">
649 application/x-shell application/postscript 33 texttops
650 text/plain application/postscript 33 texttops
651 </pre><p>
653 The last two examples name the <i class="parameter"><tt>texttops</tt></i> filter
654 to work on <i class="parameter"><tt>text/plain</tt></i> as well as on <i class="parameter"><tt>application/x-shell</tt></i>. (Hint:
655 This differentiation is needed for the syntax highlighting feature of
656 <i class="parameter"><tt>texttops</tt></i>).
657 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2934287"></a>Filtering Overview</h3></div></div><div></div></div><p>
658 <a class="indexterm" name="id2934298"></a>
659 There are many more combinations named in <tt class="filename">mime.convs</tt>. However, you
660 are not limited to use the ones pre-defined there. You can plug in any
661 filter you like into the CUPS framework. It must meet, or must be made
662 to meet, some minimal requirements. If you find (or write) a cool
663 conversion filter of some kind, make sure it complies to what CUPS
664 needs and put in the right lines in <tt class="filename">mime.types</tt>
665 and <tt class="filename">mime.convs</tt>, then it will work seamlessly
666 inside CUPS.
667 </p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2934336"></a>Filter requirements</h4></div></div><div></div></div><p>
668 The mentioned &#8220;<span class="quote">CUPS requirements</span>&#8221; for filters are simple. Take
669 filenames or <tt class="filename">stdin</tt> as input and write to
670 <tt class="filename">stdout</tt>. They should take these 5 or 6 arguments:
671 <span class="emphasis"><em>printer job user title copies options [filename]</em></span>
672 </p><div class="variablelist"><dl><dt><span class="term">Printer </span></dt><dd><p>The name of the printer queue (normally this is the
673 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
674 printed.</p></dd><dt><span class="term">user </span></dt><dd><p>The string from the originating-user-name
675 attribute.</p></dd><dt><span class="term">title </span></dt><dd><p>The string from the job-name attribute.</p></dd><dt><span class="term">copies </span></dt><dd><p>The numeric value from the number-copies
676 attribute.</p></dd><dt><span class="term">options </span></dt><dd><p>The job options.</p></dd><dt><span class="term">filename </span></dt><dd><p>(Optionally) The print request file (if missing,
677 filters expected data fed through <tt class="filename">stdin</tt>). In most
678 cases, it is easy to write a simple wrapper script around existing
679 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="id2934481"></a>Prefilters</h3></div></div><div></div></div><p>
680 <a class="indexterm" name="id2934492"></a>
681 As previously stated, PostScript is the central file format to any UNIX-based
682 printing system. From PostScript, CUPS generates raster data to feed
683 non-PostScript printers.
684 </p><p>
685 But what happens if you send one of the supported non-PS formats
686 to print? Then CUPS runs &#8220;<span class="quote">pre-filters</span>&#8221; on these input formats to
687 generate PostScript first. There are pre-filters to create PS from
688 ASCII text, PDF, DVI, or HP-GL. The outcome of these filters is always
689 of MIME type <i class="parameter"><tt>application/postscript</tt></i> (meaning that
690 any device-specific print options are not yet embedded into the
691 PostScript by CUPS, and that the next filter to be called is
692 pstops). Another pre-filter is running on all supported image formats,
693 the <i class="parameter"><tt>imagetops</tt></i> filter. Its outcome is always of
694 MIME type <i class="parameter"><tt>application/vnd.cups-postscript</tt></i>
695 (not application/postscript), meaning it has the
696 print options already embedded into the file.
697 </p><p>
698 </p><div class="figure"><a name="4small"></a><p class="title"><b>Figure 19.4. Pre-filtering in CUPS to form PostScript.</b></p><div class="mediaobject"><img src="projdoc/imagefiles/4small.png" width="270" alt="Pre-filtering in CUPS to form PostScript."></div></div><p>
699 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2934591"></a>pstops</h3></div></div><div></div></div><p>
700 <span class="emphasis"><em>pstops</em></span> is the filter to convert
701 <i class="parameter"><tt>application/postscript</tt></i> to
702 <i class="parameter"><tt>application/vnd.cups-postscript</tt></i>. It was said
703 above that this filter inserts all device-specific print options
704 (commands to the printer to ask for the duplexing of output, or
705 stapling and punching it, and so on) into the PostScript file.
706 </p><p>
707 </p><div class="figure"><a name="5small"></a><p class="title"><b>Figure 19.5. Adding device-specific print options.</b></p><div class="mediaobject"><img src="projdoc/imagefiles/5small.png" width="270" alt="Adding device-specific print options."></div></div><p>
708 </p><p>
709 This is not all. Other tasks performed by it are:
710 </p><div class="itemizedlist"><ul type="disc"><li><p>
711 Selecting the range of pages to be printed (if you choose to
712 print only pages &#8220;<span class="quote">3, 6, 8-11, 16, 19-21</span>&#8221;, or only the odd numbered
713 ones).
714 </p></li><li><p>
715 Putting 2 or more logical pages on one sheet of paper (the
716 so-called &#8220;<span class="quote">number-up</span>&#8221; function).
717 </p></li><li><p>Counting the pages of the job to insert the accounting
718 information into the <tt class="filename">/var/log/cups/page_log</tt>.
719 </p></li></ul></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2934715"></a>pstoraster</h3></div></div><div></div></div><p>
720 <i class="parameter"><tt>pstoraster</tt></i> is at the core of the CUPS filtering
721 system. It is responsible for the first stage of the rasterization
722 process. Its input is of MIME type application/vnd.cups-postscript;
723 its output is application/vnd.cups-raster. This output format is not
724 yet meant to be printable. Its aim is to serve as a general purpose
725 input format for more specialized <span class="emphasis"><em>raster drivers</em></span>
726 that are able to generate device-specific printer data.
727 </p><p>
728 </p><div class="figure"><a name="6small"></a><p class="title"><b>Figure 19.6. PostScript to intermediate raster format.</b></p><div class="mediaobject"><img src="projdoc/imagefiles/6small.png" width="270" alt="PostScript to intermediate raster format."></div></div><p>
729 </p><p>
730 CUPS raster is a generic raster format with powerful features. It is
731 able to include per-page information, color profiles, and more, to be
732 used by the following downstream raster drivers. Its MIME type is
733 registered with IANA and its specification is, of course, completely
734 open. It is designed to make it quite easy and inexpensive for
735 manufacturers to develop Linux and UNIX raster drivers for their
736 printer models, should they choose to do so. CUPS always takes care
737 for the first stage of rasterization so these vendors do not need to care
738 about Ghostscript complications (in fact, there is currently more
739 than one vendor financing the development of CUPS raster drivers).
740 </p><p>
741 </p><div class="figure"><a name="7small"></a><p class="title"><b>Figure 19.7. CUPS-raster production using Ghostscript.</b></p><div class="mediaobject"><img src="projdoc/imagefiles/7small.png" width="270" alt="CUPS-raster production using Ghostscript."></div></div><p>
742 </p><p>
743 CUPS versions before version 1.1.15 were shipping a binary (or source
744 code) standalone filter, named <i class="parameter"><tt>pstoraster</tt></i>. <i class="parameter"><tt>pstoraster</tt></i> was derived
745 from GNU Ghostscript 5.50, and could be installed besides and in
746 addition to any GNU or AFPL Ghostscript package without conflicting.
747 </p><p>
748 &gt;From version 1.1.15, this has changed. The functions for this have been
749 integrated back into Ghostscript (now based on GNU Ghostscript version
750 7.05). The <i class="parameter"><tt>pstoraster</tt></i> filter is now a simple shell script calling
751 <b class="command">gs</b> with the <b class="command">-sDEVICE=cups</b>
752 parameter. If your Ghostscript does not show a success on asking for
753 <b class="command">gs -h |grep cups</b>, you might not be able to
754 print. Update your Ghostscript.
755 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2934912"></a>imagetops and imagetoraster</h3></div></div><div></div></div><p>
756 In the section about pre-filters, we mentioned the pre-filter
757 that generates PostScript from image formats. The <i class="parameter"><tt>imagetoraster</tt></i>
758 filter is used to convert directly from image to raster, without the
759 intermediate PostScript stage. It is used more often than the above
760 mentioned pre-filters. A summarizing flowchart of image file
761 filtering is shown in <link linkend="small8">.
762 </p><p>
763 </p><div class="figure"><a name="small8"></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" width="270" alt="Image format to CUPS-raster format conversion."></div></div><p>
764 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2934991"></a>rasterto [printers specific]</h3></div></div><div></div></div><p>
765 CUPS ships with quite different raster drivers processing CUPS
766 raster. On my system I find in /usr/lib/cups/filter/ these:
767 <i class="parameter"><tt>rastertoalps</tt></i>, <i class="parameter"><tt>rastertobj</tt></i>, <i class="parameter"><tt>rastertoepson</tt></i>, <i class="parameter"><tt>rastertoescp</tt></i>,
768 <i class="parameter"><tt>rastertopcl</tt></i>, <i class="parameter"><tt>rastertoturboprint</tt></i>, <i class="parameter"><tt>rastertoapdk</tt></i>, <i class="parameter"><tt>rastertodymo</tt></i>,
769 <i class="parameter"><tt>rastertoescp</tt></i>, <i class="parameter"><tt>rastertohp</tt></i>, and
770 <i class="parameter"><tt>rastertoprinter</tt></i>. Don't worry if you have less
771 than this; some of these are installed by commercial add-ons to CUPS
772 (like <i class="parameter"><tt>rastertoturboprint</tt></i>), others (like
773 <i class="parameter"><tt>rastertoprinter</tt></i>) by third-party driver
774 development projects (such as Gimp-Print) wanting to cooperate as
775 closely as possible with CUPS.
776 </p><p>
777 </p><div class="figure"><a name="small9"></a><p class="title"><b>Figure 19.9. Raster to printer-specific formats.</b></p><div class="mediaobject"><img src="projdoc/imagefiles/9small.png" width="270" alt="Raster to printer-specific formats."></div></div><p>
778 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2935143"></a>CUPS Backends</h3></div></div><div></div></div><p>
779 The last part of any CUPS filtering chain is a backend. Backends
780 are special programs that send the print-ready file to the final
781 device. There is a separate backend program for any transfer
782 protocol of sending printjobs over the network, or for every local
783 interface. Every CUPS print queue needs to have a CUPS &#8220;<span class="quote">device-URI</span>&#8221;
784 associated with it. The device URI is the way to encode the backend
785 used to send the job to its destination. Network device-URIs are using
786 two slashes in their syntax, local device URIs only one, as you can
787 see from the following list. Keep in mind that local interface names
788 may vary much from my examples, if your OS is not Linux:
789 </p><div class="variablelist"><dl><dt><span class="term">usb </span></dt><dd><p>
790 This backend sends printfiles to USB-connected printers. An
791 example for the CUPS device-URI to use is:
792 <tt class="filename">usb:/dev/usb/lp0</tt>.
793 </p></dd><dt><span class="term">serial </span></dt><dd><p>
794 This backend sends printfiles to serially connected printers.
795 An example for the CUPS device-URI to use is:
796 <tt class="filename">serial:/dev/ttyS0?baud=11500</tt>.
797 </p></dd><dt><span class="term">parallel </span></dt><dd><p>
798 This backend sends printfiles to printers connected to the
799 parallel port. An example for the CUPS device-URI to use is:
800 <tt class="filename">parallel:/dev/lp0</tt>.
801 </p></dd><dt><span class="term">scsi </span></dt><dd><p>
802 This backend sends printfiles to printers attached to the
803 SCSI interface. An example for the CUPS device-URI to use is:
804 <tt class="filename">scsi:/dev/sr1</tt>.
805 </p></dd><dt><span class="term">lpd </span></dt><dd><p>
806 This backend sends printfiles to LPR/LPD connected network
807 printers. An example for the CUPS device-URI to use is:
808 <tt class="filename">lpd://remote_host_name/remote_queue_name</tt>.
809 </p></dd><dt><span class="term">AppSocket/HP JetDirect </span></dt><dd><p>
810 This backend sends printfiles to AppSocket (a.k.a. "HP
811 JetDirect") connected network printers. An example for the CUPS
812 device-URI to use is:
813 <tt class="filename">socket://10.11.12.13:9100</tt>.
814 </p></dd><dt><span class="term">ipp </span></dt><dd><p>
815 This backend sends printfiles to IPP connected network
816 printers (or to other CUPS servers). Examples for CUPS device-URIs
817 to use are:
818 <tt class="filename">ipp:://192.193.194.195/ipp</tt>
819 (for many HP printers) or
820 <tt class="filename">ipp://remote_cups_server/printers/remote_printer_name</tt>.
821 </p></dd><dt><span class="term">http </span></dt><dd><p>
822 This backend sends printfiles to HTTP connected printers.
823 (The http:// CUPS backend is only a symlink to the ipp:// backend.)
824 Examples for the CUPS device-URIs to use are:
825 <tt class="filename">http:://192.193.194.195:631/ipp</tt>
826 (for many HP printers) or
827 <tt class="filename">http://remote_cups_server:631/printers/remote_printer_name</tt>.
828 </p></dd><dt><span class="term">smb </span></dt><dd><p>
829 This backend sends printfiles to printers shared by a Windows
830 host. An example for CUPS device-URIs that may be used includes:
831 </p><p>
832 </p><table class="simplelist" border="0" summary="Simple list"><tr><td><tt class="filename">smb://workgroup/server/printersharename</tt></td></tr><tr><td><tt class="filename">smb://server/printersharename</tt></td></tr><tr><td><tt class="filename">smb://username:password@workgroup/server/printersharename</tt></td></tr><tr><td><tt class="filename">smb://username:password@server/printersharename</tt></td></tr></table><p>
833 </p><p>
834 The smb:// backend is a symlink to the Samba utility
835 <i class="parameter"><tt>smbspool</tt></i> (does not ship with CUPS). If the
836 symlink is not present in your CUPS backend directory, have your
837 root user create it: <b class="command">ln -s `which smbspool'
838 /usr/lib/cups/backend/smb</b>.
839 </p></dd></dl></div><p>
840 It is easy to write your own backends as shell or Perl scripts, if you
841 need any modification or extension to the CUPS print system. One
842 reason could be that you want to create &#8220;<span class="quote">special</span>&#8221; printers that send
843 the printjobs as email (through a &#8220;<span class="quote">mailto:/</span>&#8221; backend), convert them to
844 PDF (through a &#8220;<span class="quote">pdfgen:/</span>&#8221; backend) or dump them to &#8220;<span class="quote">/dev/null</span>&#8221;. (In
845 fact I have the system-wide default printer set up to be connected to
846 a devnull:/ backend: there are just too many people sending jobs
847 without specifying a printer, or scripts and programs which do not name
848 a printer. The system-wide default deletes the job and sends a polite
849 email back to the $USER asking him to always specify the correct
850 printer name.)
851 </p><p>
852 Not all of the mentioned backends may be present on your system or
853 usable (depending on your hardware configuration). One test for all
854 available CUPS backends is provided by the <span class="emphasis"><em>lpinfo</em></span>
855 utility. Used with the <tt class="option">-v</tt> parameter, it lists
856 all available backends:
857 </p><pre class="screen">
858 <tt class="prompt">$ </tt><b class="userinput"><tt>lpinfo -v</tt></b>
859 </pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2935508"></a>The Role of <i class="parameter"><tt>cupsomatic/foomatic</tt></i></h3></div></div><div></div></div><p>
860 <a class="indexterm" name="id2935523"></a>
861 <a class="indexterm" name="id2935532"></a>
862 <i class="parameter"><tt>cupsomatic</tt></i> filters may be the most widely used on CUPS
863 installations. You must be clear about the fact that these were not
864 developed by the CUPS people. They are a third party add-on to
865 CUPS. They utilize the traditional Ghostscript devices to render jobs
866 for CUPS. When troubleshooting, you should know about the
867 difference. Here the whole rendering process is done in one stage,
868 inside Ghostscript, using an appropriate device for the target
869 printer. <i class="parameter"><tt>cupsomatic</tt></i> uses PPDs that are generated from the Foomatic
870 Printer &amp; Driver Database at Linuxprinting.org.
871 </p><p>
872 You can recognize these PPDs from the line calling the
873 <i class="parameter"><tt>cupsomatic</tt></i> filter:
875 </p><pre class="programlisting">
876 *cupsFilter: "application/vnd.cups-postscript 0 cupsomatic"
877 </pre><p>
879 You may find this line among the first 40 or so lines of the PPD
880 file. If you have such a PPD installed, the printer shows up in the
881 CUPS Web interface with a <i class="parameter"><tt>foomatic</tt></i> namepart for
882 the driver description. <i class="parameter"><tt>cupsomatic</tt></i> is a Perl script that runs
883 Ghostscript with all the complicated command line options
884 auto-constructed from the selected PPD and command line options give to
885 the printjob.
886 </p><p>
887 <a class="indexterm" name="id2935609"></a>
888 However, <i class="parameter"><tt>cupsomatic</tt></i> is now deprecated. Its PPDs (especially the first
889 generation of them, still in heavy use out there) are not meeting the
890 Adobe specifications. You might also suffer difficulties when you try
891 to download them with &#8220;<span class="quote">Point'n'Print</span>&#8221; to Windows clients. A better
892 and more powerful successor is now in a stable beta-version: it is called <i class="parameter"><tt>foomatic-rip</tt></i>. To use
893 <i class="parameter"><tt>foomatic-rip</tt></i> as a filter with CUPS, you need the new-type PPDs. These
894 have a similar but different line:
896 </p><pre class="programlisting">
897 *cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
898 </pre><p>
900 The PPD generating engine at Linuxprinting.org has been revamped.
901 The new PPDs comply to the Adobe spec. On top, they also provide a
902 new way to specify different quality levels (hi-res photo, normal
903 color, grayscale, and draft) with a single click, whereas before you
904 could have required five or more different selections (media type,
905 resolution, inktype and dithering algorithm). There is support for
906 custom-size media built in. There is support to switch
907 print-options from page to page in the middle of a job. And the
908 best thing is the new foomatic-rip now works seamlessly with all
909 legacy spoolers too (like LPRng, BSD-LPD, PDQ, PPR and so on), providing
910 for them access to use PPDs for their printing.
911 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2935673"></a>The Complete Picture</h3></div></div><div></div></div><p>
912 If you want to see an overview of all the filters and how they
913 relate to each other, the complete picture of the puzzle is at the end
914 of this document.
915 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2935688"></a><tt class="filename">mime.convs</tt></h3></div></div><div></div></div><p>
916 CUPS auto-constructs all possible filtering chain paths for any given
917 MIME type, and every printer installed. But how does it decide in
918 favor or against a specific alternative? (There may often be cases
919 where there is a choice of two or more possible filtering chains for
920 the same target printer.) Simple. You may have noticed the figures in
921 the third column of the mime.convs file. They represent virtual costs
922 assigned to this filter. Every possible filtering chain will sum up to
923 a total &#8220;<span class="quote">filter cost.</span>&#8221; CUPS decides for the most &#8220;<span class="quote">inexpensive</span>&#8221; route.
924 </p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>
925 The setting of <i class="parameter"><tt>FilterLimit 1000</tt></i> in
926 <tt class="filename">cupsd.conf</tt> will not allow more filters to
927 run concurrently than will consume a total of 1000 virtual filter
928 cost. This is an efficient way to limit the load of any CUPS
929 server by setting an appropriate &#8220;<span class="quote">FilterLimit</span>&#8221; value. A FilterLimit of
930 200 allows roughly one job at a time, while a FilterLimit of 1000 allows
931 approximately five jobs maximum at a time.
932 </p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2935752"></a>&#8220;<span class="quote">Raw</span>&#8221; Printing</h3></div></div><div></div></div><p>
933 You can tell CUPS to print (nearly) any file &#8220;<span class="quote">raw</span>&#8221;. &#8220;<span class="quote">Raw</span>&#8221; means it
934 will not be filtered. CUPS will send the file to the printer &#8220;<span class="quote">as is</span>&#8221;
935 without bothering if the printer is able to digest it. Users need to
936 take care themselves that they send sensible data formats only. Raw
937 printing can happen on any queue if the &#8220;<span class="quote"><i class="parameter"><tt>-o raw</tt></i></span>&#8221; option is specified
938 on the command line. You can also set up raw-only queues by simply not
939 associating any PPD with it. This command:
940 </p><pre class="screen">
941 <tt class="prompt">$ </tt><b class="userinput"><tt>lpadmin -P rawprinter -v socket://11.12.13.14:9100 -E</tt></b>
942 </pre><p>
943 sets up a queue named &#8220;<span class="quote">rawprinter</span>&#8221;, connected via the &#8220;<span class="quote">socket</span>&#8221;
944 protocol (a.k.a. &#8220;<span class="quote">HP JetDirect</span>&#8221;) to the device at IP address
945 11.12.1.3.14, using port 9100. (If you had added a PPD with
946 <b class="command">-P /path/to/PPD</b> to this command line, you would
947 have installed a &#8220;<span class="quote">normal</span>&#8221; print queue.
948 </p><p>
949 CUPS will automatically treat each job sent to a queue as a &#8220;<span class="quote">raw</span>&#8221; one,
950 if it can't find a PPD associated with the queue. However, CUPS will
951 only send known MIME types (as defined in its own mime.types file) and
952 refuse others.
953 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2935861"></a>application/octet-stream Printing</h3></div></div><div></div></div><p>
954 Any MIME type with no rule in the
955 <tt class="filename">/etc/cups/mime.types</tt> file is regarded as unknown
956 or <i class="parameter"><tt>application/octet-stream</tt></i> and will not be
957 sent. Because CUPS refuses to print unknown MIME types per default,
958 you will probably have experienced the fact that print jobs originating
959 from Windows clients were not printed. You may have found an error
960 message in your CUPS logs like:
961 </p><p><tt class="computeroutput">
962 Unable to convert file 0 to printable format for job
963 </tt></p><p>
964 To enable the printing of <i class="parameter"><tt>application/octet-stream</tt></i> files, edit
965 these two files:
966 </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>
967 Both contain entries (at the end of the respective files) which must
968 be uncommented to allow RAW mode operation for
969 <i class="parameter"><tt>application/octet-stream</tt></i>. In <tt class="filename">/etc/cups/mime.types</tt>
970 make sure this line is present:
972 <a class="indexterm" name="id2935958"></a>
974 </p><pre class="programlisting">
975 application/octet-stream
976 </pre><p>
978 This line (with no specific auto-typing rule set) makes all files
979 not otherwise auto-typed a member of <i class="parameter"><tt>application/octet-stream</tt></i>. In
980 <tt class="filename">/etc/cups/mime.convs</tt>, have this
981 line:
983 </p><pre class="programlisting">
984 application/octet-stream application/vnd.cups-raw 0 -
985 </pre><p>
987 <a class="indexterm" name="id2935999"></a>
989 This line tells CUPS to use the <span class="emphasis"><em>Null Filter</em></span>
990 (denoted as &#8220;<span class="quote">-</span>&#8221;, doing nothing at all) on
991 <i class="parameter"><tt>application/octet-stream</tt></i>, and tag the result as
992 <i class="parameter"><tt>application/vnd.cups-raw</tt></i>. This last one is
993 always a green light to the CUPS scheduler to now hand the file over
994 to the backend connecting to the printer and sending it over.
995 </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
996 <tt class="filename">mime.types</tt> file does not
997 <span class="emphasis"><em>enforce</em></span> &#8220;<span class="quote">raw</span>&#8221; printing, it only
998 <span class="emphasis"><em>allows</em></span> it.
999 </p></div><p><b>Background. </b>
1000 CUPS being a more security-aware printing system than traditional ones
1001 does not by default allow one to send deliberate (possibly binary)
1002 data to printing devices. (This could be easily abused to launch a
1003 Denial of Service attack on your printer(s), causing at least the loss
1004 of a lot of paper and ink...) &#8220;<span class="quote">Unknown</span>&#8221; data are regarded by CUPS
1005 as <span class="emphasis"><em>MIME type</em></span>
1006 <span class="emphasis"><em>application/octet-stream</em></span>. While you
1007 <span class="emphasis"><em>can</em></span> send data &#8220;<span class="quote">raw</span>&#8221;, the MIME type for these must
1008 be one that is known to CUPS and an allowed one. The file
1009 <tt class="filename">/etc/cups/mime.types</tt> defines the &#8220;<span class="quote">rules</span>&#8221; of how CUPS
1010 recognizes MIME types. The file
1011 <tt class="filename">/etc/cups/mime.convs</tt> decides which file
1012 conversion filter(s) may be applied to which MIME types.
1013 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2936129"></a>PostScript Printer Descriptions (PPDs) for Non-PS Printers</h3></div></div><div></div></div><p>
1014 <a class="indexterm" name="id2936141"></a>
1015 Originally PPDs were meant to be used for PostScript printers
1016 only. Here, they help to send device-specific commands and settings
1017 to the RIP which processes the jobfile. CUPS has extended this
1018 scope for PPDs to cover non-PostScript printers too. This was not
1019 difficult, because it is a standardized file format. In a way
1020 it was logical too: CUPS handles PostScript and uses a PostScript
1021 RIP (Ghostscript) to process the jobfiles. The only difference is:
1022 a PostScript printer has the RIP built-in, for other types of
1023 printers the Ghostscript RIP runs on the host computer.
1024 </p><p>
1025 PPDs for a non-PS printer have a few lines that are unique to
1026 CUPS. The most important one looks similar to this:
1028 <a class="indexterm" name="id2936166"></a>
1030 </p><pre class="programlisting">
1031 *cupsFilter: application/vnd.cups-raster 66 rastertoprinter
1032 </pre><p>
1034 It is the last piece in the CUPS filtering puzzle. This line tells the
1035 CUPS daemon to use as a last filter <i class="parameter"><tt>rastertoprinter</tt></i>. This filter
1036 should be served as input an <i class="parameter"><tt>application/vnd.cups-raster</tt></i> MIME type
1037 file. Therefore, CUPS should auto-construct a filtering chain, which
1038 delivers as its last output the specified MIME type. This is then
1039 taken as input to the specified <i class="parameter"><tt>rastertoprinter</tt></i> filter. After this
1040 the last filter has done its work (<i class="parameter"><tt>rastertoprinter</tt></i> is a Gimp-Print
1041 filter), the file should go to the backend, which sends it to the
1042 output device.
1043 </p><p>
1044 CUPS by default ships only a few generic PPDs, but they are good for
1045 several hundred printer models. You may not be able to control
1046 different paper trays, or you may get larger margins than your
1047 specific model supports. See <link linkend="cups-ppds"> for summary information.
1048 </p><div class="table"><a name="cups-ppds"></a><p class="title"><b>Table 19.1. PPDs shipped with CUPS</b></p><table summary="PPDs shipped with CUPS" border="1"><colgroup><col align="left"><col align="justify"></colgroup><thead><tr><th align="left">PPD file</th><th align="justify">Printer type</th></tr></thead><tbody><tr><td align="left">deskjet.ppd</td><td align="justify">older HP inkjet printers and compatible</td></tr><tr><td align="left">deskjet2.ppd</td><td align="justify">newer HP inkjet printers and compatible </td></tr><tr><td align="left">dymo.ppd</td><td align="justify">label printers </td></tr><tr><td align="left">epson9.ppd</td><td align="justify">Epson 24pin impact printers and compatible </td></tr><tr><td align="left">epson24.ppd</td><td align="justify">Epson 24pin impact printers and compatible </td></tr><tr><td align="left">okidata9.ppd</td><td align="justify">Okidata 9pin impact printers and compatible </td></tr><tr><td align="left">okidat24.ppd</td><td align="justify">Okidata 24pin impact printers and compatible </td></tr><tr><td align="left">stcolor.ppd</td><td align="justify">older Epson Stylus Color printers </td></tr><tr><td align="left">stcolor2.ppd</td><td align="justify">newer Epson Stylus Color printers </td></tr><tr><td align="left">stphoto.ppd</td><td align="justify">older Epson Stylus Photo printers </td></tr><tr><td align="left">stphoto2.ppd</td><td align="justify">newer Epson Stylus Photo printers </td></tr><tr><td align="left">laserjet.ppd</td><td align="justify">all PCL printers. Further below is a discussion
1049 of several other driver/PPD-packages suitable for use with CUPS. </td></tr></tbody></table></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2936430"></a><span class="emphasis"><em>cupsomatic/foomatic-rip</em></span> Versus <span class="emphasis"><em>native CUPS</em></span> Printing</h3></div></div><div></div></div><p>
1050 <a class="indexterm" name="id2936449"></a>
1051 <a class="indexterm" name="id2936457"></a>
1052 Native CUPS rasterization works in two steps:
1053 </p><div class="itemizedlist"><ul type="disc"><li><p>
1054 First is the <i class="parameter"><tt>pstoraster</tt></i> step. It uses the special CUPS
1055 <a class="indexterm" name="id2936483"></a>
1056 device from ESP Ghostscript 7.05.x as its tool.
1057 </p></li><li><p>
1058 Second comes the <i class="parameter"><tt>rasterdriver</tt></i> step. It uses various
1059 device-specific filters; there are several vendors who provide good
1060 quality filters for this step. Some are free software, some are
1061 shareware/non-free and some are proprietary.</p></li></ul></div><p>
1062 Often this produces better quality (and has several more
1063 advantages) than other methods.
1064 </p><p>
1065 </p><div class="figure"><a name="cupsomatic-dia"></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" width="270" alt="cupsomatic/foomatic Processing versus Native CUPS."></div></div><p>
1066 </p><p>
1067 One other method is the <i class="parameter"><tt>cupsomatic/foomatic-rip</tt></i>
1068 way. Note that <i class="parameter"><tt>cupsomatic</tt></i> is <span class="emphasis"><em>not</em></span> made by the CUPS
1069 developers. It is an independent contribution to printing development,
1070 made by people from Linuxprinting.org <sup>[<a name="id2936587" href="#ftn.id2936587">4</a>]</sup>.
1071 <i class="parameter"><tt>cupsomatic</tt></i> is no longer developed and maintained and is no longer
1072 supported. It has now been replaced by
1073 <i class="parameter"><tt>foomatic-rip</tt></i>. <i class="parameter"><tt>foomatic-rip</tt></i> is a complete re-write
1074 of the old <i class="parameter"><tt>cupsomatic</tt></i> idea, but very much improved and generalized to
1075 other (non-CUPS) spoolers. An upgrade to foomatic-rip is strongly
1076 advised, especially if you are upgrading to a recent version of CUPS,
1077 too.
1078 </p><p>
1079 <a class="indexterm" name="id2936634"></a>
1080 <a class="indexterm" name="id2936642"></a>
1081 Both the <i class="parameter"><tt>cupsomatic</tt></i> (old) and the <i class="parameter"><tt>foomatic-rip</tt></i> (new) methods from
1082 Linuxprinting.org use the traditional Ghostscript print file
1083 processing, doing everything in a single step. It therefore relies on
1084 all the other devices built into Ghostscript. The quality is as
1085 good (or bad) as Ghostscript rendering is in other spoolers. The
1086 advantage is that this method supports many printer models not
1087 supported (yet) by the more modern CUPS method.
1088 </p><p>
1089 Of course, you can use both methods side by side on one system (and
1090 even for one printer, if you set up different queues) and find out
1091 which works best for you.
1092 </p><p>
1093 <i class="parameter"><tt>cupsomatic</tt></i> kidnaps the printfile after the
1094 <i class="parameter"><tt>application/vnd.cups-postscript</tt></i> stage and
1095 deviates it through the CUPS-external, system-wide Ghostscript
1096 installation. Therefore the printfile bypasses the <i class="parameter"><tt>pstoraster</tt></i> filter
1097 (and also bypasses the CUPS-raster-drivers
1098 <i class="parameter"><tt>rastertosomething</tt></i>). After Ghostscript finished its rasterization,
1099 <i class="parameter"><tt>cupsomatic</tt></i> hands the rendered file directly to the CUPS backend. The
1100 flowchart in <link linkend="cupsomatic-dia"> illustrates the difference between native CUPS
1101 rendering and the <i class="parameter"><tt>Foomatic/cupsomatic</tt></i> method.
1102 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2936743"></a>Examples for Filtering Chains</h3></div></div><div></div></div><p>
1103 Here are a few examples of commonly occurring filtering chains to
1104 illustrate the workings of CUPS.
1105 </p><p>
1106 Assume you want to print a PDF file to an HP JetDirect-connected
1107 PostScript printer, but you want to print the pages 3-5, 7, 11-13
1108 only, and you want to print them &#8220;<span class="quote">two-up</span>&#8221; and &#8220;<span class="quote">duplex</span>&#8221;:
1109 </p><div class="itemizedlist"><ul type="disc"><li><p>Your print options (page selection as required, two-up,
1110 duplex) are passed to CUPS on the command line.</p></li><li><p>The (complete) PDF file is sent to CUPS and autotyped as
1111 <i class="parameter"><tt>application/pdf</tt></i>.</p></li><li><p>The file therefore must first pass the
1112 <i class="parameter"><tt>pdftops</tt></i> pre-filter, which produces PostScript
1113 MIME type <i class="parameter"><tt>application/postscript</tt></i> (a preview here
1114 would still show all pages of the original PDF).</p></li><li><p>The file then passes the <i class="parameter"><tt>pstops</tt></i>
1115 filter that applies the command line options: it selects the pages
1116 2-5, 7 and 11-13, creates an imposed layout &#8220;<span class="quote">2 pages on 1 sheet</span>&#8221; and
1117 inserts the correct &#8220;<span class="quote">duplex</span>&#8221; command (as defined in the printer's
1118 PPD) into the new PostScript file; the file is now of PostScript MIME
1119 type
1120 <i class="parameter"><tt>application/vnd.cups-postscript</tt></i>.</p></li><li><p>The file goes to the <i class="parameter"><tt>socket</tt></i>
1121 backend, which transfers the job to the printers.</p></li></ul></div><p>
1122 The resulting filter chain, therefore, is as drawn in <link linkend="pdftosocket">.
1123 </p><div class="figure"><a name="pdftosocket"></a><p class="title"><b>Figure 19.11. PDF to socket chain.</b></p><div class="mediaobject"><img src="projdoc/imagefiles/pdftosocket.png" width="270" alt="PDF to socket chain."></div></div><p>
1124 Assume your want to print the same filter to an USB-connected
1125 Epson Stylus Photo printer installed with the CUPS
1126 <tt class="filename">stphoto2.ppd</tt>. The first few filtering stages
1127 are nearly the same:
1128 </p><div class="itemizedlist"><ul type="disc"><li><p>Your print options (page selection as required, two-up,
1129 duplex) are passed to CUPS on the commandline.</p></li><li><p>The (complete) PDF file is sent to CUPS and autotyped as
1130 <i class="parameter"><tt>application/pdf</tt></i>.</p></li><li><p>The file must first pass the
1131 <i class="parameter"><tt>pdftops</tt></i> pre-filter, which produces PostScript
1132 MIME type <i class="parameter"><tt>application/postscript</tt></i> (a preview here
1133 would still show all pages of the original PDF).</p></li><li><p>The file then passes the &#8220;<span class="quote">pstops</span>&#8221; filter that applies
1134 the commandline options: it selects the pages 2-5, 7 and 11-13,
1135 creates an imposed layout &#8220;<span class="quote">two pages on one sheet</span>&#8221; and inserts the
1136 correct &#8220;<span class="quote">duplex</span>&#8221; command... (Oops this printer and PPD
1137 do not support duplex printing at all so this option will
1138 be ignored) into the new PostScript file; the file is now of PostScript
1139 MIME type
1140 <i class="parameter"><tt>application/vnd.cups-postscript</tt></i>.</p></li><li><p>The file then passes the
1142 <i class="parameter"><tt>pstoraster</tt></i> stage and becomes MIME type
1143 <i class="parameter"><tt>application/
1144 cups-raster</tt></i>.</p></li><li><p>Finally, the <i class="parameter"><tt>rastertoepson</tt></i> filter
1145 does its work (as indicated in the printer's PPD), creating the
1146 rinter-specific raster data and embedding any user-selected
1147 print-options into the print data stream.</p></li><li><p>The file goes to the <i class="parameter"><tt>usb</tt></i> backend,
1148 which transfers the job to the printers.</p></li></ul></div><p>
1149 The resulting filter chain therefore is as drawn in <link linkend="pdftoepsonusb">.
1150 </p><div class="figure"><a name="pdftoepsonusb"></a><p class="title"><b>Figure 19.12. PDF to USB chain.</b></p><div class="mediaobject"><img src="projdoc/imagefiles/pdftoepsonusb.png" width="270" alt="PDF to USB chain."></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2937128"></a>Sources of CUPS Drivers/PPDs</h3></div></div><div></div></div><p>
1151 On the Internet you can now find many thousands of CUPS-PPD files
1152 (with their companion filters), in many national languages
1153 supporting more than thousand non-PostScript models.
1154 </p><div class="itemizedlist"><a class="indexterm" name="id2937144"></a><a class="indexterm" name="id2937154"></a><ul type="disc"><li><p><ulink url="http://wwwl.easysw.com/printpro/">ESP
1155 PrintPro</ulink> (commercial,
1156 non-free) is packaged with more than three thousand PPDs, ready for
1157 successful use &#8220;<span class="quote">out of the box</span>&#8221; on Linux, Mac OS X, IBM-AIX,
1158 HP-UX, Sun-Solaris, SGI-IRIX, Compaq Tru64, Digital UNIX, and some
1159 more commercial Unices (it is written by the CUPS developers
1160 themselves and its sales help finance the further development of
1161 CUPS, as they feed their creators).</p></li><li><p>The <ulink url="http://gimp-print.sourceforge.net/">Gimp-Print-Project
1162 </ulink> (GPL, free software)
1163 provides around 140 PPDs (supporting nearly 400 printers, many driven
1164 to photo quality output), to be used alongside the Gimp-Print CUPS
1165 filters.</p></li><li><p><ulink url="http://www.turboprint.com/">TurboPrint
1166 </ulink> (shareware, non-free) supports
1167 roughly the same amount of printers in excellent
1168 quality.</p></li><li><p><ulink url="http://www-124.ibm.com/developerworks/oss/linux/projects/omni/">OMNI
1169 </ulink>
1170 (LPGL, free) is a package made by IBM, now containing support for more
1171 than 400 printers, stemming from the inheritance of IBM OS/2 Know-How
1172 ported over to Linux (CUPS support is in a beta-stage at
1173 present).</p></li><li><p><ulink url="http://hpinkjet.sourceforge.net/">HPIJS
1174 </ulink> (BSD-style licenses, free)
1175 supports around 150 of HP's own printers and is also providing
1176 excellent print quality now (currently available only via the Foomatic
1177 path).</p></li><li><p><ulink url="http://www.linuxprinting.org/">Foomatic/cupsomatic
1178 </ulink> (LPGL, free) from
1179 Linuxprinting.org are providing PPDs for practically every Ghostscript
1180 filter known to the world (including Omni, Gimp-Print and
1181 HPIJS).</p></li></ul></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2937265"></a>Printing with Interface Scripts</h3></div></div><div></div></div><p>
1182 CUPS also supports the usage of &#8220;<span class="quote">interface scripts</span>&#8221; as known from
1183 System V AT&amp;T printing systems. These are often used for PCL
1184 printers, from applications that generate PCL print jobs. Interface
1185 scripts are specific to printer models. They have a similar role as
1186 PPDs for PostScript printers. Interface scripts may inject the Escape
1187 sequences as required into the print data stream, if the user has
1188 chosen to select a certain paper tray, or print landscape, or use A3
1189 paper, etc. Interfaces scripts are practically unknown in the Linux
1190 realm. On HP-UX platforms they are more often used. You can use any
1191 working interface script on CUPS too. Just install the printer with
1192 the <b class="command">-i</b> option:
1193 </p><pre class="screen">
1194 <tt class="prompt">root# </tt><b class="userinput"><tt>lpadmin -p pclprinter -v socket://11.12.13.14:9100 \
1195 -i /path/to/interface-script</tt></b>
1196 </pre><p>
1197 Interface scripts might be the &#8220;<span class="quote">unknown animal</span>&#8221; to many. However,
1198 with CUPS they provide the easiest way to plug in your own
1199 custom-written filtering script or program into one specific print
1200 queue (some information about the traditional usage of interface scripts is
1201 to be found at <ulink url="http://playground.sun.com/printing/documentation/interface.html">http://playground.sun.com/printing/documentation/interface.html</ulink>).
1202 </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2937358"></a>Network Printing (Purely Windows)</h2></div></div><div></div></div><p>
1203 Network printing covers a lot of ground. To understand what exactly
1204 goes on with Samba when it is printing on behalf of its Windows
1205 clients, let's first look at a &#8220;<span class="quote">purely Windows</span>&#8221; setup: Windows clients
1206 with a Windows NT print server.
1207 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2937377"></a>From Windows Clients to an NT Print Server</h3></div></div><div></div></div><p>
1208 Windows clients printing to an NT-based print server have two
1209 options. They may:
1210 <a class="indexterm" name="id2937390"></a>
1211 <a class="indexterm" name="id2937399"></a>
1212 </p><div class="itemizedlist"><ul type="disc"><li><p>Execute the driver locally and render the GDI output
1213 (EMF) into the printer-specific format on their own.
1214 </p></li><li><p>Send the GDI output (EMF) to the server, where the
1215 driver is executed to render the printer specific
1216 output.</p></li></ul></div><p>
1217 Both print paths are shown in the flowcharts in the figures below.
1218 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2937434"></a>Driver Execution on the Client</h3></div></div><div></div></div><p>
1219 In the first case the print server must spool the file as raw,
1220 meaning it shouldn't touch the jobfile and try to convert it in any
1221 way. This is what a traditional UNIX-based print server can do too, and
1222 at a better performance and more reliably than an NT print server. This
1223 is what most Samba administrators probably are familiar with. One
1224 advantage of this setup is that this &#8220;<span class="quote">spooling-only</span>&#8221; print server may
1225 be used even if no driver(s) for UNIX are available it is sufficient
1226 to have the Windows client drivers available; and installed on the
1227 clients.
1228 </p><p>
1229 </p><div class="figure"><a name="small11"></a><p class="title"><b>Figure 19.13. Print driver execution on the client.</b></p><div class="mediaobject"><img src="projdoc/imagefiles/11small.png" width="270" alt="Print driver execution on the client."></div></div><p>
1230 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2937506"></a>Driver Execution on the Server</h3></div></div><div></div></div><p>
1231 <a class="indexterm" name="id2937515"></a>
1232 <a class="indexterm" name="id2937523"></a>
1233 <a class="indexterm" name="id2937532"></a>
1234 <a class="indexterm" name="id2937540"></a>
1235 <a class="indexterm" name="id2937548"></a>
1236 The other path executes the printer driver on the server. The client
1237 transfers print files in EMF format to the server. The server uses the
1238 PostScript, PCL, ESC/P or other driver to convert the EMF file into
1239 the printer-specific language. It is not possible for UNIX to do the
1240 same. Currently, there is no program or method to convert a Windows
1241 client's GDI output on a UNIX server into something a printer could
1242 understand.
1243 </p><p>
1244 </p><div class="figure"><a name="small12"></a><p class="title"><b>Figure 19.14. Print driver execution on the server.</b></p><div class="mediaobject"><img src="projdoc/imagefiles/12small.png" width="270" alt="Print driver execution on the server."></div></div><p>
1245 </p><p>
1246 However, there is something similar possible with CUPS. Read on.
1247 </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2937618"></a>Network Printing (Windows Clients UNIX/Samba Print
1248 Servers)</h2></div></div><div></div></div><p>
1249 Since UNIX print servers <span class="emphasis"><em>cannot</em></span> execute the Win32
1250 program code on their platform, the picture is somewhat
1251 different. However, this does not limit your options all that
1252 much. On the contrary, you may have a way here to implement printing
1253 features that are not possible otherwise.
1254 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2937639"></a>From Windows Clients to a CUPS/Samba Print Server</h3></div></div><div></div></div><p>
1255 Here is a simple recipe showing how you can take advantage of CUPS'
1256 powerful features for the benefit of your Windows network printing
1257 clients:
1258 </p><div class="itemizedlist"><ul type="disc"><li><p>Let the Windows clients send PostScript to the CUPS
1259 server.</p></li><li><p>Let the CUPS server render the PostScript into device-specific raster format.</p></li></ul></div><p>
1260 This requires the clients to use a PostScript driver (even if the
1261 printer is a non-PostScript model. It also requires that you have a
1262 driver on the CUPS server.
1263 </p><p>
1264 First, to enable CUPS-based rinting through Samba the
1265 following options should be set in your <tt class="filename">smb.conf</tt> file [global]
1266 section:
1267 </p><table class="simplelist" border="0" summary="Simple list"><tr><td><i class="parameter"><tt>printing = cups</tt></i></td></tr><tr><td><i class="parameter"><tt>printcap = cups</tt></i></td></tr></table><p>
1268 When these parameters are specified, all manually set print directives
1269 (like <a class="indexterm" name="id2937719"></a><i class="parameter"><tt>print command</tt></i>, or <a class="indexterm" name="id2937734"></a><i class="parameter"><tt>lppause command</tt></i>) in <tt class="filename">smb.conf</tt> (as well as
1270 in Samba itself) will be ignored. Instead, Samba will directly
1271 interface with CUPS through its application program interface (API),
1272 as long as Samba has been compiled with CUPS library (libcups)
1273 support. If Samba has not been compiled with CUPS support, and if no
1274 other print commands are set up, then printing will use the
1275 <span class="emphasis"><em>System V</em></span> AT&amp;T command set, with the -oraw
1276 option automatically passing through (if you want your own defined
1277 print commands to work with a Samba that has CUPS support compiled in,
1278 simply use <a class="indexterm" name="id2937772"></a><i class="parameter"><tt>printing</tt></i> = sysv).
1279 </p><p>
1280 </p><div class="figure"><a name="13small"></a><p class="title"><b>Figure 19.15. Printing via CUPS/Samba server.</b></p><div class="mediaobject"><img src="projdoc/imagefiles/13small.png" width="270" alt="Printing via CUPS/Samba server."></div></div><p>
1281 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2937834"></a>Samba Receiving Jobfiles and Passing Them to CUPS</h3></div></div><div></div></div><p>
1282 Samba <span class="emphasis"><em>must</em></span> use its own spool directory (it is set
1283 by a line similar to <a class="indexterm" name="id2937848"></a><i class="parameter"><tt>path</tt></i> = /var/spool/samba,
1284 in the <i class="parameter"><tt>[printers]</tt></i> or
1285 <i class="parameter"><tt>[printername]</tt></i> section of
1286 <tt class="filename">smb.conf</tt>). Samba receives the job in its own
1287 spool space and passes it into the spool directory of CUPS (the CUPS
1288 spooling directory is set by the <i class="parameter"><tt>RequestRoot</tt></i>
1289 directive, in a line that defaults to <i class="parameter"><tt>RequestRoot
1290 /var/spool/cups</tt></i>). CUPS checks the access rights of its
1291 spool dir and resets it to healthy values with every restart. We have
1292 seen quite a few people who had used a common spooling space for Samba
1293 and CUPS, and were struggling for weeks with this &#8220;<span class="quote">problem.</span>&#8221;
1294 </p><p>
1295 A Windows user authenticates only to Samba (by whatever means is
1296 configured). If Samba runs on the same host as CUPS, you only need to
1297 allow &#8220;<span class="quote">localhost</span>&#8221; to print. If they run on different machines, you
1298 need to make sure the Samba host gets access to printing on CUPS.
1299 </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2937924"></a>Network PostScript RIP</h2></div></div><div></div></div><p>
1300 This section discusses the use of CUPS filters on the server configuration where
1301 clients make use of a PostScript driver with CUPS-PPDs.
1302 </p><p>
1303 <a class="indexterm" name="id2937945"></a>
1304 <a class="indexterm" name="id2937953"></a>
1305 <a class="indexterm" name="id2937961"></a>
1306 PPDs can control all print device options. They are usually provided
1307 by the manufacturer, if you own a PostScript printer, that is. PPD
1308 files (PostScript Printer Descriptions) are always a component of
1309 PostScript printer drivers on MS Windows or Apple Mac OS systems. They
1310 are ASCII files containing user-selectable print options, mapped to
1311 appropriate PostScript, PCL or PJL commands for the target
1312 printer. Printer driver GUI dialogs translate these options
1313 &#8220;<span class="quote">on-the-fly</span>&#8221; into buttons and drop-down lists for the user to select.
1314 </p><p>
1315 CUPS can load, without any conversions, the PPD file from any Windows
1316 (NT is recommended) PostScript driver and handle the options. There is
1317 a Web browser interface to the print options (select <ulink url="http://localhost:631/printers/">http://localhost:631/printers/</ulink>
1318 and click on one <span class="guibutton">Configure Printer</span> button to see
1319 it), or a command line interface (see <b class="command">man lpoptions</b>
1320 or see if you have <b class="command">lphelp</b> on your system). There are also some
1321 different GUI frontends on Linux/UNIX, which can present PPD options
1322 to users. PPD options are normally meant to be evaluated by the
1323 PostScript RIP on the real PostScript printer.
1324 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2938025"></a>PPDs for Non-PS Printers on UNIX</h3></div></div><div></div></div><p>
1325 <a class="indexterm" name="id2938037"></a>
1326 CUPS does not limit itself to &#8220;<span class="quote">real</span>&#8221; PostScript printers in its usage
1327 of PPDs. The CUPS developers have extended the scope of the PPD
1328 concept to also describe available device and driver options for
1329 non-PostScript printers through CUPS-PPDs.
1330 </p><p>
1331 This is logical, as CUPS includes a fully featured PostScript
1332 interpreter (RIP). This RIP is based on Ghostscript. It can process
1333 all received PostScript (and additionally many other file formats)
1334 from clients. All CUPS-PPDs geared to non-PostScript printers contain
1335 an additional line, starting with the keyword
1336 <i class="parameter"><tt>*cupsFilter</tt></i>. This line tells the CUPS print
1337 system which printer-specific filter to use for the interpretation of
1338 the supplied PostScript. Thus CUPS lets all its printers appear as
1339 PostScript devices to its clients, because it can act as a PostScript
1340 RIP for those printers, processing the received PostScript code into a
1341 proper raster print format.
1342 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2938085"></a>PPDs for Non-PS Printers on Windows</h3></div></div><div></div></div><p>
1343 <a class="indexterm" name="id2938096"></a>
1344 CUPS-PPDs can also be used on Windows-Clients, on top of a
1345 &#8220;<span class="quote">core</span>&#8221; PostScript driver (now recommended is the "CUPS PostScript
1346 Driver for WindowsNT/200x/XP"; you can also use the Adobe one, with
1347 limitations). This feature enables CUPS to do a few tricks no other
1348 spooler can do:
1349 </p><div class="itemizedlist"><ul type="disc"><li><p>Act as a networked PostScript RIP (Raster Image
1350 Processor), handling printfiles from all client platforms in a uniform
1351 way.</p></li><li><p>Act as a central accounting and billing server, since
1352 all files are passed through the pstops filter and are, therefore,
1353 logged in the CUPS <tt class="filename">page_log</tt> file.
1354 <span class="emphasis"><em>Note:</em></span> this cannot happen with &#8220;<span class="quote">raw</span>&#8221; print jobs,
1355 which always remain unfiltered per definition.</p></li><li><p>Enable clients to consolidate on a single PostScript
1356 driver, even for many different target printers.</p></li></ul></div><p>
1357 Using CUPS PPDs on Windows clients enables these to control
1358 all print job settings just as a UNIX client can do.
1359 </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2938166"></a>Windows Terminal Servers (WTS) as CUPS Clients</h2></div></div><div></div></div><p>
1360 This setup may be of special interest to people experiencing major
1361 problems in WTS environments. WTS often need a multitude of
1362 non-PostScript drivers installed to run their clients' variety of
1363 different printer models. This often imposes the price of much
1364 increased instability.
1365 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2938184"></a>Printer Drivers Running in &#8220;<span class="quote">Kernel Mode</span>&#8221; Cause Many
1366 Problems</h3></div></div><div></div></div><p>
1367 In Windows NT printer drivers which run in &#8220;<span class="quote">Kernel
1368 Mode</span>&#8221;, introduces a high risk for the stability of the system
1369 if the driver is not really stable and well-tested. And there are a
1370 lot of bad drivers out there! Especially notorious is the example
1371 of the PCL printer driver that had an additional sound module
1372 running, to notify users via soundcard of their finished jobs. Do I
1373 need to say that this one was also reliably causing &#8220;<span class="quote">blue screens
1374 of death</span>&#8221; on a regular basis?
1375 </p><p>
1376 PostScript drivers are generally well tested. They are not known
1377 to cause any problems, even though they also run in kernel mode. This
1378 might be because there have been so far only two different PostScript
1379 drivers: the ones from Adobe and the one from Microsoft. Both are
1380 well tested and are as stable as you can imagine on
1381 Windows. The CUPS driver is derived from the Microsoft one.
1382 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2938229"></a>Workarounds Impose Heavy Limitations</h3></div></div><div></div></div><p>
1383 In many cases, in an attempt to work around this problem, site
1384 administrators have resorted to restricting the allowed drivers installed
1385 on their WTS to one generic PCL and one PostScript driver. This,
1386 however, restricts the clients in the number of printer options
1387 available for them. Often they can't get out more than simplex
1388 prints from one standard paper tray, while their devices could do much
1389 better, if driven by a different driver!
1390 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2938250"></a>CUPS: A &#8220;<span class="quote">Magical Stone</span>&#8221;?</h3></div></div><div></div></div><p>
1391 <a class="indexterm" name="id2938266"></a>
1392 <a class="indexterm" name="id2938274"></a>
1393 Using a PostScript driver, enabled with a CUPS-PPD, seems to be a very
1394 elegant way to overcome all these shortcomings. There are, depending
1395 on the version of Windows OS you use, up to three different PostScript
1396 drivers available: Adobe, Microsoft and CUPS PostScript drivers. None
1397 of them is known to cause major stability problems on WTS (even if
1398 used with many different PPDs). The clients will be able to (again)
1399 chose paper trays, duplex printing and other settings. However, there
1400 is a certain price for this too: a CUPS server acting as a PostScript
1401 RIP for its clients requires more CPU and RAM than when just acting as
1402 a &#8220;<span class="quote">raw spooling</span>&#8221; device. Plus, this setup is not yet widely tested,
1403 although the first feedbacks look very promising.
1404 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2938313"></a>PostScript Drivers with No Major Problems Even in Kernel
1405 Mode</h3></div></div><div></div></div><p>
1406 <a class="indexterm" name="id2938329"></a>
1407 More recent printer drivers on W200x and XP no longer run in kernel mode
1408 (unlike Windows NT). However, both operating systems can still
1409 use the NT drivers, running in kernel mode (you can roughly tell which
1410 is which as the drivers in subdirectory &#8220;<span class="quote">2</span>&#8221; of &#8220;<span class="quote">W32X86</span>&#8221; are &#8220;<span class="quote">old</span>&#8221;
1411 ones). As was said before, the Adobe as well as the Microsoft
1412 PostScript drivers are not known to cause any stability problems. The
1413 CUPS driver is derived from the Microsoft one. There is a simple
1414 reason for this: The MS DDK (Device Development Kit) for Windows NT (which
1415 used to be available at no cost to licensees of Visual Studio)
1416 includes the source code of the Microsoft driver, and licensees of
1417 Visual Studio are allowed to use and modify it for their own driver
1418 development efforts. This is what the CUPS people have done. The
1419 license does not allow them to publish the whole of the source code.
1420 However, they have released the &#8220;<span class="quote">diff</span>&#8221; under the GPL, and if you are
1421 the owner of an &#8220;<span class="quote">MS DDK for Windows NT,</span>&#8221; you can check the driver yourself.
1422 </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2938378"></a>Configuring CUPS for Driver Download</h2></div></div><div></div></div><p>
1423 As we have said before, all previously known methods to prepare client
1424 printer drivers on the Samba server for download and Point'n'Print
1425 convenience of Windows workstations are working with CUPS, too. These
1426 methods were described in the previous chapter. In reality, this is a
1427 pure Samba business and only relates to the Samba/Windows client
1428 relationship.
1429 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2938397"></a><span class="emphasis"><em>cupsaddsmb</em></span>: The Unknown Utility</h3></div></div><div></div></div><p>
1430 <a class="indexterm" name="id2938412"></a>
1431 The <b class="command">cupsaddsmb</b> utility (shipped with all current CUPS versions) is an
1432 alternate method to transfer printer drivers into the Samba
1433 <i class="parameter"><tt>[print$]</tt></i> share. Remember, this share is where
1434 clients expect drivers deposited and setup for download and
1435 installation. It makes the sharing of any (or all) installed CUPS
1436 printers quite easy. <b class="command">cupsaddsmb</b> can use the Adobe PostScript driver as
1437 well as the newly developed CUPS PostScript Driver for
1438 Windows NT/200x/XP. <i class="parameter"><tt>cupsaddsmb</tt></i> does
1439 <span class="emphasis"><em>not</em></span> work with arbitrary vendor printer drivers,
1440 but only with the <span class="emphasis"><em>exact</em></span> driver files that are
1441 named in its man page.
1442 </p><p>
1443 The CUPS printer driver is available from the CUPS download site. Its
1444 package name is <tt class="filename">cups-samba-[version].tar.gz</tt> . It
1445 is preferred over the Adobe drivers since it has a number of
1446 advantages:
1447 </p><div class="itemizedlist"><ul type="disc"><li><p>It supports a much more accurate page
1448 accounting.</p></li><li><p>It supports banner pages, and page labels on all
1449 printers.</p></li><li><p>It supports the setting of a number of job IPP
1450 attributes (such as job-priority, page-label and
1451 job-billing).</p></li></ul></div><p>
1452 However, currently only Windows NT, 2000 and XP are supported by the
1453 CUPS drivers. You will also need to get the respective part of Adobe driver
1454 if you need to support Windows 95, 98 and ME clients.
1455 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2938514"></a>Prepare Your <tt class="filename">smb.conf</tt> for <b class="command">cupsaddsmb</b></h3></div></div><div></div></div><p>
1456 Prior to running <b class="command">cupsaddsmb</b>, you need the settings in
1457 <tt class="filename">smb.conf</tt> as shown in <link linkend="cupsadd-ex">:
1458 </p><div class="example"><a name="cupsadd-ex"></a><p class="title"><b>Example 19.3. smb.conf for cupsaddsmb usage</b></p><table class="simplelist" border="0" summary="Simple list"><tr><td> </td></tr><tr><td><i class="parameter"><tt>[global]</tt></i></td></tr><tr><td><i class="parameter"><tt>load printers = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>printing = cups</tt></i></td></tr><tr><td><i class="parameter"><tt>printcap name = cups</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[printers]</tt></i></td></tr><tr><td><i class="parameter"><tt>comment = All Printers</tt></i></td></tr><tr><td><i class="parameter"><tt>path = /var/spool/samba</tt></i></td></tr><tr><td><i class="parameter"><tt>browseable = no</tt></i></td></tr><tr><td><i class="parameter"><tt>public = yes</tt></i></td></tr><tr><td># setting depends on your requirements</td></tr><tr><td><i class="parameter"><tt>guest ok = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>writable = no</tt></i></td></tr><tr><td><i class="parameter"><tt>printable = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>printer admin = root</tt></i></td></tr><tr><td> </td></tr><tr><td><i class="parameter"><tt>[print$]</tt></i></td></tr><tr><td><i class="parameter"><tt>comment = Printer Drivers</tt></i></td></tr><tr><td><i class="parameter"><tt>path = /etc/samba/drivers</tt></i></td></tr><tr><td><i class="parameter"><tt>browseable = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>guest ok = no</tt></i></td></tr><tr><td><i class="parameter"><tt>read only = yes</tt></i></td></tr><tr><td><i class="parameter"><tt>write list = root</tt></i></td></tr></table></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2938755"></a>CUPS &#8220;<span class="quote">PostScript Driver for Windows NT/200x/XP</span>&#8221;</h3></div></div><div></div></div><p>
1459 <a class="indexterm" name="id2938770"></a>
1460 CUPS users may get the exact same packages from <ulink url="http://www.cups.org/software.html">http://www.cups.org/software.html</ulink>.
1461 It is a separate package from the CUPS base software files, tagged as
1462 CUPS 1.1.x Windows NT/200x/XP Printer Driver for Samba
1463 (tar.gz, 192k). The filename to download is
1464 <tt class="filename">cups-samba-1.1.x.tar.gz</tt>. Upon untar and unzipping,
1465 it will reveal these files:
1466 </p><pre class="screen">
1467 <tt class="prompt">root# </tt><b class="userinput"><tt>tar xvzf cups-samba-1.1.19.tar.gz</tt></b>
1468 cups-samba.install
1469 cups-samba.license
1470 cups-samba.readme
1471 cups-samba.remove
1472 cups-samba.ss
1473 </pre><p>
1474 <a class="indexterm" name="id2938825"></a>
1475 <a class="indexterm" name="id2938836"></a>
1476 These have been packaged with the ESP meta packager software
1477 EPM. The <tt class="filename">*.install</tt> and
1478 <tt class="filename">*.remove</tt> files are simple shell scripts, which
1479 untars the <tt class="filename">*.ss</tt> (the <tt class="filename">*.ss</tt> is
1480 nothing else but a tar-archive, which can be untarred by &#8220;<span class="quote">tar</span>&#8221;
1481 too). Then it puts the content into
1482 <tt class="filename">/usr/share/cups/drivers/</tt>. This content includes three
1483 files:
1484 </p><pre class="screen">
1485 <tt class="prompt">root# </tt><b class="userinput"><tt>tar tv cups-samba.ss</tt></b>
1486 cupsdrvr.dll
1487 cupsui.dll
1488 cups.hlp
1489 </pre><p>
1490 The <i class="parameter"><tt>cups-samba.install</tt></i> shell scripts are easy to
1491 handle:
1492 </p><pre class="screen">
1493 <tt class="prompt">root# </tt><b class="userinput"><tt>./cups-samba.install</tt></b>
1494 [....]
1495 Installing software...
1496 Updating file permissions...
1497 Running post-install commands...
1498 Installation is complete.
1499 </pre><p>
1500 The script should automatically put the driver files into the
1501 <tt class="filename">/usr/share/cups/drivers/</tt> directory.
1502 </p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>
1503 Due to a bug, one recent CUPS release puts the
1504 <tt class="filename">cups.hlp</tt> driver file
1505 into<tt class="filename">/usr/share/drivers/</tt> instead of
1506 <tt class="filename">/usr/share/cups/drivers/</tt>. To work around this,
1507 copy/move the file (after running the
1508 <b class="command">./cups-samba.install</b> script) manually to the
1509 correct place.
1510 </p></div><pre class="screen">
1511 <tt class="prompt">root# </tt><b class="userinput"><tt>cp /usr/share/drivers/cups.hlp /usr/share/cups/drivers/</tt></b>
1512 </pre><p>
1513 <a class="indexterm" name="id2939020"></a>
1514 This new CUPS PostScript driver is currently binary-only, but free of
1515 charge. No complete source code is provided (yet). The reason is that
1516 it has been developed with the help of the Microsoft Driver
1517 Developer Kit (DDK) and compiled with Microsoft Visual
1518 Studio 6. Driver developers are not allowed to distribute the whole of
1519 the source code as free software. However, CUPS developers released
1520 the &#8220;<span class="quote">diff</span>&#8221; in source code under the GPL, so anybody with a license of
1521 Visual Studio and a DDK will be able to compile for him/herself.
1522 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2939044"></a>Recognizing Different Driver Files</h3></div></div><div></div></div><p>
1523 The CUPS drivers do not support the older Windows 95/98/Me, but only
1524 the Windows NT/2000/XP client.
1525 </p><p>Windows NT, 2000 and XP are supported by:</p><p>
1526 </p><div class="itemizedlist"><ul type="disc"><li>cups.hlp</li><li>cupsdrvr.dll</li><li>cupsui.dll</li></ul></div><p>
1527 </p><p>
1528 Adobe drivers are available for the older Windows 95/98/Me as well as
1529 the Windows NT/2000/XP clients. The set of files is different from the
1530 different platforms.
1531 </p><p>Windows 95, 98 and ME are supported by:</p><p>
1532 </p><div class="itemizedlist"><ul type="disc"><li>ADFONTS.MFM</li><li>ADOBEPS4.DRV</li><li>ADOBEPS4.HLP</li><li>DEFPRTR2.PPD</li><li>ICONLIB.DLL</li><li>PSMON.DLL</li></ul></div><p>
1533 </p><p>Windows NT, 2000 and XP are supported by:</p><p>
1534 </p><div class="itemizedlist"><ul type="disc"><li>ADOBEPS5.DLL</li><li>ADOBEPSU.DLL</li><li>ADOBEPSU.HLP</li></ul></div><p>
1536 </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
1537 If both the Adobe driver files and the CUPS driver files for the
1538 support of Windows NT/200x/XP are present in FIXME, the Adobe ones will be ignored
1539 and the CUPS ones will be used. If you prefer for whatever reason
1540 to use Adobe-only drivers, move away the three CUPS driver files. The
1541 Windows 9x/Me clients use the Adobe drivers in any case.
1542 </p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2939174"></a>Acquiring the Adobe Driver Files</h3></div></div><div></div></div><p>
1543 Acquiring the Adobe driver files seems to be unexpectedly difficult
1544 for many users. They are not available on the Adobe Web site as single
1545 files and the self-extracting and/or self-installing Windows-.exe is
1546 not easy to locate either. Probably you need to use the included
1547 native installer and run the installation process on one client
1548 once. This will install the drivers (and one Generic PostScript
1549 printer) locally on the client. When they are installed, share the
1550 Generic PostScript printer. After this, the client's
1551 <i class="parameter"><tt>[print$]</tt></i> share holds the Adobe files, from
1552 where you can get them with smbclient from the CUPS host.
1553 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2939204"></a>ESP Print Pro PostScript Driver for Windows NT/200x/XP</h3></div></div><div></div></div><p>
1554 <a class="indexterm" name="id2939217"></a>
1555 Users of the ESP Print Pro software are able to install their Samba
1556 drivers package for this purpose with no problem. Retrieve the driver
1557 files from the normal download area of the ESP Print Pro software
1558 at <ulink url="http://www.easysw.com/software.html">http://www.easysw.com/software.html</ulink>.
1559 You need to locate the link labelled &#8220;<span class="quote">SAMBA</span>&#8221; among the
1560 <span class="guilabel">Download Printer Drivers for ESP Print Pro 4.x</span>
1561 area and download the package. Once installed, you can prepare any
1562 driver by simply highlighting the printer in the Printer Manager GUI
1563 and select <span class="guilabel">Export Driver...</span> from the menu. Of
1564 course you need to have prepared Samba beforehand to handle the
1565 driver files; i.e., setup the <i class="parameter"><tt>[print$]</tt></i>
1566 share, and so on. The ESP Print Pro package includes the CUPS driver files
1567 as well as a (licensed) set of Adobe drivers for the Windows 95/98/Me
1568 client family.
1569 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2939274"></a>Caveats to be Considered</h3></div></div><div></div></div><p>
1570 <a class="indexterm" name="id2939286"></a>
1571 Once you have run the install script (and possibly manually
1572 moved the <tt class="filename">cups.hlp</tt> file to
1573 <tt class="filename">/usr/share/cups/drivers/</tt>), the driver is
1574 ready to be put into Samba's <i class="parameter"><tt>[print$]</tt></i> share (which often maps to
1575 <tt class="filename">/etc/samba/drivers/</tt> and contains a subdirectory
1576 tree with <span class="emphasis"><em>WIN40</em></span> and
1577 <span class="emphasis"><em>W32X86</em></span> branches). You do this by running
1578 <b class="command">cupsaddsmb</b> (see also <b class="command">man cupsaddsmb</b> for
1579 CUPS since release 1.1.16).
1580 </p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>
1581 <a class="indexterm" name="id2939354"></a>
1582 You may need to put root into the smbpasswd file by running
1583 <b class="command">smbpasswd</b>; this is especially important if you
1584 should run this whole procedure for the first time, and are not
1585 working in an environment where everything is configured for
1586 <span class="emphasis"><em>single sign on</em></span> to a Windows Domain Controller.
1587 </p></div><p>
1588 Once the driver files are in the <i class="parameter"><tt>[print$]</tt></i> share
1589 and are initialized, they are ready to be downloaded and installed by
1590 the Windows NT/200x/XP clients.
1591 </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
1592 Win 9x/Me clients will not work with the CUPS PostScript driver. For
1593 these you still need to use the <tt class="filename">ADOBE*.*</tt>
1594 drivers as previously stated.
1595 </p></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
1596 It is not harmful if you still have the
1597 <tt class="filename">ADOBE*.*</tt> driver files from previous
1598 installations in the <tt class="filename">/usr/share/cups/drivers/</tt>
1599 directory. The new <b class="command">cupsaddsmb</b> (from 1.1.16) will
1600 automatically prefer its own drivers if it finds both.
1601 </p></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
1602 <a class="indexterm" name="id2939442"></a>
1603 Should your Windows clients have had the old <tt class="filename">ADOBE*.*</tt>
1604 files for the Adobe PostScript driver installed, the download and
1605 installation of the new CUPS PostScript driver for Windows NT/200x/XP
1606 will fail at first. You need to wipe the old driver from the clients
1607 first. It is not enough to &#8220;<span class="quote">delete</span>&#8221; the printer, as the driver files
1608 will still be kept by the clients and re-used if you try to re-install
1609 the printer. To really get rid of the Adobe driver files on the
1610 clients, open the <span class="guilabel">Printers</span> folder (possibly via <span class="guilabel">Start &gt; Settings &gt; Control Panel &gt; Printers</span>),
1611 right-click on the folder background and select <span class="guimenuitem">Server
1612 Properties</span>. When the new dialog opens, select the
1613 <span class="guilabel">Drivers</span> tab. On the list select the driver you
1614 want to delete and click the <span class="guilabel">Delete</span>
1615 button. This will only work if there is not one single printer left
1616 that uses that particular driver. You need to &#8220;<span class="quote">delete</span>&#8221; all printers
1617 using this driver in the <span class="guilabel">Printers</span> folder first. You will need
1618 Administrator privileges to do this.
1619 </p></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
1620 <a class="indexterm" name="id2939527"></a>
1621 Once you have successfully downloaded the CUPS PostScript driver to a
1622 client, you can easily switch all printers to this one by proceeding
1623 as described in <link linkend="printing">. Either change
1624 a driver for an existing printer by running the <span class="guilabel">Printer Properties</span>
1625 dialog, or use <b class="command">rpcclient</b> with the
1626 <b class="command">setdriver</b> subcommand.
1627 </p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2939571"></a>Windows CUPS PostScript Driver Versus Adobe Driver</h3></div></div><div></div></div><p>
1628 Are you interested in a comparison between the CUPS and the Adobe
1629 PostScript drivers? For our purposes these are the most important
1630 items that weigh in favor of the CUPS ones:
1631 </p><div class="itemizedlist"><ul type="disc"><li><p>No hassle with the Adobe EULA.</p></li><li><p>No hassle with the question &#8220;<span class="quote">Where do I
1632 get the ADOBE*.* driver files from?</span>&#8221;</p></li><li><p>
1633 <a class="indexterm" name="id2939611"></a>
1634 The Adobe drivers (on request of the printer PPD
1635 associated with them) often put a PJL header in front of the main
1636 PostScript part of the print file. Thus, the printfile starts with
1637 <i class="parameter"><tt>&lt;1B &gt;%-12345X</tt></i> or
1638 <i class="parameter"><tt>&lt;escape&gt;%-12345X</tt></i> instead
1639 of <i class="parameter"><tt>%!PS</tt></i>). This leads to the
1640 CUPS daemon auto-typing the incoming file as a print-ready file,
1641 not initiating a pass through the <i class="parameter"><tt>pstops</tt></i> filter (to speak more
1642 technically, it is not regarded as the generic MIME-type
1643 <a class="indexterm" name="id2939654"></a>
1644 <i class="parameter"><tt>application/postscript</tt></i>, but as
1645 the more special MIME type
1646 <a class="indexterm" name="id2939671"></a>
1647 <i class="parameter"><tt>application/cups.vnd-postscript</tt></i>),
1648 which therefore also leads to the page accounting in
1649 <i class="parameter"><tt>/var/log/cups/page_log</tt></i> not
1650 receiving the exact number of pages; instead the dummy page number
1651 of &#8220;<span class="quote">1</span>&#8221; is logged in a standard setup).</p></li><li><p>The Adobe driver has more options to misconfigure the
1652 PostScript generated by it (like setting it inadvertently to
1653 <span class="guilabel">Optimize for Speed</span>, instead of
1654 <span class="guilabel">Optimize for Portability</span>, which
1655 could lead to CUPS being unable to process it).</p></li><li><p>The CUPS PostScript driver output sent by Windows
1656 clients to the CUPS server is guaranteed to auto-type
1657 as the generic MIME type <i class="parameter"><tt>application/postscript</tt></i>,
1658 thus passing through the CUPS <i class="parameter"><tt>pstops</tt></i> filter and logging the
1659 correct number of pages in the <tt class="filename">page_log</tt> for
1660 accounting and quota purposes.</p></li><li><p>The CUPS PostScript driver supports the sending of
1661 additional standard (IPP) print options by Windows NT/200x/XP clients. Such
1662 additional print options are: naming the CUPS standard
1663 <span class="emphasis"><em>banner pages</em></span> (or the custom ones, should they be
1664 installed at the time of driver download), using the CUPS
1665 page-label option, setting a
1666 job-priority, and setting the scheduled
1667 time of printing (with the option to support additional
1668 useful IPP job attributes in the future).</p></li><li><p>The CUPS PostScript driver supports the inclusion of
1669 the new <i class="parameter"><tt>*cupsJobTicket</tt></i> comments at the
1670 beginning of the PostScript file (which could be used in the future
1671 for all sort of beneficial extensions on the CUPS side, but which will
1672 not disturb any other applications as they will regard it as a comment
1673 and simply ignore it).</p></li><li><p>The CUPS PostScript driver will be the heart of the
1674 fully fledged CUPS IPP client for Windows NT/200x/XP to be released soon
1675 (probably alongside the first beta release for CUPS
1676 1.2).</p></li></ul></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2939801"></a>Run cupsaddsmb (Quiet Mode)</h3></div></div><div></div></div><p>
1677 <a class="indexterm" name="id2939812"></a>
1678 <a class="indexterm" name="id2939820"></a>
1679 The <b class="command">cupsaddsmb</b> command copies the needed files into your
1680 <i class="parameter"><tt>[print$]</tt></i> share. Additionally, the PPD
1681 associated with this printer is copied from
1682 <tt class="filename">/etc/cups/ppd/</tt> to
1683 <i class="parameter"><tt>[print$]</tt></i>. There the files wait for convenient
1684 Windows client installations via Point'n'Print. Before we can run the
1685 command successfully, we need to be sure that we can authenticate
1686 toward Samba. If you have a small network, you are probably using user-level
1687 security (<a class="indexterm" name="id2939861"></a><i class="parameter"><tt>security</tt></i> = user).
1688 </p><p>
1689 Here is an example of a successfully run <b class="command">cupsaddsmb</b> command:
1690 </p><pre class="screen">
1691 <tt class="prompt">root# </tt><b class="userinput"><tt>cupsaddsmb -U root infotec_IS2027</tt></b>
1692 Password for root required to access localhost via Samba: <b class="userinput"><tt>['secret']</tt></b>
1693 </pre><p>
1694 To share <span class="emphasis"><em>all</em></span> printers and drivers, use the
1695 <tt class="option">-a</tt> parameter instead of a printer name. Since
1696 <b class="command">cupsaddsmb</b> &#8220;<span class="quote">exports</span>&#8221; the printer drivers to Samba, it should be
1697 obvious that it only works for queues with a CUPS driver associated.
1698 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2939946"></a>Run cupsaddsmb with Verbose Output</h3></div></div><div></div></div><p>
1699 <a class="indexterm" name="id2939957"></a>
1700 Probably you want to see what's going on. Use the
1701 <tt class="option">-v</tt> parameter to get a more verbose output. The
1702 output below was edited for better readability: all &#8220;<span class="quote">\</span>&#8221; at the end of
1703 a line indicate that I inserted an artificial line break plus some
1704 indentation here:
1705 </p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>
1706 You will see the root password for the Samba account printed on
1707 screen.
1708 </p></div><p>
1710 <a class="indexterm" name="id2939988"></a>
1711 <a class="indexterm" name="id2939999"></a>
1712 </p><pre class="screen">
1713 <tt class="prompt">root# </tt><b class="userinput"><tt>cupsaddsmb -U root -v infotec_2105</tt></b>
1714 Password for root required to access localhost via GANDALF:
1715 Running command: smbclient //localhost/print\$ -N -U'root%secret' \
1716 -c 'mkdir W32X86; \
1717 put /var/spool/cups/tmp/3e98bf2d333b5 W32X86/infotec_2105.ppd; \
1718 put /usr/share/cups/drivers/cupsdrvr.dll W32X86/cupsdrvr.dll; \
1719 put /usr/share/cups/drivers/cupsui.dll W32X86/cupsui.dll; \
1720 put /usr/share/cups/drivers/cups.hlp W32X86/cups.hlp'
1721 added interface ip=10.160.51.60 bcast=10.160.51.255 nmask=255.255.252.0
1722 Domain=[CUPS-PRINT] OS=[UNIX] Server=[Samba 2.2.7a]
1723 NT_STATUS_OBJECT_NAME_COLLISION making remote directory \W32X86
1724 putting file /var/spool/cups/tmp/3e98bf2d333b5 as \W32X86/infotec_2105.ppd
1725 putting file /usr/share/cups/drivers/cupsdrvr.dll as \W32X86/cupsdrvr.dll
1726 putting file /usr/share/cups/drivers/cupsui.dll as \W32X86/cupsui.dll
1727 putting file /usr/share/cups/drivers/cups.hlp as \W32X86/cups.hlp
1729 Running command: rpcclient localhost -N -U'root%secret'
1730 -c 'adddriver "Windows NT x86" \
1731 "infotec_2105:cupsdrvr.dll:infotec_2105.ppd:cupsui.dll:cups.hlp:NULL: \
1732 RAW:NULL"'
1733 cmd = adddriver "Windows NT x86" \
1734 "infotec_2105:cupsdrvr.dll:infotec_2105.ppd:cupsui.dll:cups.hlp:NULL: \
1735 RAW:NULL"
1736 Printer Driver infotec_2105 successfully installed.
1738 Running command: smbclient //localhost/print\$ -N -U'root%secret' \
1739 -c 'mkdir WIN40; \
1740 put /var/spool/cups/tmp/3e98bf2d333b5 WIN40/infotec_2105.PPD; \
1741 put /usr/share/cups/drivers/ADFONTS.MFM WIN40/ADFONTS.MFM; \
1742 put /usr/share/cups/drivers/ADOBEPS4.DRV WIN40/ADOBEPS4.DRV; \
1743 put /usr/share/cups/drivers/ADOBEPS4.HLP WIN40/ADOBEPS4.HLP; \
1744 put /usr/share/cups/drivers/DEFPRTR2.PPD WIN40/DEFPRTR2.PPD; \
1745 put /usr/share/cups/drivers/ICONLIB.DLL WIN40/ICONLIB.DLL; \
1746 put /usr/share/cups/drivers/PSMON.DLL WIN40/PSMON.DLL;'
1747 added interface ip=10.160.51.60 bcast=10.160.51.255 nmask=255.255.252.0
1748 Domain=[CUPS-PRINT] OS=[UNIX] Server=[Samba 2.2.7a]
1749 NT_STATUS_OBJECT_NAME_COLLISION making remote directory \WIN40
1750 putting file /var/spool/cups/tmp/3e98bf2d333b5 as \WIN40/infotec_2105.PPD
1751 putting file /usr/share/cups/drivers/ADFONTS.MFM as \WIN40/ADFONTS.MFM
1752 putting file /usr/share/cups/drivers/ADOBEPS4.DRV as \WIN40/ADOBEPS4.DRV
1753 putting file /usr/share/cups/drivers/ADOBEPS4.HLP as \WIN40/ADOBEPS4.HLP
1754 putting file /usr/share/cups/drivers/DEFPRTR2.PPD as \WIN40/DEFPRTR2.PPD
1755 putting file /usr/share/cups/drivers/ICONLIB.DLL as \WIN40/ICONLIB.DLL
1756 putting file /usr/share/cups/drivers/PSMON.DLL as \WIN40/PSMON.DLL
1758 Running command: rpcclient localhost -N -U'root%secret' \
1759 -c 'adddriver "Windows 4.0" \
1760 "infotec_2105:ADOBEPS4.DRV:infotec_2105.PPD:NULL:ADOBEPS4.HLP: \
1761 PSMON.DLL:RAW:ADOBEPS4.DRV,infotec_2105.PPD,ADOBEPS4.HLP,PSMON.DLL, \
1762 ADFONTS.MFM,DEFPRTR2.PPD,ICONLIB.DLL"'
1763 cmd = adddriver "Windows 4.0" "infotec_2105:ADOBEPS4.DRV:\
1764 infotec_2105.PPD:NULL:ADOBEPS4.HLP:PSMON.DLL:RAW:ADOBEPS4.DRV,\
1765 infotec_2105.PPD,ADOBEPS4.HLP,PSMON.DLL,ADFONTS.MFM,DEFPRTR2.PPD,\
1766 ICONLIB.DLL"
1767 Printer Driver infotec_2105 successfully installed.
1769 Running command: rpcclient localhost -N -U'root%secret' \
1770 -c 'setdriver infotec_2105 infotec_2105'
1771 cmd = setdriver infotec_2105 infotec_2105
1772 Successfully set infotec_2105 to driver infotec_2105.
1774 </pre><p>
1775 If you look closely, you'll discover your root password was transferred
1776 unencrypted over the wire, so beware! Also, if you look further,
1777 you'll discover error messages like NT_STATUS_OBJECT_NAME_COLLISION in between. They occur, because the directories WIN40 and W32X86 already existed in the <i class="parameter"><tt>[print$]</tt></i> driver download share (from a previous driver installation). They are harmless here.
1778 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2940175"></a>Understanding cupsaddsmb</h3></div></div><div></div></div><p>
1779 <a class="indexterm" name="id2940187"></a>
1780 What has happened? What did <b class="command">cupsaddsmb</b> do? There are five stages of
1781 the procedure:
1782 </p><div class="orderedlist"><ol type="1"><li><p>
1783 <a class="indexterm" name="id2940218"></a>
1784 Call the CUPS server via IPP and request the
1785 driver files and the PPD file for the named printer.</p></li><li><p>Store the files temporarily in the local
1786 TEMPDIR (as defined in
1787 <tt class="filename">cupsd.conf</tt>).</p></li><li><p>Connect via smbclient to the Samba server's
1788 <i class="parameter"><tt>[print$]</tt></i> share and put the files into the
1789 share's WIN40 (for Windows 9x/Me) and W32X86/ (for Windows NT/200x/XP) subdirectories.</p></li><li><p>
1790 <a class="indexterm" name="id2940262"></a>
1791 Connect via rpcclient to the Samba server and
1792 execute the <b class="command">adddriver</b> command with the correct
1793 parameters.</p></li><li><p>
1794 <a class="indexterm" name="id2940287"></a>
1795 Connect via rpcclient to the Samba server a second
1796 time and execute the <b class="command">setdriver</b> command.</p></li></ol></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
1797 You can run the <b class="command">cupsaddsmb</b> utility with parameters to
1798 specify one remote host as Samba host and a second remote host as CUPS
1799 host. Especially if you want to get a deeper understanding, it is a
1800 good idea to try it and see more clearly what is going on (though in real
1801 life most people will have their CUPS and Samba servers run on the
1802 same host):
1803 </p><pre class="screen">
1804 <tt class="prompt">root# </tt><b class="userinput"><tt>cupsaddsmb -H sambaserver -h cupsserver -v printer</tt></b>
1805 </pre></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2940352"></a>How to Recognize If cupsaddsmb Completed Successfully</h3></div></div><div></div></div><p>
1806 You <span class="emphasis"><em>must</em></span> always check if the utility completed
1807 successfully in all fields. You need as a minimum these three messages
1808 among the output:
1809 </p><div class="orderedlist"><ol type="1"><li><p><span class="emphasis"><em>Printer Driver infotec_2105 successfully
1810 installed.</em></span> # (for the W32X86 == Windows NT/200x/XP
1811 architecture).</p></li><li><p><span class="emphasis"><em>Printer Driver infotec_2105 successfully
1812 installed.</em></span> # (for the WIN40 == Windows 9x/Me
1813 architecture).</p></li><li><p><span class="emphasis"><em>Successfully set [printerXPZ] to driver
1814 [printerXYZ].</em></span></p></li></ol></div><p>
1815 These messages are probably not easily recognized in the general
1816 output. If you run <b class="command">cupsaddsmb</b> with the <tt class="option">-a</tt>
1817 parameter (which tries to prepare <span class="emphasis"><em>all</em></span> active CUPS
1818 printer drivers for download), you might miss if individual printers
1819 drivers had problems installing properly. Here a redirection of the
1820 output will help you analyze the results in retrospective.
1821 </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
1822 It is impossible to see any diagnostic output if you do not run
1823 <b class="command">cupsaddsmb</b> in verbose mode. Therefore, we strongly recommend to not
1824 use the default quiet mode. It will hide any problems from you that
1825 might occur.
1826 </p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2940450"></a>cupsaddsmb with a Samba PDC</h3></div></div><div></div></div><p>
1827 <a class="indexterm" name="id2940460"></a>
1828 Can't get the standard <b class="command">cupsaddsmb</b> command to run on a Samba PDC?
1829 Are you asked for the password credential all over again and again and
1830 the command just will not take off at all? Try one of these
1831 variations:
1832 </p><pre class="screen">
1833 <tt class="prompt">root# </tt><b class="userinput"><tt>cupsaddsmb -U MIDEARTH\\root -v printername</tt></b>
1834 <tt class="prompt">root# </tt><b class="userinput"><tt>cupsaddsmb -H SAURON -U MIDEARTH\\root -v printername</tt></b>
1835 <tt class="prompt">root# </tt><b class="userinput"><tt>cupsaddsmb -H SAURON -U MIDEARTH\\root -h cups-server -v printername</tt></b>
1836 </pre><p>
1837 (Note the two backslashes: the first one is required to
1838 &#8220;<span class="quote">escape</span>&#8221; the second one).
1839 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2940538"></a>cupsaddsmb Flowchart</h3></div></div><div></div></div><p>
1840 <a class="indexterm" name="id2940548"></a>
1841 <link linkend="small14"> shows a chart about the procedures, commandflows and
1842 dataflows of the <b class="command">cupaddsmb</b> command. Note again: cupsaddsmb is
1843 not intended to, and does not work with, raw queues!
1844 </p><p>
1845 </p><div class="figure"><a name="small14"></a><p class="title"><b>Figure 19.16. cupsaddsmb flowchart.</b></p><div class="mediaobject"><img src="projdoc/imagefiles/14small.png" width="270" alt="cupsaddsmb flowchart."></div></div><p>
1846 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2940621"></a>Installing the PostScript Driver on a Client</h3></div></div><div></div></div><p>
1847 <a class="indexterm" name="id2940631"></a>
1848 After <b class="command">cupsaddsmb</b> is completed, your driver is prepared for the clients to
1849 use. Here are the steps you must perform to download and install it
1850 via Point'n'Print. From a Windows client, browse to the CUPS/Samba
1851 server:
1852 </p><div class="itemizedlist"><ul type="disc"><li><p>
1853 <a class="indexterm" name="id2940659"></a>
1854 Open the <span class="guilabel">Printers</span>
1855 share of Samba in Network Neighborhood.</p></li><li><p>Right-click on the printer in
1856 question.</p></li><li><p>From the opening context-menu select
1857 <span class="guimenuitem">Install...</span> or
1858 <span class="guimenuitem">Connect...</span> (depending on the Windows version you
1859 use).</p></li></ul></div><p>
1860 After a few seconds, there should be a new printer in your
1861 client's <span class="emphasis"><em>local</em></span> <span class="guilabel">Printers</span> folder. On Windows
1862 XP it will follow a naming convention of <span class="emphasis"><em>PrinterName on
1863 SambaServer</em></span>. (In my current case it is "infotec_2105 on
1864 kde-bitshop"). If you want to test it and send your first job from
1865 an application like Winword, the new printer appears in a
1866 <tt class="filename">\\SambaServer\PrinterName</tt> entry in the
1867 drop-down list of available printers.
1868 </p><p>
1869 <a class="indexterm" name="id2940738"></a>
1870 <b class="command">cupsaddsmb</b> will only reliably work with CUPS version 1.1.15 or higher
1871 and Samba from 2.2.4. If it does not work, or if the automatic printer
1872 driver download to the clients does not succeed, you can still manually
1873 install the CUPS printer PPD on top of the Adobe PostScript driver on
1874 clients. Then point the client's printer queue to the Samba printer
1875 share for a UNC type of connection:
1876 </p><pre class="screen">
1877 <tt class="prompt">C:\&gt; </tt><b class="userinput"><tt>net use lpt1: \\sambaserver\printershare /user:ntadmin</tt></b>
1878 </pre><p>
1879 should you desire to use the CUPS networked PostScript RIP
1880 functions. (Note that user &#8220;<span class="quote">ntadmin</span>&#8221; needs to be a valid Samba user
1881 with the required privileges to access the printershare.) This
1882 sets up the printer connection in the traditional
1883 <span class="emphasis"><em>LanMan</em></span> way (not using MS-RPC).
1884 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2940801"></a>Avoiding Critical PostScript Driver Settings on the Client</h3></div></div><div></div></div><p>
1885 Printing works, but there are still problems. Most jobs print
1886 well, some do not print at all. Some jobs have problems with fonts,
1887 which do not look very good. Some jobs print fast and some are
1888 dead-slow. Many of these problems can be greatly reduced or even
1889 completely eliminated if you follow a few guidelines. Remember, if
1890 your print device is not PostScript-enabled, you are treating your
1891 Ghostscript installation on your CUPS host with the output your client
1892 driver settings produce. Treat it well:
1893 </p><div class="itemizedlist"><ul type="disc"><li><p>Avoid the PostScript Output Option: Optimize
1894 for Speed setting. Use the Optimize for
1895 Portability instead (Adobe PostScript
1896 driver).</p></li><li><p>Don't use the Page Independence:
1897 NO setting. Instead, use Page Independence
1898 YES (CUPS PostScript Driver).</p></li><li><p>Recommended is the True Type Font
1899 Downloading Option: Native True Type over
1900 Automatic and Outline; you
1901 should by all means avoid Bitmap (Adobe
1902 PostScript Driver).</p></li><li><p>Choose True Type Font: Download as Softfont
1903 into Printer over the default Replace by Device
1904 Font (for exotic fonts, you may need to change it back to
1905 get a printout at all) (Adobe).</p></li><li><p>Sometimes you can choose PostScript Language
1906 Level: In case of problems try 2
1907 instead of 3 (the latest ESP Ghostscript package
1908 handles Level 3 PostScript very well) (Adobe).</p></li><li><p>Say Yes to PostScript
1909 Error Handler (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="id2940875"></a>Installing PostScript Driver Files Manually Using rpcclient</h2></div></div><div></div></div><p>
1910 Of course, you can run all the commands that are embedded into the
1911 cupsaddsmb convenience utility yourself, one by one, and hereby upload
1912 and prepare the driver files for future client downloads.
1913 </p><div class="orderedlist"><ol type="1"><li><p>Prepare Samba (A CUPS print queue with the name of the
1914 printer should be there. We are providing the driver
1915 now).</p></li><li><p>Copy all files to
1916 <i class="parameter"><tt>[print$]</tt></i>.</p></li><li><p>
1917 <a class="indexterm" name="id2940926"></a>
1918 Run <b class="command">rpcclient adddriver</b>
1919 (for each client architecture you want to support).</p></li><li><p>
1920 <a class="indexterm" name="id2940950"></a>
1921 Run <b class="command">rpcclient
1922 setdriver.</b></p></li></ol></div><p>
1923 <a class="indexterm" name="id2940972"></a>
1924 <a class="indexterm" name="id2940983"></a>
1925 <a class="indexterm" name="id2940994"></a>
1926 <a class="indexterm" name="id2941005"></a>
1927 <a class="indexterm" name="id2941016"></a>
1928 We are going to do this now. First, read the man page on <i class="parameter"><tt>rpcclient</tt></i>
1929 to get a first idea. Look at all the printing related
1930 subcommands. <b class="command">enumprinters</b>,
1931 <b class="command">enumdrivers</b>, <b class="command">enumports</b>,
1932 <b class="command">adddriver</b>, <b class="command">setdriver</b> are among
1933 the most interesting ones. <i class="parameter"><tt>rpcclient</tt></i> implements an important part of
1934 the MS-RPC protocol. You can use it to query (and command) a Windows NT
1935 (or 200x/XP) PC, too. MS-RPC is used by Windows clients, among other
1936 things, to benefit from the Point'n'Print features. Samba can now
1937 mimic this as well.
1938 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2941083"></a>A Check of the rpcclient man Page</h3></div></div><div></div></div><p>
1939 First let's check the <i class="parameter"><tt>rpcclient</tt></i> man page. Here are
1940 two relevant passages:
1941 </p><p>
1942 <b class="command">adddriver &lt;arch&gt; &lt;config&gt;</b> Execute an
1943 <b class="command">AddPrinterDriver()</b> RPC to install the printer driver information on
1944 the server. The driver files should already exist in the
1945 directory returned by <b class="command">getdriverdir</b>. Possible
1946 values for <i class="parameter"><tt>arch</tt></i> are the same as those for the
1947 <b class="command">getdriverdir</b> command. The
1948 <i class="parameter"><tt>config</tt></i> parameter is defined as follows:
1949 </p><pre class="screen">
1950 Long Printer Name:\
1951 Driver File Name:\
1952 Data File Name:\
1953 Config File Name:\
1954 Help File Name:\
1955 Language Monitor Name:\
1956 Default Data Type:\
1957 Comma Separated list of Files
1958 </pre><p>Any empty fields should be enter as the string &#8220;<span class="quote">NULL</span>&#8221;. </p><p>Samba does not need to support the concept of Print Monitors
1959 since these only apply to local printers whose driver can make use of
1960 a bi-directional link for communication. This field should be &#8220;<span class="quote">NULL</span>&#8221;.
1961 On a remote NT print server, the Print Monitor for a driver must
1962 already be installed prior to adding the driver or else the RPC will
1963 fail.
1964 </p><p>
1965 <b class="command">setdriver &lt;printername&gt; &lt;drivername&gt;</b>
1966 Execute a <b class="command">SetPrinter()</b> command to update the
1967 printer driver associated with an installed printer. The printer
1968 driver must already be correctly installed on the print server.
1969 </p><p>See also the <b class="command">enumprinters</b> and <b class="command">enumdrivers</b> commands for
1970 obtaining a list of installed printers and drivers.
1971 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2941229"></a>Understanding the rpcclient man Page</h3></div></div><div></div></div><p>
1972 The <span class="emphasis"><em>exact</em></span> format isn't made too clear by the man
1973 page, since you have to deal with some parameters containing
1974 spaces. Here is a better description for it. We have line-broken the
1975 command and indicated the breaks with &#8220;<span class="quote">\</span>&#8221;. Usually you would type the
1976 command in one line without the linebreaks:
1977 <a class="indexterm" name="id2941254"></a>
1978 </p><pre class="screen">
1979 adddriver "Architecture" \
1980 "LongPrinterName:DriverFile:DataFile:ConfigFile:HelpFile:\
1981 LanguageMonitorFile:DataType:ListOfFiles,Comma-separated"
1982 </pre><p>
1983 What the man pages denote as a simple <i class="parameter"><tt>&lt;config&gt;</tt></i>
1984 keyword, in reality consists of eight colon-separated fields. The
1985 last field may take multiple (in some very insane cases, even
1986 20 different additional) files. This might sound confusing at first.
1987 What the man pages names the &#8220;<span class="quote">LongPrinterName</span>&#8221; in
1988 reality should be called the &#8220;<span class="quote">Driver Name</span>&#8221;. You can name it
1989 anything you want, as long as you use this name later in the
1990 <b class="command">rpcclient ... setdriver</b> command. For
1991 practical reasons, many name the driver the same as the
1992 printer.
1993 </p><p>
1994 It isn't simple at all. I hear you asking:
1995 &#8220;<span class="quote">How do I know which files are "Driver
1996 File</span>&#8221;, &#8220;<span class="quote">Data File</span>&#8221;, &#8220;<span class="quote">Config File</span>&#8221;, &#8220;<span class="quote">Help File</span>&#8221; and &#8220;<span class="quote">Language
1997 Monitor File" in each case?</span>&#8221; For an answer, you may
1998 want to have a look at how a Windows NT box with a shared printer
1999 presents the files to us. Remember, that this whole procedure has
2000 to be developed by the Samba team by overhearing the traffic caused
2001 by Windows computers on the wire. We may as well turn to a Windows
2002 box now and access it from a UNIX workstation. We will query it
2003 with <b class="command">rpcclient</b> to see what it tells us and
2004 try to understand the man page more clearly that we've read just
2005 now.
2006 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2941358"></a>Producing an Example by Querying a Windows Box</h3></div></div><div></div></div><p>
2007 <a class="indexterm" name="id2941369"></a>
2008 <a class="indexterm" name="id2941380"></a>
2009 We could run <b class="command">rpcclient</b> with a
2010 <b class="command">getdriver</b> or a <b class="command">getprinter</b>
2011 subcommand (in level 3 verbosity) against it. Just sit down at a UNIX or
2012 Linux workstation with the Samba utilities installed, then type the
2013 following command:
2014 </p><pre class="screen">
2015 <tt class="prompt">root# </tt><b class="userinput"><tt>rpcclient -U'user%secret' NT-SERVER -c 'getdriver printername 3'</tt></b>
2016 </pre><p>
2017 From the result it should become clear which is which. Here is an example from my installation:
2018 </p><p>
2019 <a class="indexterm" name="id2941447"></a>
2020 </p><pre class="screen">
2021 <tt class="prompt">root# </tt><b class="userinput"><tt>rpcclient -U'Danka%xxxx' W200xSERVER \
2022 -c'getdriver "DANKA InfoStream Virtual Printer" 3'</tt></b>
2023 cmd = getdriver "DANKA InfoStream Virtual Printer" 3
2025 [Windows NT x86]
2026 Printer Driver Info 3:
2027 Version: [2]
2028 Driver Name: [DANKA InfoStream]
2029 Architecture: [Windows NT x86]
2030 Driver Path: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\PSCRIPT.DLL]
2031 Datafile: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\INFOSTRM.PPD]
2032 Configfile: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\PSCRPTUI.DLL]
2033 Helpfile: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\PSCRIPT.HLP]
2035 Dependentfiles: []
2036 Dependentfiles: []
2037 Dependentfiles: []
2038 Dependentfiles: []
2039 Dependentfiles: []
2040 Dependentfiles: []
2041 Dependentfiles: []
2043 Monitorname: []
2044 Defaultdatatype: []
2046 </pre><p>
2047 Some printer drivers list additional files under the label
2048 <i class="parameter"><tt>Dependentfiles</tt></i> and these would go into the last field
2049 <i class="parameter"><tt>ListOfFiles,Comma-separated</tt></i>. For the CUPS
2050 PostScript drivers, we do not need any (nor would we for the Adobe
2051 PostScript driver), therefore, the field will get a &#8220;<span class="quote">NULL</span>&#8221; entry.
2052 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2941534"></a>Requirements for adddriver and setdriver to Succeed</h3></div></div><div></div></div><p>
2053 &gt;From the man page (and from the quoted output
2054 of <b class="command">cupsaddsmb</b> above) it becomes clear that you
2055 need to have certain conditions in order to make the manual uploading
2056 and initializing of the driver files succeed. The two <b class="command">rpcclient</b>
2057 <a class="indexterm" name="id2941564"></a>
2058 subcommands (<b class="command">adddriver</b> and
2059 <b class="command">setdriver</b>) need to encounter the following
2060 preconditions to complete successfully:
2061 </p><div class="itemizedlist"><ul type="disc"><li><p>You are connected as <a class="indexterm" name="id2941599"></a><i class="parameter"><tt>printer admin</tt></i> or root (this is <span class="emphasis"><em>not</em></span> the &#8220;<span class="quote">Printer Operators</span>&#8221; group in
2062 NT, but the <span class="emphasis"><em>printer admin</em></span> group as defined in
2063 the <i class="parameter"><tt>[global]</tt></i> section of
2064 <tt class="filename">smb.conf</tt>).</p></li><li><p>Copy all required driver files to
2065 <tt class="filename">\\SAMBA\print$\w32x86</tt> and
2066 <tt class="filename">\\SAMBA\print$\win40</tt> as appropriate. They
2067 will end up in the &#8220;<span class="quote">0</span>&#8221; respective &#8220;<span class="quote">2</span>&#8221; subdirectories later. For now,
2068 <span class="emphasis"><em>do not</em></span> put them there, they'll be automatically
2069 used by the <b class="command">adddriver</b> subcommand. (If you use
2070 <b class="command">smbclient</b> to put the driver files into the share, note that you need
2071 to escape the &#8220;<span class="quote">$</span>&#8221;: <b class="command">smbclient //sambaserver/print\$ -U
2072 root.</b>)</p></li><li><p>The user you're connecting as must be able to write to
2073 the <i class="parameter"><tt>[print$]</tt></i> share and create
2074 subdirectories.</p></li><li><p>The printer you are going to setup for the Windows
2075 clients needs to be installed in CUPS already.</p></li><li><p>
2076 <a class="indexterm" name="id2941729"></a>
2077 <a class="indexterm" name="id2941740"></a>
2078 The CUPS printer must be known to Samba, otherwise the
2079 <b class="command">setdriver</b> subcommand fails with an
2080 NT_STATUS_UNSUCCESSFUL error. To check if the printer is known by
2081 Samba, you may use the <b class="command">enumprinters</b> subcommand to
2082 <b class="command">rpcclient</b>. A long-standing bug prevented a proper update of the
2083 printer list until every smbd process had received a SIGHUP or was
2084 restarted. Remember this in case you've created the CUPS printer just
2085 recently and encounter problems: try restarting
2086 Samba.</p></li></ul></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2941782"></a>Manual Driver Installation in 15 Steps</h3></div></div><div></div></div><p>
2087 We are going to install a printer driver now by manually executing all
2088 required commands. As this may seem a rather complicated process at
2089 first, we go through the procedure step by step, explaining every
2090 single action item as it comes up.
2091 </p><div class="procedure"><p class="title"><b>Procedure 19.1. Manual Driver Installation</b></p><ol type="1"><li><p class="title"><b>Install the printer on CUPS.</b></p><pre class="screen">
2092 <tt class="prompt">root# </tt><b class="userinput"><tt>lpadmin -p mysmbtstprn -v socket://10.160.51.131:9100 -E \
2093 -P canonIR85.ppd</tt></b>
2094 </pre><p>
2095 This installs a printer with the name <i class="parameter"><tt>mysmbtstprn</tt></i>
2096 to the CUPS system. The printer is accessed via a socket
2097 (a.k.a. JetDirect or Direct TCP/IP) connection. You need to be root
2098 for this step.
2099 </p></li><li><p class="title"><b>(Optional) Check if the printer is recognized by Samba.</b></p><p>
2100 <a class="indexterm" name="id2941868"></a>
2101 </p><pre class="screen">
2102 <tt class="prompt">root# </tt><b class="userinput"><tt>rpcclient -Uroot%xxxx -c 'enumprinters' localhost \
2103 | grep -C2 mysmbtstprn</tt></b>
2104 flags:[0x800000]
2105 name:[\\kde-bitshop\mysmbtstprn]
2106 description:[\\kde-bitshop\mysmbtstprn,,mysmbtstprn]
2107 comment:[mysmbtstprn]
2108 </pre><p>
2109 This should show the printer in the list. If not, stop and restart
2110 the Samba daemon (smbd), or send a HUP signal:
2111 </p><pre class="screen">
2112 <tt class="prompt">root# </tt><b class="userinput"><tt>kill -HUP `pidof smbd`</tt></b>
2113 </pre><p>Check again. Troubleshoot and repeat until
2114 successful. Note the &#8220;<span class="quote">empty</span>&#8221; field between the two commas in the
2115 &#8220;<span class="quote">description</span>&#8221; line. The driver name would appear here if there was one already. You need to know root's Samba password (as set by the
2116 <b class="command">smbpasswd</b> command) for this step and most of the
2117 following steps. Alternately, you can authenticate as one of the
2118 users from the &#8220;<span class="quote">write list</span>&#8221; as defined in <tt class="filename">smb.conf</tt> for
2119 <i class="parameter"><tt>[print$]</tt></i>.
2120 </p></li><li><p class="title"><b>(Optional) Check if Samba knows a driver for the printer.</b></p><p>
2121 <a class="indexterm" name="id2941980"></a>
2122 <a class="indexterm" name="id2941991"></a>
2123 </p><pre class="screen">
2124 <tt class="prompt">root# </tt><b class="userinput"><tt>rpcclient -Uroot%xxxx -c 'getprinter mysmbtstprn 2' localhost \
2125 | grep driver </tt></b>
2126 drivername:[]
2128 <tt class="prompt">root# </tt><b class="userinput"><tt>rpcclient -Uroot%xxxx -c 'getprinter mysmbtstprn 2' localhost \
2129 | grep -C4 driv</tt></b>
2130 servername:[\\kde-bitshop]
2131 printername:[\\kde-bitshop\mysmbtstprn]
2132 sharename:[mysmbtstprn]
2133 portname:[Samba Printer Port]
2134 drivername:[]
2135 comment:[mysmbtstprn]
2136 location:[]
2137 sepfile:[]
2138 printprocessor:[winprint]
2140 <tt class="prompt">root# </tt><b class="userinput"><tt>rpcclient -U root%xxxx -c 'getdriver mysmbtstprn' localhost</tt></b>
2141 result was WERR_UNKNOWN_PRINTER_DRIVER
2143 </pre><p>
2144 None of the three commands shown above should show a driver.
2145 This step was done for the purpose of demonstrating this condition. An
2146 attempt to connect to the printer at this stage will prompt the
2147 message along the lines of: &#8220;<span class="quote">The server does not have the required printer
2148 driver installed.</span>&#8221;
2149 </p></li><li><p class="title"><b>Put all required driver files into Samba's
2150 [print$].</b></p><pre class="screen">
2151 <tt class="prompt">root# </tt><b class="userinput"><tt>smbclient //localhost/print\$ -U 'root%xxxx' \
2152 -c 'cd W32X86; \
2153 put /etc/cups/ppd/mysmbtstprn.ppd mysmbtstprn.PPD; \
2154 put /usr/share/cups/drivers/cupsui.dll cupsui.dll; \
2155 put /usr/share/cups/drivers/cupsdrvr.dll cupsdrvr.dll; \
2156 put /usr/share/cups/drivers/cups.hlp cups.hlp'</tt></b>
2157 </pre><p>
2158 (This command should be entered in one long single
2159 line. Line-breaks and the line-end indicated by &#8220;<span class="quote">\</span>&#8221; have been inserted
2160 for readability reasons.) This step is <span class="emphasis"><em>required</em></span>
2161 for the next one to succeed. It makes the driver files physically
2162 present in the <i class="parameter"><tt>[print$]</tt></i> share. However, clients
2163 would still not be able to install them, because Samba does not yet
2164 treat them as driver files. A client asking for the driver would still
2165 be presented with a &#8220;<span class="quote">not installed here</span>&#8221; message.
2166 </p></li><li><p class="title"><b>Verify where the driver files are now.</b></p><pre class="screen">
2167 <tt class="prompt">root# </tt><b class="userinput"><tt>ls -l /etc/samba/drivers/W32X86/</tt></b>
2168 total 669
2169 drwxr-sr-x 2 root ntadmin 532 May 25 23:08 2
2170 drwxr-sr-x 2 root ntadmin 670 May 16 03:15 3
2171 -rwxr--r-- 1 root ntadmin 14234 May 25 23:21 cups.hlp
2172 -rwxr--r-- 1 root ntadmin 278380 May 25 23:21 cupsdrvr.dll
2173 -rwxr--r-- 1 root ntadmin 215848 May 25 23:21 cupsui.dll
2174 -rwxr--r-- 1 root ntadmin 169458 May 25 23:21 mysmbtstprn.PPD
2175 </pre><p>
2176 The driver files now are in the W32X86 architecture &#8220;<span class="quote">root</span>&#8221; of
2177 <i class="parameter"><tt>[print$]</tt></i>.
2178 </p></li><li><p class="title"><b>Tell Samba that these are driver files (<b class="command">adddriver</b>).</b></p><p>
2179 <a class="indexterm" name="id2942214"></a>
2180 </p><pre class="screen">
2181 <tt class="prompt">root# </tt><b class="userinput"><tt>rpcclient -Uroot%xxxx -c `adddriver "Windows NT x86" \
2182 "mydrivername:cupsdrvr.dll:mysmbtstprn.PPD: \
2183 cupsui.dll:cups.hlp:NULL:RAW:NULL" \
2184 localhost</tt></b>
2185 Printer Driver mydrivername successfully installed.
2186 </pre><p>
2187 You cannot repeat this step if it fails. It could fail even
2188 as a result of a simple typo. It will most likely have moved a part of
2189 the driver files into the &#8220;<span class="quote">2</span>&#8221; subdirectory. If this step fails, you
2190 need to go back to the fourth step and repeat it before you can try
2191 this one again. In this step, you need to choose a name for your
2192 driver. It is normally a good idea to use the same name as is used for
2193 the printer name; however, in big installations you may use this driver
2194 for a number of printers that obviously have different names, so the
2195 name of the driver is not fixed.
2196 </p></li><li><p class="title"><b>Verify where the driver files are now.</b></p><pre class="screen">
2197 <tt class="prompt">root# </tt><b class="userinput"><tt>ls -l /etc/samba/drivers/W32X86/</tt></b>
2198 total 1
2199 drwxr-sr-x 2 root ntadmin 532 May 25 23:22 2
2200 drwxr-sr-x 2 root ntadmin 670 May 16 03:15 3
2202 <tt class="prompt">root# </tt><b class="userinput"><tt>ls -l /etc/samba/drivers/W32X86/2</tt></b>
2203 total 5039
2204 [....]
2205 -rwxr--r-- 1 root ntadmin 14234 May 25 23:21 cups.hlp
2206 -rwxr--r-- 1 root ntadmin 278380 May 13 13:53 cupsdrvr.dll
2207 -rwxr--r-- 1 root ntadmin 215848 May 13 13:53 cupsui.dll
2208 -rwxr--r-- 1 root ntadmin 169458 May 25 23:21 mysmbtstprn.PPD
2209 </pre><p>
2210 Notice how step 6 also moved the driver files to the appropriate
2211 subdirectory. Compare this with the situation after step 5.
2212 </p></li><li><p class="title"><b>(Optional) Verify if Samba now recognizes the driver.</b></p><p>
2213 <a class="indexterm" name="id2942341"></a>
2214 </p><pre class="screen">
2215 <tt class="prompt">root# </tt><b class="userinput"><tt>rpcclient -Uroot%xxxx -c 'enumdrivers 3' \
2216 localhost | grep -B2 -A5 mydrivername</tt></b>
2217 Printer Driver Info 3:
2218 Version: [2]
2219 Driver Name: [mydrivername]
2220 Architecture: [Windows NT x86]
2221 Driver Path: [\\kde-bitshop\print$\W32X86\2\cupsdrvr.dll]
2222 Datafile: [\\kde-bitshop\print$\W32X86\2\mysmbtstprn.PPD]
2223 Configfile: [\\kde-bitshop\print$\W32X86\2\cupsui.dll]
2224 Helpfile: [\\kde-bitshop\print$\W32X86\2\cups.hlp]
2225 </pre><p>
2226 Remember, this command greps for the name you chose for the
2227 driver in step 6. This command must succeed before you can proceed.
2228 </p></li><li><p>Tell Samba which printer should use these driver files (<b class="command">setdriver</b>).</p><p>
2229 <a class="indexterm" name="id2942406"></a>
2230 </p><pre class="screen">
2231 <tt class="prompt">root# </tt><b class="userinput"><tt>rpcclient -Uroot%xxxx -c 'setdriver mysmbtstprn mydrivername' \
2232 localhost</tt></b>
2233 Successfully set mysmbtstprn to driver mydrivername
2234 </pre><p>
2235 Since you can bind any printername (print queue) to any driver, this
2236 is a convenient way to setup many queues that use the same
2237 driver. You do not need to repeat all the previous steps for the
2238 setdriver command to succeed. The only preconditions are:
2239 <b class="command">enumdrivers</b> must find the driver and
2240 <b class="command">enumprinters</b> must find the printer.
2241 </p></li><li><p class="title"><b>(Optional) Verify if Samba has recognized this association.</b></p><p>
2242 <a class="indexterm" name="id2942476"></a>
2243 <a class="indexterm" name="id2942487"></a>
2244 <a class="indexterm" name="id2942498"></a>
2245 </p><pre class="screen">
2246 <tt class="prompt">root# </tt><b class="userinput"><tt>rpcclient -Uroot%xxxx -c 'getprinter mysmbtstprn 2' localhost \
2247 | grep driver</tt></b>
2248 drivername:[mydrivername]
2250 <tt class="prompt">root# </tt><b class="userinput"><tt>rpcclient -Uroot%xxxx -c 'getprinter mysmbtstprn 2' localhost \
2251 | grep -C4 driv</tt></b>
2252 servername:[\\kde-bitshop]
2253 printername:[\\kde-bitshop\mysmbtstprn]
2254 sharename:[mysmbtstprn]
2255 portname:[Done]
2256 drivername:[mydrivername]
2257 comment:[mysmbtstprn]
2258 location:[]
2259 sepfile:[]
2260 printprocessor:[winprint]
2262 <tt class="prompt">root# </tt><b class="userinput"><tt>rpcclient -U root%xxxx -c 'getdriver mysmbtstprn' localhost</tt></b>
2263 [Windows NT x86]
2264 Printer Driver Info 3:
2265 Version: [2]
2266 Driver Name: [mydrivername]
2267 Architecture: [Windows NT x86]
2268 Driver Path: [\\kde-bitshop\print$\W32X86\2\cupsdrvr.dll]
2269 Datafile: [\\kde-bitshop\print$\W32X86\2\mysmbtstprn.PPD]
2270 Configfile: [\\kde-bitshop\print$\W32X86\2\cupsui.dll]
2271 Helpfile: [\\kde-bitshop\print$\W32X86\2\cups.hlp]
2272 Monitorname: []
2273 Defaultdatatype: [RAW]
2274 Monitorname: []
2275 Defaultdatatype: [RAW]
2277 <tt class="prompt">root# </tt><b class="userinput"><tt>rpcclient -Uroot%xxxx -c 'enumprinters' localhost \
2278 | grep mysmbtstprn</tt></b>
2279 name:[\\kde-bitshop\mysmbtstprn]
2280 description:[\\kde-bitshop\mysmbtstprn,mydrivername,mysmbtstprn]
2281 comment:[mysmbtstprn]
2283 </pre><p>
2284 <a class="indexterm" name="id2942589"></a>
2285 Compare these results with the ones from steps 2 and 3. Every one of these commands show the driver is installed. Even
2286 the <b class="command">enumprinters</b> command now lists the driver
2287 on the &#8220;<span class="quote">description</span>&#8221; line.
2288 </p></li><li><p class="title"><b>(Optional) Tickle the driver into a correct
2289 device mode.</b></p><p>
2290 <a class="indexterm" name="id2942629"></a>
2291 You certainly know how to install the driver on the client. In case
2292 you are not particularly familiar with Windows, here is a short
2293 recipe: Browse the Network Neighborhood, go to the Samba server, and look
2294 for the shares. You should see all shared Samba printers.
2295 Double-click on the one in question. The driver should get
2296 installed and the network connection set up. An alternate way is to
2297 open the <span class="guilabel">Printers (and Faxes)</span> folder, right-click on the printer in
2298 question and select <span class="guilabel">Connect</span> or <span class="guilabel">Install</span>. As a result, a new printer
2299 should have appeared in your client's local <span class="guilabel">Printers (and Faxes)</span>
2300 folder, named something like <span class="guilabel">printersharename on Sambahostname</span>.
2301 </p><p>
2302 It is important that you execute this step as a Samba printer admin
2303 (as defined in <tt class="filename">smb.conf</tt>). Here is another method
2304 to do this on Windows XP. It uses a command line, which you may type
2305 into the &#8220;<span class="quote">DOS box</span>&#8221; (type root's smbpassword when prompted):
2306 </p><pre class="screen">
2307 <tt class="prompt">C:\&gt; </tt><b class="userinput"><tt>runas /netonly /user:root "rundll32 printui.dll,PrintUIEntry \
2308 /in /n \\sambaserver\mysmbtstprn"</tt></b>
2309 </pre><p>
2310 Change any printer setting once (like changing <span class="emphasis"><em><span class="guilabel">portrait</span> to
2311 <span class="guilabel">landscape</span></em></span>), click on <span class="guibutton">Apply</span>; change the setting
2312 back.
2313 </p></li><li><p class="title"><b>Install the printer on a client
2314 (Point'n'Print).</b></p><p>
2315 <a class="indexterm" name="id2942767"></a>
2316 </p><pre class="screen">
2317 <tt class="prompt">C:\&gt; </tt><b class="userinput"><tt>rundll32 printui.dll,PrintUIEntry /in /n &#8220;<span class="quote">\\sambaserver\mysmbtstprn</span>&#8221;</tt></b>
2318 </pre><p>
2319 If it does not work it could be a permission problem with the
2320 <i class="parameter"><tt>[print$]</tt></i> share.
2321 </p></li><li><p class="title"><b>(Optional) Print a test page.</b></p><pre class="screen">
2322 <tt class="prompt">C:\&gt; </tt><b class="userinput"><tt>rundll32 printui.dll,PrintUIEntry /p /n "\\sambaserver\mysmbtstprn"</tt></b>
2323 </pre><p>
2324 Then hit [TAB] five times, [ENTER] twice, [TAB] once and [ENTER] again
2325 and march to the printer.
2326 </p></li><li><p class="title"><b>(Recommended) Study the test page.</b></p><p>
2327 Hmmm.... just kidding! By now you know everything about printer
2328 installations and you do not need to read a word. Just put it in a
2329 frame and bolt it to the wall with the heading "MY FIRST
2330 RPCCLIENT-INSTALLED PRINTER" why not just throw it away!
2331 </p></li><li><p class="title"><b>(Obligatory) Enjoy. Jump. Celebrate your
2332 success.</b></p><pre class="screen">
2333 <tt class="prompt">root# </tt><b class="userinput"><tt>echo "Cheeeeerioooooo! Success..." &gt;&gt; /var/log/samba/log.smbd</tt></b>
2334 </pre></li></ol></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2942909"></a>Troubleshooting Revisited</h3></div></div><div></div></div><p>
2335 The setdriver command will fail, if in Samba's mind the queue is not
2336 already there. You had promising messages about the:
2337 </p><pre class="screen">
2338 Printer Driver ABC successfully installed.
2339 </pre><p>
2340 after the <b class="command">adddriver</b> parts of the procedure? But you are also seeing
2341 a disappointing message like this one?
2342 </p><p><tt class="computeroutput">
2343 result was NT_STATUS_UNSUCCESSFUL
2344 </tt></p><p>
2345 <a class="indexterm" name="id2942956"></a>
2346 It is not good enough that you
2347 can see the queue in CUPS, using
2348 the <b class="command">lpstat -p ir85wm</b> command. A
2349 bug in most recent versions of Samba prevents the proper update of
2350 the queuelist. The recognition of newly installed CUPS printers
2351 fails unless you restart Samba or send a HUP to all smbd
2352 processes. To verify if this is the reason why Samba does not
2353 execute the <b class="command">setdriver</b> command successfully, check if Samba &#8220;<span class="quote">sees</span>&#8221;
2354 the printer:
2355 </p><p>
2356 <a class="indexterm" name="id2942993"></a>
2357 </p><pre class="screen">
2358 <tt class="prompt">root# </tt><b class="userinput"><tt>rpcclient transmeta -N -U'root%xxxx' -c 'enumprinters 0'|grep ir85wm</tt></b>
2359 printername:[ir85wm]
2360 </pre><p>
2361 An alternate command could be this:
2362 </p><p>
2363 <a class="indexterm" name="id2943033"></a>
2364 </p><pre class="screen">
2365 <tt class="prompt">root# </tt><b class="userinput"><tt>rpcclient transmeta -N -U'root%secret' -c 'getprinter ir85wm' </tt></b>
2366 cmd = getprinter ir85wm
2367 flags:[0x800000]
2368 name:[\\transmeta\ir85wm]
2369 description:[\\transmeta\ir85wm,ir85wm,DPD]
2370 comment:[CUPS PostScript-Treiber for Windows NT/200x/XP]
2371 </pre><p>
2372 By the way, you can use these commands, plus a few more, of course,
2373 to install drivers on remote Windows NT print servers too!
2374 </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2943077"></a>The Printing <tt class="filename">*.tdb</tt> Files</h2></div></div><div></div></div><p>
2375 <a class="indexterm" name="id2943094"></a>
2376 <a class="indexterm" name="id2943102"></a>
2377 <a class="indexterm" name="id2943113"></a>
2378 <a class="indexterm" name="id2943124"></a>
2379 <a class="indexterm" name="id2943136"></a>
2380 <a class="indexterm" name="id2943147"></a>
2381 <a class="indexterm" name="id2943158"></a>
2382 <a class="indexterm" name="id2943169"></a>
2383 <a class="indexterm" name="id2943180"></a>
2384 <a class="indexterm" name="id2943191"></a>
2385 <a class="indexterm" name="id2943202"></a>
2386 <a class="indexterm" name="id2943214"></a>
2387 <a class="indexterm" name="id2943225"></a>
2388 Some mystery is associated with the series of files with a
2389 tdb suffix appearing in every Samba installation. They are
2390 <tt class="filename">connections.tdb</tt>,
2391 <tt class="filename">printing.tdb</tt>,
2392 <tt class="filename">share_info.tdb</tt>,
2393 <tt class="filename">ntdrivers.tdb</tt>,
2394 <tt class="filename">unexpected.tdb</tt>,
2395 <tt class="filename">brlock.tdb</tt>,
2396 <tt class="filename">locking.tdb</tt>,
2397 <tt class="filename">ntforms.tdb</tt>,
2398 <tt class="filename">messages.tdb</tt> ,
2399 <tt class="filename">ntprinters.tdb</tt>,
2400 <tt class="filename">sessionid.tdb</tt> and
2401 <tt class="filename">secrets.tdb</tt>. What is their purpose?
2402 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2943322"></a>Trivial Database Files</h3></div></div><div></div></div><p>
2403 <a class="indexterm" name="id2943333"></a>
2404 A Windows NT (print) server keeps track of all information needed to serve
2405 its duty toward its clients by storing entries in the Windows
2406 registry. Client queries are answered by reading from the registry,
2407 Administrator or user configuration settings that are saved by writing into
2408 the registry. Samba and UNIX obviously do not have such a
2409 Registry. Samba instead keeps track of all client related information in a
2410 series of <tt class="filename">*.tdb</tt> files. (TDB = Trivial Data
2411 Base). These are often located in <tt class="filename">/var/lib/samba/</tt>
2412 or <tt class="filename">/var/lock/samba/</tt>. The printing related files
2413 are <tt class="filename">ntprinters.tdb</tt>,
2414 <tt class="filename">printing.tdb</tt>,<tt class="filename">ntforms.tdb</tt> and
2415 <tt class="filename">ntdrivers.tdb</tt>.
2416 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2943400"></a>Binary Format</h3></div></div><div></div></div><p>
2417 <tt class="filename">*.tdb</tt> files are not human readable. They are
2418 written in a binary format. &#8220;<span class="quote">Why not ASCII?</span>&#8221;, you may ask. &#8220;<span class="quote">After all,
2419 ASCII configuration files are a good and proven tradition on UNIX.</span>&#8221;
2420 The reason for this design decision by the Samba team is mainly
2421 performance. Samba needs to be fast; it runs a separate
2422 <b class="command">smbd</b> process for each client connection, in some
2423 environments many thousands of them. Some of these smbds might need to
2424 write-access the same <tt class="filename">*.tdb</tt> file <span class="emphasis"><em>at the
2425 same time</em></span>. The file format of Samba's
2426 <tt class="filename">*.tdb</tt> files allows for this provision. Many smbd
2427 processes may write to the same <tt class="filename">*.tdb</tt> file at the
2428 same time. This wouldn't be possible with pure ASCII files.
2429 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2943470"></a>Losing <tt class="filename">*.tdb</tt> Files</h3></div></div><div></div></div><p>
2430 It is very important that all <tt class="filename">*.tdb</tt> files remain
2431 consistent over all write and read accesses. However, it may happen
2432 that these files <span class="emphasis"><em>do</em></span> get corrupted. (A
2433 <b class="command">kill -9 `pidof smbd'</b> while a write access is in
2434 progress could do the damage as well as a power interruption,
2435 etc.). In cases of trouble, a deletion of the old printing-related
2436 <tt class="filename">*.tdb</tt> files may be the only option. After that you need to
2437 re-create all print-related setup or you have made a
2438 backup of the <tt class="filename">*.tdb</tt> files in time.
2439 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2943528"></a>Using <b class="command">tdbbackup</b></h3></div></div><div></div></div><p>
2440 <a class="indexterm" name="id2943544"></a>
2441 <a class="indexterm" name="id2943558"></a>
2442 Samba ships with a little utility that helps the root user of your
2443 system to backup your <tt class="filename">*.tdb</tt> files. If you run it
2444 with no argument, it prints a usage message:
2445 </p><pre class="screen">
2446 <tt class="prompt">root# </tt><b class="userinput"><tt>tdbbackup</tt></b>
2447 Usage: tdbbackup [options] &lt;fname...&gt;
2449 Version:3.0a
2450 -h this help message
2451 -s suffix set the backup suffix
2452 -v verify mode (restore if corrupt)
2454 </pre><p>
2455 Here is how I backed up my <tt class="filename">printing.tdb</tt> file:
2456 </p><pre class="screen">
2457 <tt class="prompt">root# </tt><b class="userinput"><tt>ls</tt></b>
2458 . browse.dat locking.tdb ntdrivers.tdb printing.tdb
2459 .. share_info.tdb connections.tdb messages.tdb ntforms.tdb
2460 printing.tdbkp unexpected.tdb brlock.tdb gmon.out namelist.debug
2461 ntprinters.tdb sessionid.tdb
2463 <tt class="prompt">root# </tt><b class="userinput"><tt>tdbbackup -s .bak printing.tdb</tt></b>
2464 printing.tdb : 135 records
2466 <tt class="prompt">root# </tt><b class="userinput"><tt>ls -l printing.tdb*</tt></b>
2467 -rw------- 1 root root 40960 May 2 03:44 printing.tdb
2468 -rw------- 1 root root 40960 May 2 03:44 printing.tdb.bak
2470 </pre></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2943673"></a>CUPS Print Drivers from Linuxprinting.org</h2></div></div><div></div></div><p>
2471 <a class="indexterm" name="id2943683"></a>
2472 CUPS ships with good support for HP LaserJet-type printers. You can
2473 install the generic driver as follows:
2474 </p><p>
2475 <a class="indexterm" name="id2943698"></a>
2476 </p><pre class="screen">
2477 <tt class="prompt">root# </tt><b class="userinput"><tt>lpadmin -p laserjet4plus -v parallel:/dev/lp0 -E -m laserjet.ppd</tt></b>
2478 </pre><p>
2479 The <tt class="option">-m</tt> switch will retrieve the
2480 <tt class="filename">laserjet.ppd</tt> from the standard repository for
2481 not-yet-installed-PPDs, which CUPS typically stores in
2482 <tt class="filename">/usr/share/cups/model</tt>. Alternately, you may use
2483 <tt class="option">-P /path/to/your.ppd</tt>.
2484 </p><p>
2485 The generic <tt class="filename">laserjet.ppd,</tt> however, does not support every special option
2486 for every LaserJet-compatible model. It constitutes a sort of &#8220;<span class="quote">least common
2487 denominator</span>&#8221; of all the models. If for some reason
2488 you must pay for the commercially available ESP Print Pro drivers, your
2489 first move should be to consult the database on <ulink url="http://www.linuxprinting.org/printer_list.cgi">http://www.linuxprinting.org/printer_list.cgi</ulink>.
2490 Linuxprinting.org has excellent recommendations about which driver is
2491 best used for each printer. Its database is kept current by the
2492 tireless work of Till Kamppeter from MandrakeSoft, who is also the
2493 principal author of the <b class="command">foomatic-rip</b> utility.
2494 </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
2495 <a class="indexterm" name="id2943800"></a>
2496 The former <b class="command">cupsomatic</b> concept is now being replaced by the new
2497 successor, a much
2498 more powerful <b class="command">foomatic-rip</b>.
2499 <b class="command">cupsomatic</b> is no longer maintained. Here is the new URL
2500 to the Foomatic-3.0 database: <ulink url="http://www.linuxprinting.org/driver_list.cgi">http://www.linuxprinting.org/driver_list.cgi</ulink>.
2501 If you upgrade to <b class="command">foomatic-rip</b>, remember to also upgrade to the
2502 new-style PPDs for your Foomatic-driven printers. foomatic-rip will
2503 not work with PPDs generated for the old <b class="command">cupsomatic</b>. The new-style
2504 PPDs are 100% compliant to the Adobe PPD specification. They are
2505 also intended to be used by Samba and the cupsaddsmb utility, to
2506 provide the driver files for the Windows clients!
2507 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2943860"></a>foomatic-rip and Foomatic Explained</h3></div></div><div></div></div><p>
2508 <a class="indexterm" name="id2943871"></a>
2509 <a class="indexterm" name="id2943880"></a>
2510 Nowadays, most Linux distributions rely on the utilities of Linuxprinting.org
2511 to create their printing-related software (which, by the way, works on all
2512 UNIXes and on Mac OS X or Darwin, too). It is not known as well as it
2513 should be, that it also has a very end-user-friendly interface that
2514 allows for an easy update of drivers and PPDs for all supported
2515 models, all spoolers, all operating systems, and all package formats
2516 (because there is none). Its history goes back a few years.
2517 </p><p>
2518 Recently, Foomatic has achieved the astonishing milestone of <ulink url="http://www.linuxprinting.org/printer_list.cgi?make=Anyone">1000
2519 listed</ulink> printer models. Linuxprinting.org keeps all the
2520 important facts about printer drivers, supported models and which
2521 options are available for the various driver/printer combinations in
2522 its <ulink url="http://www.linuxprinting.org/foomatic.html">Foomatic</ulink>
2523 database. Currently there are <ulink url="http://www.linuxprinting.org/driver_list.cgi">245 drivers</ulink>
2524 in the database. Many drivers support various models, and many models
2525 may be driven by different drivers its your choice!
2526 </p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2943935"></a>690 &#8220;<span class="quote">Perfect</span>&#8221; Printers</h4></div></div><div></div></div><p>
2527 At present, there are 690 devices dubbed as working perfectly, 181
2528 mostly, 96 partially, and 46 are paperweights. Keeping in mind
2529 that most of these are non-PostScript models (PostScript printers are
2530 automatically supported by CUPS to perfection, by using
2531 their own manufacturer-provided Windows-PPD), and that a
2532 multifunctional device never qualifies as working perfectly if it
2533 does not also scan and copy and fax under GNU/Linux then this is a
2534 truly astonishing achievement! Three years ago the number was not
2535 more than 500, and Linux or UNIX printing at the time wasn't
2536 anywhere near the quality it is today.
2537 </p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2943975"></a>How the Printing HOWTO Started It All</h4></div></div><div></div></div><p>
2538 A few years ago <ulink url="http://www2.picante.com:81/~gtaylor/">Grant Taylor</ulink>
2539 started it all. The roots of today's Linuxprinting.org are in the
2540 first <ulink url="http://www.linuxprinting.org/foomatic2.9/howto/">Linux Printing
2541 HOWTO</ulink> that he authored. As a side-project to this document,
2542 which served many Linux users and admins to guide their first steps in
2543 this complicated and delicate setup (to a scientist, printing is
2544 &#8220;<span class="quote">applying a structured deposition of distinct patterns of ink or toner
2545 particles on paper substrates</span>&#8221;, he started to
2546 build in a little Postgres database with information about the
2547 hardware and driver zoo that made up Linux printing of the time. This
2548 database became the core component of today's Foomatic collection of
2549 tools and data. In the meantime, it has moved to an XML representation
2550 of the data.
2551 </p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2944020"></a>Foomatic's Strange Name</h4></div></div><div></div></div><p>
2552 <a class="indexterm" name="id2944031"></a>
2553 &#8220;<span class="quote">Why the funny name?</span>&#8221; you ask. When it really took off, around spring
2554 2000, CUPS was far less popular than today, and most systems used LPD,
2555 LPRng or even PDQ to print. CUPS shipped with a few generic drivers
2556 (good for a few hundred different printer models). These didn't
2557 support many device-specific options. CUPS also shipped with its own
2558 built-in rasterization filter (<i class="parameter"><tt>pstoraster</tt></i>, derived from
2559 Ghostscript). On the other hand, CUPS provided brilliant support for
2560 <span class="emphasis"><em>controlling</em></span> all printer options through
2561 standardized and well-defined PPD files (PostScript Printers
2562 Description files). Plus, CUPS was designed to be easily extensible.
2563 </p><p>
2564 Taylor already had in his database a respectable compilation
2565 of facts about many more printers and the Ghostscript &#8220;<span class="quote">drivers</span>&#8221;
2566 they run with. His idea, to generate PPDs from the database information
2567 and use them to make standard Ghostscript filters work within CUPS,
2568 proved to work very well. It also killed several birds with one
2569 stone:
2570 </p><div class="itemizedlist"><ul type="disc"><li><p>It made all current and future Ghostscript filter
2571 developments available for CUPS.</p></li><li><p>It made available a lot of additional printer models
2572 to CUPS users (because often the traditional Ghostscript way of
2573 printing was the only one available).</p></li><li><p>It gave all the advanced CUPS options (Web interface,
2574 GUI driver configurations) to users wanting (or needing) to use
2575 Ghostscript filters.</p></li></ul></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2944109"></a>cupsomatic, pdqomatic, lpdomatic, directomatic</h4></div></div><div></div></div><p>
2576 <a class="indexterm" name="id2944121"></a>
2577 <a class="indexterm" name="id2944129"></a>
2578 <a class="indexterm" name="id2944137"></a>
2579 CUPS worked through a quickly-hacked up filter script named <ulink url="http://www.linuxprinting.org/download.cgi?filename=cupsomatic&amp;show=0">cupsomatic.</ulink>
2580 cupsomatic ran the printfile through Ghostscript, constructing
2581 automatically the rather complicated command line needed. It just
2582 needed to be copied into the CUPS system to make it work. To
2583 configure the way cupsomatic controls the Ghostscript rendering
2584 process, it needs a CUPS-PPD. This PPD is generated directly from the
2585 contents of the database. For CUPS and the respective printer/filter
2586 combo, another Perl script named CUPS-O-Matic did the PPD
2587 generation. After that was working, Taylor implemented within a few
2588 days a similar thing for two other spoolers. Names chosen for the
2589 config-generator scripts were <ulink url="http://www.linuxprinting.org/download.cgi?filename=lpdomatic&amp;show=0">PDQ-O-Matic</ulink>
2590 (for PDQ) and <ulink url="http://www.linuxprinting.org/download.cgi?filename=lpdomatic&amp;show=0">LPD-O-Matic</ulink>
2591 (for you guessed it LPD); the configuration here didn't use PPDs
2592 but other spooler-specific files.
2593 </p><p>
2594 From late summer of that year, <ulink url="http://www.linuxprinting.org/till/">Till Kamppeter</ulink>
2595 started to put work into the database. Kamppeter had been newly employed by
2596 <ulink url="http://www.mandrakesoft.com/">MandrakeSoft</ulink> to
2597 convert its printing system over to CUPS, after they had seen his
2598 <ulink url="http://www.fltk.org/">FLTK</ulink>-based <ulink url="http://cups.sourceforge.net/xpp/">XPP</ulink> (a GUI frontend to
2599 the CUPS lp-command). He added a huge amount of new information and new
2600 printers. He also developed the support for other spoolers, like
2601 <ulink url="http://ppr.sourceforge.net/">PPR</ulink> (via ppromatic),
2602 <ulink url="http://sourceforge.net/projects/lpr/">GNUlpr</ulink> and
2603 <ulink url="http://www.lprng.org/">LPRng</ulink> (both via an extended
2604 lpdomatic) and spoolerless printing (<ulink url="http://www.linuxprinting.org/download.cgi?filename=directomatic&amp;show=0">directomatic</ulink>).
2605 </p><p>
2606 So, to answer your question: &#8220;<span class="quote">Foomatic</span>&#8221; is the general name for all
2607 the overlapping code and data behind the &#8220;<span class="quote">*omatic</span>&#8221; scripts.
2608 Foomatic, up to versions 2.0.x, required (ugly) Perl data structures
2609 attached to Linuxprinting.org PPDs for CUPS. It had a different
2610 &#8220;<span class="quote">*omatic</span>&#8221; script for every spooler, as well as different printer
2611 configuration files.
2612 </p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2944302"></a>The <span class="emphasis"><em>Grand Unification</em></span> Achieved</h4></div></div><div></div></div><p>
2613 <a class="indexterm" name="id2944318"></a>
2614 This has all changed in Foomatic versions 2.9 (beta) and released as
2615 &#8220;<span class="quote">stable</span>&#8221; 3.0. It has now achieved the convergence of all *omatic
2616 scripts and is called the <ulink url="http://www.linuxprinting.org/foomatic2.9/download.cgi?filename=foomatic-rip&amp;show=0">foomatic-rip.</ulink>
2617 This single script is the unification of the previously different
2618 spooler-specific *omatic scripts. foomatic-rip is used by all the
2619 different spoolers alike and because it can read PPDs (both the
2620 original PostScript printer PPDs and the Linuxprinting.org-generated
2621 ones), all of a sudden all supported spoolers can have the power of
2622 PPDs at their disposal. Users only need to plug foomatic-rip into
2623 their system. For users there is improved media type and source
2624 support paper sizes and trays are easier to configure.
2625 </p><p>
2626 Also, the New Generation of Linuxprinting.org PPDs no longer contains
2627 Perl data structures. If you are a distro maintainer and have
2628 used the previous version of Foomatic, you may want to give the new
2629 one a spin, but remember to generate a new-version set of PPDs
2630 via the new <ulink url="http://www.linuxprinting.org/download/foomatic/foomatic-db-engine-3.0.0beta1.tar.gz">foomatic-db-engine!</ulink>
2631 Individual users just need to generate a single new PPD specific to
2632 their model by <ulink url="http://www.linuxprinting.org/kpfeifle/LinuxKongress2002/Tutorial/II.Foomatic-User/II.tutorial-handout-foomatic-user.html">following
2633 the steps</ulink> outlined in the Foomatic tutorial or in this chapter. This new development is truly amazing.
2634 </p><p>
2635 foomatic-rip is a very clever wrapper around the need to run
2636 Ghostscript with a different syntax, options, device selections, and/or filters for each different printer
2637 or spooler. At the same time it can read the PPD associated
2638 with a print queue and modify the print job according to the user
2639 selections. Together with this comes the 100% compliance of the new
2640 Foomatic PPDs with the Adobe spec. Some innovative features of
2641 the Foomatic concept may surprise users. It will support custom paper
2642 sizes for many printers and will support printing on media drawn
2643 from different paper trays within the same job (in both cases, even
2644 where there is no support for this from Windows-based vendor printer
2645 drivers).
2646 </p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2944417"></a>Driver Development Outside</h4></div></div><div></div></div><p>
2647 Most driver development itself does not happen within
2648 Linuxprinting.org. Drivers are written by independent maintainers.
2649 Linuxprinting.org just pools all the information and stores it in its
2650 database. In addition, it also provides the Foomatic glue to integrate
2651 the many drivers into any modern (or legacy) printing system known to
2652 the world.
2653 </p><p>
2654 Speaking of the different driver development groups, most of
2655 the work is currently done in three projects. These are:
2656 </p><div class="itemizedlist"><ul type="disc"><li><p><ulink url="http://www-124.ibm.com/developerworks/oss/linux/projects/omni/">Omni</ulink>
2657 a free software project by IBM that tries to convert their printer
2658 driver knowledge from good-ol' OS/2 times into a modern, modular,
2659 universal driver architecture for Linux/UNIX (still beta). This
2660 currently supports 437 models.</p></li><li><p><ulink url="http://hpinkjet.sf.net/">HPIJS</ulink>
2661 a free software project by HP to provide the support for their own
2662 range of models (very mature, printing in most cases is perfect and
2663 provides true photo quality). This currently supports 369
2664 models.</p></li><li><p><ulink url="http://gimp-print.sf.net/">Gimp-Print</ulink> a free software
2665 effort, started by Michael Sweet (also lead developer for CUPS), now
2666 directed by Robert Krawitz, which has achieved an amazing level of
2667 photo print quality (many Epson users swear that its quality is
2668 better than the vendor drivers provided by Epson for the Microsoft
2669 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="id2944507"></a>Forums, Downloads, Tutorials, Howtos also for Mac OS X and Commercial UNIX</h4></div></div><div></div></div><p>
2670 Linuxprinting.org today is the one-stop shop to download printer
2671 drivers. Look for printer information and <ulink url="http://www.linuxprinting.org//kpfeifle/LinuxKongress2002/Tutorial/">tutorials</ulink>
2672 or solve printing problems in its popular <ulink url="http://www.linuxprinting.org/newsportal/">forums.</ulink> This forum
2673 it's not just for GNU/Linux users, but admins of <ulink url="http://www.linuxprinting.org/macosx/">commercial UNIX
2674 systems</ulink> are also going there, and the relatively new <ulink url="http://www.linuxprinting.org/newsportal/thread.php3?name=linuxprinting.macosx.general">Mac
2675 OS X forum</ulink> has turned out to be one of the most frequented
2676 forums after only a few weeks.
2677 </p><p>
2678 Linuxprinting.org and the Foomatic driver wrappers around Ghostscript
2679 are now a standard toolchain for printing on all the important
2680 distros. Most of them also have CUPS underneath. While in recent years
2681 most printer data had been added by Kamppeter (who works at Mandrake), many
2682 additional contributions came from engineers with SuSE, RedHat,
2683 Connectiva, Debian, and others. Vendor-neutrality is an important goal
2684 of the Foomatic project.
2685 </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
2686 Till Kamppeter from MandrakeSoft is doing an excellent job in his
2687 spare time to maintain Linuxprinting.org and Foomatic. So if you use
2688 it often, please send him a note showing your appreciation.
2689 </p></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2944580"></a>Foomatic Database-Generated PPDs</h4></div></div><div></div></div><p>
2690 The Foomatic database is an amazing piece of ingenuity in itself. Not
2691 only does it keep the printer and driver information, but it is
2692 organized in a way that it can generate PPD files on the fly from
2693 its internal XML-based datasets. While these PPDs are modelled to the
2694 Adobe specification of PostScript Printer Descriptions (PPDs), the
2695 Linuxprinting.org/Foomatic-PPDs do not normally drive PostScript
2696 printers. They are used to describe all the bells and whistles you
2697 could ring or blow on an Epson Stylus inkjet, or a HP Photosmart, or
2698 what-have-you. The main trick is one little additional line, not
2699 envisaged by the PPD specification, starting with the <i class="parameter"><tt>*cupsFilter</tt></i>
2700 keyword. It tells the CUPS daemon how to proceed with the PostScript
2701 print file (old-style Foomatic-PPDs named the
2702 cupsomatic filter script, while the new-style
2703 PPDs are now call foomatic-rip). This filter
2704 script calls Ghostscript on the host system (the recommended variant
2705 is ESP Ghostscript) to do the rendering work. foomatic-rip knows which
2706 filter or internal device setting it should ask from Ghostscript to
2707 convert the PostScript printjob into a raster format ready for the
2708 target device. This usage of PPDs to describe the options of non-PS
2709 printers was the invention of the CUPS developers. The rest is easy.
2710 GUI tools (like KDE's marvelous <ulink url="http://printing.kde.org/overview/kprinter.phtml">kprinter,</ulink>
2711 or the GNOME <ulink url="http://gtklp.sourceforge.net/">gtklp,</ulink> xpp and the CUPS
2712 Web interface) read the PPD as well and use this information to present
2713 the available settings to the user as an intuitive menu selection.
2714 </p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2944657"></a>foomatic-rip and Foomatic-PPD Download and Installation</h3></div></div><div></div></div><p>
2715 Here are the steps to install a foomatic-rip driven LaserJet 4 Plus-compatible
2716 printer in CUPS (note that recent distributions of SuSE, UnitedLinux and
2717 Mandrake may ship with a complete package of Foomatic-PPDs plus the
2718 <b class="command">foomatic-rip</b> utility. Going directly to
2719 Linuxprinting.org ensures that you get the latest driver/PPD files):
2720 </p><div class="itemizedlist"><ul type="disc"><li><p>Open your browser at the Linuxprinting.org printer list<ulink url="http://www.linuxprinting.org/printer_list.cgi">page.</ulink>
2721 </p></li><li><p>Check the complete list of printers in the
2722 <ulink url="http://www.linuxprinting.org/printer_list.cgi?make=Anyone">database.</ulink>.
2723 </p></li><li><p>Select your model and click on the link.
2724 </p></li><li><p>You'll arrive at a page listing all drivers working with this
2725 model (for all printers, there will always be <span class="emphasis"><em>one</em></span>
2726 recommended driver. Try this one first).
2727 </p></li><li><p>In our case (HP LaserJet 4 Plus), we'll arrive at the default driver for the
2728 <ulink url="http://www.linuxprinting.org/show_printer.cgi?recnum=HP-LaserJet_4_Plus">HP-LaserJet 4 Plus.</ulink>
2729 </p></li><li><p>The recommended driver is ljet4.</p></li><li><p>Several links are provided here. You should visit them all if you
2730 are not familiar with the Linuxprinting.org database.
2731 </p></li><li><p>There is a link to the database page for the
2732 <ulink url="http://www.linuxprinting.org/show_driver.cgi?driver=ljet4">ljet4.</ulink>
2733 On the driver's page, you'll find important and detailed information
2734 about how to use that driver within the various available
2735 spoolers.</p></li><li><p>Another link may lead you to the homepage of the
2736 driver author or the driver.</p></li><li><p>Important links are the ones that provide hints with
2737 setup instructions for <ulink url="http://www.linuxprinting.org/cups-doc.html">CUPS</ulink>,
2738 <ulink url="http://www.linuxprinting.org/pdq-doc.html">PDQ</ulink>,
2739 <ulink url="http://www.linuxprinting.org/lpd-doc.html">LPD, LPRng and GNUlpr</ulink>)
2740 as well as <ulink url="http://www.linuxprinting.org/ppr-doc.html">PPR</ulink>
2741 or &#8220;<span class="quote">spooler-less</span>&#8221; <ulink url="http://www.linuxprinting.org/direct-doc.html">printing.</ulink>
2742 </p></li><li><p>You can view the PPD in your browser through this link:
2743 <ulink url="http://www.linuxprinting.org/ppd-o-matic.cgi?driver=ljet4&amp;printer=HP-LaserJet_4_Plus&amp;show=1">http://www.linuxprinting.org/ppd-o-matic.cgi?driver=ljet4&amp;printer=HP-LaserJet_4_Plus&amp;show=1</ulink>
2744 </p></li><li><p>Most importantly, you can also generate and download
2745 the <ulink url="http://www.linuxprinting.org/ppd-o-matic.cgi?driver=ljet4&amp;printer=HP-LaserJet_4_Plus&amp;show=0">PPD.</ulink>
2746 </p></li><li><p>The PPD contains all the information needed to use our
2747 model and the driver; once installed, this works transparently
2748 for the user. Later you'll only need to choose resolution, paper size,
2749 and so on from the Web-based menu, or from the print dialog GUI, or from
2750 the command line.</p></li><li><p>If you ended up on the drivers
2751 <ulink url="http://www.linuxprinting.org/show_driver.cgi?driver=ljet4">page</ulink>
2752 you can choose to use the &#8220;<span class="quote">PPD-O-Matic</span>&#8221; online PPD generator
2753 program.</p></li><li><p>Select the exact model and check either <span class="guilabel">Download</span> or
2754 <span class="guilabel">Display PPD file</span> and click <span class="guilabel">Generate PPD file</span>.</p></li><li><p>If you save the PPD file from the browser view, please
2755 do not use cut and paste (since it could possibly damage line endings
2756 and tabs, which makes the PPD likely to fail its duty), but use <span class="guimenuitem">Save
2757 as...</span> in your browser's menu. (It is best to use the <span class="guilabel">Download</span> option
2758 directly from the Web page).</p></li><li><p>Another interesting part on each driver page is
2759 the <span class="guimenuitem">Show execution details</span> button. If you
2760 select your printer model and click on that button,
2761 a complete Ghostscript command line will be displayed, enumerating all options
2762 available for that combination of driver and printer model. This is a great way to
2763 &#8220;<span class="quote">learn Ghostscript by doing</span>&#8221;. It is also an excellent cheat sheet
2764 for all experienced users who need to re-construct a good command line
2765 for that damn printing script, but can't remember the exact
2766 syntax. </p></li><li><p>Some time during your visit to Linuxprinting.org, save
2767 the PPD to a suitable place on your harddisk, say
2768 <tt class="filename">/path/to/my-printer.ppd</tt> (if you prefer to install
2769 your printers with the help of the CUPS Web interface, save the PPD to
2770 the <tt class="filename">/usr/share/cups/model/</tt> path and restart
2771 cupsd).</p></li><li><p>Then install the printer with a suitable command line,
2772 like this:
2773 </p><pre class="screen">
2774 <tt class="prompt">root# </tt><b class="userinput"><tt>lpadmin -p laserjet4plus -v parallel:/dev/lp0 -E \
2775 -P path/to/my-printer.ppd</tt></b>
2776 </pre></li><li><p>For all the new-style &#8220;<span class="quote">Foomatic-PPDs</span>&#8221;
2777 from Linuxprinting.org, you also need a special CUPS filter named
2778 foomatic-rip.
2779 </p></li><li><p>The foomatic-rip Perlscript itself also makes some
2780 interesting <ulink url="http://www.linuxprinting.org/foomatic2.9/download.cgi?filename=foomatic-rip&amp;show=1">reading</ulink>
2781 because it is well documented by Kamppeter's inline comments (even
2782 non-Perl hackers will learn quite a bit about printing by reading
2783 it).</p></li><li><p>Save foomatic-rip either directly in
2784 <tt class="filename">/usr/lib/cups/filter/foomatic-rip</tt> or somewhere in
2785 your $PATH (and remember to make it world-executable). Again,
2786 do not save by copy and paste but use the appropriate link or the
2787 <span class="guimenuitem">Save as...</span> menu item in your browser.</p></li><li><p>If you save foomatic-rip in your $PATH, create a symlink:
2788 </p><pre class="screen">
2789 <tt class="prompt">root# </tt><b class="userinput"><tt>cd /usr/lib/cups/filter/ ; ln -s `which foomatic-rip'</tt></b>
2790 </pre><p>
2791 </p><p>
2792 CUPS will discover this new available filter at startup after restarting
2793 cupsd.</p></li></ul></div><p>
2794 Once you print to a print queue set up with the Foomatic-PPD, CUPS will
2795 insert the appropriate commands and comments into the resulting
2796 PostScript jobfile. foomatic-rip is able to read and act upon
2797 these and uses some specially encoded Foomatic comments
2798 embedded in the jobfile. These in turn are used to construct
2799 (transparently for you, the user) the complicated Ghostscript command
2800 line telling the printer driver exactly how the resulting raster
2801 data should look and which printer commands to embed into the
2802 data stream. You need:
2803 </p><div class="itemizedlist"><ul type="disc"><li><p>A &#8220;<span class="quote">foomatic+something</span>&#8221; PPD but this is not enough
2804 to print with CUPS (it is only <span class="emphasis"><em>one</em></span> important
2805 component).</p></li><li><p>The <i class="parameter"><tt>foomatic-rip</tt></i> filter script (Perl) in
2806 <tt class="filename">/usr/lib/cups/filters/</tt>.</p></li><li><p>Perl to make foomatic-rip run.</p></li><li><p>Ghostscript (because it is doing the main work,
2807 controlled by the PPD/foomatic-rip combo) to produce the raster data
2808 fit for your printer model's consumption.</p></li><li><p>Ghostscript <span class="emphasis"><em>must</em></span> (depending on
2809 the driver/model) contain support for a certain device representing
2810 the selected driver for your model (as shown by <b class="command">gs
2811 -h</b>).</p></li><li><p>foomatic-rip needs a new version of PPDs (PPD versions
2812 produced for cupsomatic do not work with
2813 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="id2945207"></a>Page Accounting with CUPS</h2></div></div><div></div></div><p>
2814 <a class="indexterm" name="id2945218"></a>
2815 Often there are questions regarding print quotas where Samba users
2816 (that is, Windows clients) should not be able to print beyond a
2817 certain number of pages or data volume per day, week or month. This
2818 feature is dependent on the real print subsystem you're using.
2819 Samba's part is always to receive the job files from the clients
2820 (filtered <span class="emphasis"><em>or</em></span> unfiltered) and hand it over to this
2821 printing subsystem.
2822 </p><p>
2823 Of course one could hack things with one's own scripts. But then
2824 there is CUPS. CUPS supports quotas that can be based on the size of
2825 jobs or on the number of pages or both, and span any time
2826 period you want.
2827 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2945248"></a>Setting Up Quotas</h3></div></div><div></div></div><p>
2828 <a class="indexterm" name="id2945260"></a>
2829 This is an example command of how root would set a print quota in CUPS,
2830 assuming an existing printer named &#8220;<span class="quote">quotaprinter</span>&#8221;:
2831 </p><p>
2832 <a class="indexterm" name="id2945281"></a>
2833 </p><pre class="screen">
2834 <tt class="prompt">root# </tt><b class="userinput"><tt>lpadmin -p quotaprinter -o job-quota-period=604800 \
2835 -o job-k-limit=1024 -o job-page-limit=100</tt></b>
2836 </pre><p>
2837 This would limit every single user to print 100 pages or 1024 KB of
2838 data (whichever comes first) within the last 604,800 seconds ( = 1
2839 week).
2840 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2945318"></a>Correct and Incorrect Accounting</h3></div></div><div></div></div><p>
2841 For CUPS to count correctly, the printfile needs to pass the CUPS
2842 pstops filter, otherwise it uses a dummy count of &#8220;<span class="quote">one</span>&#8221;. Some
2843 print files do not pass it (e.g., image files) but then those are mostly one-
2844 page jobs anyway. This also means that proprietary drivers for the
2845 target printer running on the client computers and CUPS/Samba, which
2846 then spool these files as &#8220;<span class="quote">raw</span>&#8221; (i.e., leaving them untouched, not
2847 filtering them), will be counted as one-pagers too!
2848 </p><p>
2849 You need to send PostScript from the clients (i.e., run a PostScript
2850 driver there) to have the chance to get accounting done. If the
2851 printer is a non-PostScript model, you need to let CUPS do the job to
2852 convert the file to a print-ready format for the target printer. This
2853 is currently working for about a thousand different printer models.
2854 Linuxprinting has a driver
2855 <ulink url="http://www.linuxprinting.org/printer_list.cgi">list.</ulink>
2856 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2945366"></a>Adobe and CUPS PostScript Drivers for Windows Clients</h3></div></div><div></div></div><p>
2857 Before CUPS 1.1.16, your only option was to use the Adobe PostScript
2858 Driver on the Windows clients. The output of this driver was not
2859 always passed through the <b class="command">pstops</b> filter on the CUPS/Samba side, and
2860 therefore was not counted correctly (the reason is that it often,
2861 depending on the PPD being used, wrote a PJL-header in front of
2862 the real PostScript which caused CUPS to skip <b class="command">pstops</b> and go directly
2863 to the <b class="command">pstoraster</b> stage).
2864 </p><p>
2865 From CUPS 1.1.16 onward, you can use the CUPS PostScript Driver for
2866 Windows NT/200x/XP clients (which is tagged in the download area of
2867 <tt class="filename">http://www.cups.org/</tt> as the <tt class="filename">cups-samba-1.1.16.tar.gz</tt>
2868 package). It does <span class="emphasis"><em>not</em></span> work for Windows 9x/ME clients, but it guarantees:
2869 </p><div class="itemizedlist"><ul type="disc"><li><p> <a class="indexterm" name="id2945443"></a> To not write a PJL-header.</p></li><li><p>To still read and support all PJL-options named in the
2870 driver PPD with its own means.</p></li><li><p>That the file will pass through the <b class="command">pstops</b> filter
2871 on the CUPS/Samba server.</p></li><li><p>To page-count correctly the print file.</p></li></ul></div><p>
2872 You can read more about the setup of this combination in the man page
2873 for <b class="command">cupsaddsmb</b> (which is only present with CUPS installed, and only
2874 current from CUPS 1.1.16).
2875 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2945495"></a>The page_log File Syntax</h3></div></div><div></div></div><p>
2876 <a class="indexterm" name="id2945506"></a>
2877 These are the items CUPS logs in the <tt class="filename">page_log</tt> for every
2878 page of a job:
2879 </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 (optional)</p></li><li><p>The host that sent the job (included since version 1.1.19)</p></li></ul></div><p>
2880 Here is an extract of my CUPS server's <tt class="filename">page_log</tt> file to illustrate the
2881 format and included items:
2882 </p><pre class="screen">
2883 tec_IS2027 kurt 401 [22/Apr/2003:10:28:43 +0100] 1 3 #marketing 10.160.50.13
2884 tec_IS2027 kurt 401 [22/Apr/2003:10:28:43 +0100] 2 3 #marketing 10.160.50.13
2885 tec_IS2027 kurt 401 [22/Apr/2003:10:28:43 +0100] 3 3 #marketing 10.160.50.13
2886 tec_IS2027 kurt 401 [22/Apr/2003:10:28:43 +0100] 4 3 #marketing 10.160.50.13
2887 Dig9110 boss 402 [22/Apr/2003:10:33:22 +0100] 1 440 finance-dep 10.160.51.33
2888 </pre><p>
2889 This was job ID <i class="parameter"><tt>401</tt></i>, printed on <i class="parameter"><tt>tec_IS2027</tt></i>
2890 by user <i class="parameter"><tt>kurt</tt></i>, a 64-page job printed in three copies and billed to
2891 <i class="parameter"><tt>#marketing</tt></i>, sent from IP address <tt class="constant">10.160.50.13.</tt>
2892 The next job had ID <i class="parameter"><tt>402</tt></i>, was sent by user <i class="parameter"><tt>boss</tt></i>
2893 from IP address <tt class="constant">10.160.51.33</tt>, printed from one page 440 copies and
2894 is set to be billed to <i class="parameter"><tt>finance-dep</tt></i>.
2895 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2945665"></a>Possible Shortcomings</h3></div></div><div></div></div><p>
2896 What flaws or shortcomings are there with this quota system?
2897 </p><div class="itemizedlist"><ul type="disc"><li><p>The ones named above (wrongly logged job in case of
2898 printer hardware failure, and so on).</p></li><li><p>In reality, CUPS counts the job pages that are being
2899 processed in <span class="emphasis"><em>software</em></span> (that is, going through the
2900 RIP) rather than the physical sheets successfully leaving the
2901 printing device. Thus if there is a jam while printing the fifth sheet out
2902 of a thousand and the job is aborted by the printer, the page count will
2903 still show the figure of a thousand for that job.</p></li><li><p>All quotas are the same for all users (no flexibility
2904 to give the boss a higher quota than the clerk) and no support for
2905 groups.</p></li><li><p>No means to read out the current balance or the
2906 &#8220;<span class="quote">used-up</span>&#8221; number of current quota.</p></li><li><p>A user having used up 99 sheets of a 100 quota will
2907 still be able to send and print a thousand sheet job.</p></li><li><p>A user being denied a job because of a filled-up quota
2908 does not get a meaningful error message from CUPS other than
2909 &#8220;<span class="quote">client-error-not-possible</span>&#8221;.</p></li></ul></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2945745"></a>Future Developments</h3></div></div><div></div></div><p>
2910 This is the best system currently available, and there are huge
2911 improvements under development for CUPS 1.2:
2912 </p><div class="itemizedlist"><ul type="disc"><li><p>Page counting will go into the backends (these talk
2913 directly to the printer and will increase the count in sync with the
2914 actual printing process; thus, a jam at the fifth sheet will lead to a
2915 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
2916 about their accounts in advance.</p></li><li><p>Probably there will be support for some other tools
2917 around this topic.</p></li></ul></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2945799"></a>Additional Material</h2></div></div><div></div></div><p>
2918 A printer queue with <span class="emphasis"><em>no</em></span> PPD associated to it is a
2919 &#8220;<span class="quote">raw</span>&#8221; printer and all files will go directly there as received by the
2920 spooler. The exceptions are file types <i class="parameter"><tt>application/octet-stream</tt></i>
2921 that need passthrough feature enabled. &#8220;<span class="quote">Raw</span>&#8221; queues do not do any
2922 filtering at all, they hand the file directly to the CUPS backend.
2923 This backend is responsible for sending the data to the device
2924 (as in the &#8220;<span class="quote">device URI</span>&#8221; notation: <tt class="filename">lpd://, socket://,
2925 smb://, ipp://, http://, parallel:/, serial:/, usb:/</tt>, and so on).
2926 </p><p>
2927 cupsomatic/Foomatic are <span class="emphasis"><em>not</em></span> native CUPS drivers
2928 and they do not ship with CUPS. They are a third party add-on
2929 developed at Linuxprinting.org. As such, they are a brilliant hack to
2930 make all models (driven by Ghostscript drivers/filters in traditional
2931 spoolers) also work via CUPS, with the same (good or bad!) quality as
2932 in these other spoolers. <i class="parameter"><tt>cupsomatic</tt></i> is only a vehicle to execute a
2933 Ghostscript commandline at that stage in the CUPS filtering chain,
2934 where normally the native CUPS <i class="parameter"><tt>pstoraster</tt></i> filter would kick
2935 in. cupsomatic bypasses pstoraster, kidnaps the printfile from CUPS
2936 away and redirects it to go through Ghostscript. CUPS accepts this,
2937 because the associated cupsomatic/foomatic-PPD specifies:
2939 </p><pre class="programlisting">
2940 *cupsFilter: "application/vnd.cups-postscript 0 cupsomatic"
2941 </pre><p>
2943 This line persuades CUPS to hand the file to cupsomatic, once it has
2944 successfully converted it to the MIME type
2945 <i class="parameter"><tt>application/vnd.cups-postscript</tt></i>. This conversion will not happen for
2946 Jobs arriving from Windows that are auto-typed
2947 <i class="parameter"><tt>application/octet-stream</tt></i>, with the according changes in
2948 <tt class="filename">/etc/cups/mime.types</tt> in place.
2949 </p><p>
2950 CUPS is widely configurable and flexible, even regarding its filtering
2951 mechanism. Another workaround in some situations would be to have in
2952 <tt class="filename">/etc/cups/mime.types</tt> entries as follows:
2954 </p><pre class="programlisting">
2955 application/postscript application/vnd.cups-raw 0 -
2956 application/vnd.cups-postscript application/vnd.cups-raw 0 -
2957 </pre><p>
2959 This would prevent all PostScript files from being filtered (rather,
2960 they will through the virtual <span class="emphasis"><em>nullfilter</em></span>
2961 denoted with &#8220;<span class="quote">-</span>&#8221;). This could only be useful for PS printers. If you
2962 want to print PS code on non-PS printers (provided they support ASCII
2963 text printing), an entry as follows could be useful:
2965 </p><pre class="programlisting">
2966 */* application/vnd.cups-raw 0 -
2967 </pre><p>
2969 and would effectively send <span class="emphasis"><em>all</em></span> files to the
2970 backend without further processing.
2971 </p><p>
2972 You could have the following entry:
2974 </p><pre class="programlisting">
2975 application/vnd.cups-postscript application/vnd.cups-raw 0 \
2976 my_PJL_stripping_filter
2977 </pre><p>
2979 You will need to write a <i class="parameter"><tt>my_PJL_stripping_filter</tt></i>
2980 (which could be a shell script) that parses the PostScript and removes the
2981 unwanted PJL. This needs to conform to CUPS filter design
2982 (mainly, receive and pass the parameters printername, job-id,
2983 username, jobtitle, copies, print options and possibly the
2984 filename). It is installed as world executable into
2985 <tt class="filename">/usr/lib/cups/filters/</tt> and is called by CUPS
2986 if it encounters a MIME type <i class="parameter"><tt>application/vnd.cups-postscript</tt></i>.
2987 </p><p>
2988 CUPS can handle <i class="parameter"><tt>-o job-hold-until=indefinite</tt></i>.
2989 This keeps the job in the queue on hold. It will only be printed
2990 upon manual release by the printer operator. This is a requirement in
2991 many central reproduction departments, where a few operators manage
2992 the jobs of hundreds of users on some big machine, where no user is
2993 allowed to have direct access (such as when the operators often need
2994 to load the proper paper type before running the 10,000 page job
2995 requested by marketing for the mailing, and so on).
2996 </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2946030"></a>Auto-Deletion or Preservation of CUPS Spool Files</h2></div></div><div></div></div><p>
2997 Samba print files pass through two spool directories. One is the
2998 incoming directory managed by Samba, (set in the
2999 <a class="indexterm" name="id2946043"></a><i class="parameter"><tt>path</tt></i> = /var/spool/samba
3000 directive in the <i class="parameter"><tt>[printers]</tt></i> section of
3001 <tt class="filename">smb.conf</tt>). The other is the spool directory of
3002 your UNIX print subsystem. For CUPS it is normally
3003 <tt class="filename">/var/spool/cups/</tt>, as set by the <tt class="filename">cupsd.conf</tt>
3004 directive <tt class="filename">RequestRoot /var/spool/cups</tt>.
3005 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2946094"></a>CUPS Configuration Settings Explained</h3></div></div><div></div></div><p>
3006 Some important parameter settings in the CUPS configuration file
3007 <tt class="filename">cupsd.conf</tt> are:
3008 </p><div class="variablelist"><dl><dt><span class="term">PreserveJobHistory Yes</span></dt><dd><p>
3009 This keeps some details of jobs in cupsd's mind (well it keeps the
3010 c12345, c12346, and so on, files in the CUPS spool directory, which do a
3011 similar job as the old-fashioned BSD-LPD control files). This is set
3012 to &#8220;<span class="quote">Yes</span>&#8221; as a default.
3013 </p></dd><dt><span class="term">PreserveJobFiles Yes</span></dt><dd><p>
3014 This keeps the job files themselves in cupsd's mind
3015 (it keeps the d12345, d12346 etc. files in the CUPS spool
3016 directory). This is set to &#8220;<span class="quote">No</span>&#8221; as the CUPS
3017 default.
3018 </p></dd><dt><span class="term"><span class="emphasis"><em>&#8220;<span class="quote">MaxJobs 500</span>&#8221;</em></span></span></dt><dd><p>
3019 This directive controls the maximum number of jobs
3020 that are kept in memory. Once the number of jobs reaches the limit,
3021 the oldest completed job is automatically purged from the system to
3022 make room for the new one. If all of the known jobs are still
3023 pending or active, then the new job will be rejected. Setting the
3024 maximum to 0 disables this functionality. The default setting is
3026 </p></dd></dl></div><p>
3027 (There are also additional settings for <i class="parameter"><tt>MaxJobsPerUser</tt></i> and
3028 <i class="parameter"><tt>MaxJobsPerPrinter</tt></i>...)
3029 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2946198"></a>Pre-Conditions</h3></div></div><div></div></div><p>
3030 For everything to work as announced, you need to have three
3031 things:
3032 </p><div class="itemizedlist"><ul type="disc"><li><p>A Samba-smbd that is compiled against <tt class="filename">libcups</tt> (check
3033 on Linux by running <b class="userinput"><tt>ldd `which smbd'</tt></b>).</p></li><li><p>A Samba-<tt class="filename">smb.conf</tt> setting of
3034 <a class="indexterm" name="id2946246"></a><i class="parameter"><tt>printing</tt></i> = cups.</p></li><li><p>Another Samba-<tt class="filename">smb.conf</tt> setting of
3035 <a class="indexterm" name="id2946272"></a><i class="parameter"><tt>printcap</tt></i> = cups.</p></li></ul></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
3036 In this case, all other manually set printing-related commands (like
3037 <a class="indexterm" name="id2946294"></a><i class="parameter"><tt>print command</tt></i>,
3038 <a class="indexterm" name="id2946308"></a><i class="parameter"><tt>lpq command</tt></i>,
3039 <a class="indexterm" name="id2946321"></a><i class="parameter"><tt>lprm command</tt></i>,
3040 <a class="indexterm" name="id2946335"></a><i class="parameter"><tt>lppause command</tt></i> or
3041 <a class="indexterm" name="id2946349"></a><i class="parameter"><tt>lpresume command</tt></i>) are ignored and they should normally have no
3042 influence whatsoever on your printing.
3043 </p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2946367"></a>Manual Configuration</h3></div></div><div></div></div><p>
3044 If you want to do things manually, replace the <a class="indexterm" name="id2946378"></a><i class="parameter"><tt>printing</tt></i> = cups
3045 by <a class="indexterm" name="id2946391"></a><i class="parameter"><tt>printing</tt></i> = bsd. Then your manually set commands may work
3046 (I haven't tested this), and a <a class="indexterm" name="id2946407"></a><i class="parameter"><tt>print command</tt></i> = lp -d %P %s; rm %s"
3047 may do what you need.
3048 </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2946425"></a>Printing from CUPS to Windows Attached Printers</h2></div></div><div></div></div><p>
3049 &gt;From time to time the question arises, how can you print
3050 <span class="emphasis"><em>to</em></span> a Windows attached printer
3051 <span class="emphasis"><em>from</em></span> Samba? Normally the local connection
3052 from Windows host to printer would be done by USB or parallel
3053 cable, but this does not matter to Samba. From here only an SMB
3054 connection needs to be opened to the Windows host. Of course, this
3055 printer must be shared first. As you have learned by now, CUPS uses
3056 <span class="emphasis"><em>backends</em></span> to talk to printers and other
3057 servers. To talk to Windows shared printers, you need to use the
3058 <tt class="filename">smb</tt> (surprise, surprise!) backend. Check if this
3059 is in the CUPS backend directory. This usually resides in
3060 <tt class="filename">/usr/lib/cups/backend/</tt>. You need to find an <tt class="filename">smb</tt>
3061 file there. It should be a symlink to <tt class="filename">smbspool</tt>
3062 and the file must exist and be executable:
3063 </p><pre class="screen">
3064 <tt class="prompt">root# </tt><b class="userinput"><tt>ls -l /usr/lib/cups/backend/</tt></b>
3065 total 253
3066 drwxr-xr-x 3 root root 720 Apr 30 19:04 .
3067 drwxr-xr-x 6 root root 125 Dec 19 17:13 ..
3068 -rwxr-xr-x 1 root root 10692 Feb 16 21:29 canon
3069 -rwxr-xr-x 1 root root 10692 Feb 16 21:29 epson
3070 lrwxrwxrwx 1 root root 3 Apr 17 22:50 http -&gt; ipp
3071 -rwxr-xr-x 1 root root 17316 Apr 17 22:50 ipp
3072 -rwxr-xr-x 1 root root 15420 Apr 20 17:01 lpd
3073 -rwxr-xr-x 1 root root 8656 Apr 20 17:01 parallel
3074 -rwxr-xr-x 1 root root 2162 Mar 31 23:15 pdfdistiller
3075 lrwxrwxrwx 1 root root 25 Apr 30 19:04 ptal -&gt; /usr/sbin/ptal-cups
3076 -rwxr-xr-x 1 root root 6284 Apr 20 17:01 scsi
3077 lrwxrwxrwx 1 root root 17 Apr 2 03:11 smb -&gt; /usr/bin/smbspool
3078 -rwxr-xr-x 1 root root 7912 Apr 20 17:01 socket
3079 -rwxr-xr-x 1 root root 9012 Apr 20 17:01 usb
3081 <tt class="prompt">root# </tt><b class="userinput"><tt>ls -l `which smbspool`</tt></b>
3082 -rwxr-xr-x 1 root root 563245 Dec 28 14:49 /usr/bin/smbspool
3083 </pre><p>
3084 If this symlink does not exist, create it:
3085 </p><pre class="screen">
3086 <tt class="prompt">root# </tt><b class="userinput"><tt>ln -s `which smbspool` /usr/lib/cups/backend/smb</tt></b>
3087 </pre><p>
3088 <b class="command">smbspool</b> has been written by Mike Sweet from the CUPS folks. It is
3089 included and ships with Samba. It may also be used with print
3090 subsystems other than CUPS, to spool jobs to Windows printer shares. To
3091 set up printer <i class="replaceable"><tt>winprinter</tt></i> on CUPS, you need to have a driver for
3092 it. Essentially this means to convert the print data on the CUPS/Samba
3093 host to a format that the printer can digest (the Windows host is
3094 unable to convert any files you may send). This also means you should
3095 be able to print to the printer if it were hooked directly at your
3096 Samba/CUPS host. For troubleshooting purposes, this is what you
3097 should do to determine if that part of the process chain is in
3098 order. Then proceed to fix the network connection/authentication to
3099 the Windows host, and so on.
3100 </p><p>
3101 To install a printer with the <i class="parameter"><tt>smb</tt></i> backend on CUPS, use this command:
3102 </p><pre class="screen">
3103 <tt class="prompt">root# </tt><b class="userinput"><tt>lpadmin -p winprinter -v smb://WINDOWSNETBIOSNAME/printersharename \
3104 -P /path/to/PPD</tt></b>
3105 </pre><p>
3106 The PPD must be able to direct CUPS to generate
3107 the print data for the target model. For PostScript printers, just use
3108 the PPD that would be used with the Windows NT PostScript driver. But
3109 what can you do if the printer is only accessible with a password? Or
3110 if the printer's host is part of another workgroup? This is provided
3111 for: You can include the required parameters as part of the
3112 <tt class="filename">smb://</tt> device-URI like this:
3113 </p><div class="itemizedlist"><ul type="disc"><li><tt class="filename">smb://WORKGROUP/WINDOWSNETBIOSNAME/printersharename</tt></li><li><tt class="filename">smb://username:password@WORKGROUP/WINDOWSNETBIOSNAME/printersharename</tt></li><li><tt class="filename">smb://username:password@WINDOWSNETBIOSNAME/printersharename</tt></li></ul></div><p>
3114 Note that the device-URI will be visible in the process list of the
3115 Samba server (e.g., when someone uses the <b class="command">ps -aux</b>
3116 command on Linux), even if the username and passwords are sanitized
3117 before they get written into the log files. So this is an inherently
3118 insecure option, however, it is the only one. Don't use it if you want
3119 to protect your passwords. Better share the printer in a way that
3120 does not require a password! Printing will only work if you have a
3121 working netbios name resolution up and running. Note that this is a
3122 feature of CUPS and you do not necessarily need to have smbd running.
3124 </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2946721"></a>More CUPS-Filtering Chains</h2></div></div><div></div></div><p>
3125 The following diagrams reveal how CUPS handles print jobs.
3126 </p><div class="figure"><a name="cups1"></a><p class="title"><b>Figure 19.17. Filtering chain 1.</b></p><div class="mediaobject"><img src="projdoc/imagefiles/cups1.png" width="270" alt="Filtering chain 1."></div></div><div class="figure"><a name="cups2"></a><p class="title"><b>Figure 19.18. Filtering chain with cupsomatic</b></p><div class="mediaobject"><img src="projdoc/imagefiles/cups2.png" width="270" alt="Filtering chain with cupsomatic"></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2946814"></a>Common Errors</h2></div></div><div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2946820"></a>Windows 9x/ME Client Can't Install Driver</h3></div></div><div></div></div><p>For Windows 9x/ME, clients require the printer names to be eight
3127 characters (or &#8220;<span class="quote">8 plus 3 chars suffix</span>&#8221;) max; otherwise, the driver files
3128 will not get transferred when you want to download them from
3129 Samba.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2946839"></a>&#8220;<span class="quote">cupsaddsmb</span>&#8221; Keeps Asking for Root Password in Never-ending Loop</h3></div></div><div></div></div><p>Have you <a class="indexterm" name="id2946853"></a><i class="parameter"><tt>security</tt></i> = user? Have
3130 you used <b class="command">smbpasswd</b> to give root a Samba account?
3131 You can do two things: open another terminal and execute
3132 <b class="command">smbpasswd -a root</b> to create the account and
3133 continue entering the password into the first terminal. Or break
3134 out of the loop by pressing ENTER twice (without trying to type a
3135 password).</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2946889"></a>&#8220;<span class="quote">cupsaddsmb</span>&#8221; Errors</h3></div></div><div></div></div><p>
3136 The use of &#8220;<span class="quote">cupsaddsmb</span>&#8221; gives &#8220;<span class="quote">No PPD file for printer...</span>&#8221; Message While PPD File Is Present.
3137 What might the problem be?
3138 </p><p>Have you enabled printer sharing on CUPS? This means:
3139 Do you have a <i class="parameter"><tt>&lt;Location
3140 /printers&gt;....&lt;/Location&gt;</tt></i> section in CUPS
3141 server's <tt class="filename">cupsd.conf</tt> that does not deny access to
3142 the host you run &#8220;<span class="quote">cupsaddsmb</span>&#8221; from? It <span class="emphasis"><em>could</em></span> be
3143 an issue if you use cupsaddsmb remotely, or if you use it with a
3144 <tt class="option">-h</tt> parameter: <b class="userinput"><tt>cupsaddsmb -H
3145 sambaserver -h cupsserver -v printername</tt></b>.
3146 </p><p>Is your
3147 <i class="parameter"><tt>TempDir</tt></i> directive in
3148 <tt class="filename">cupsd.conf</tt>
3149 set to a valid value and is it writeable?
3150 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2946973"></a>Client Can't Connect to Samba Printer</h3></div></div><div></div></div><p>Use <b class="command">smbstatus</b> to check which user
3151 you are from Samba's point of view. Do you have the privileges to
3152 write into the <i class="parameter"><tt>[print$]</tt></i>
3153 share?</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2947002"></a>New Account Reconnection from Windows 200x/XP Troubles</h3></div></div><div></div></div><p>Once you are connected as the wrong user (for
3154 example, as <tt class="constant">nobody</tt>, which often occurs if you have
3155 <a class="indexterm" name="id2947018"></a><i class="parameter"><tt>map to guest</tt></i> = bad user), Windows Explorer will not accept an
3156 attempt to connect again as a different user. There will not be any byte
3157 transfered on the wire to Samba, but still you'll see a stupid error
3158 message that makes you think Samba has denied access. Use
3159 <b class="command">smbstatus</b> to check for active connections. Kill the
3160 PIDs. You still can't re-connect and you get the dreaded
3161 <tt class="computeroutput">You can't connect with a second account from the same
3162 machine</tt> message, as soon as you are trying. And you
3163 do not see any single byte arriving at Samba (see logs; use &#8220;<span class="quote">ethereal</span>&#8221;)
3164 indicating a renewed connection attempt. Shut all Explorer Windows.
3165 This makes Windows forget what it has cached in its memory as
3166 established connections. Then reconnect as the right user. The best
3167 method is to use a DOS terminal window and <span class="emphasis"><em>first</em></span>
3168 do <b class="userinput"><tt>net use z: \\GANDALF\print$ /user:root</tt></b>. Check
3169 with <b class="command">smbstatus</b> that you are connected under a
3170 different account. Now open the <span class="guilabel">Printers</span> folder (on the Samba server
3171 in the <span class="guilabel">Network Neighborhood</span>), right-click on the
3172 printer in question and select
3173 <span class="guibutton">Connect...</span></p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2947106"></a>Avoid Being Connected to the Samba Server as the Wrong User</h3></div></div><div></div></div><p>You see per <b class="command">smbstatus</b> that you are
3174 connected as user nobody; while you want to be root or
3175 printeradmin. This is probably due to
3176 <a class="indexterm" name="id2947126"></a><i class="parameter"><tt>map to guest</tt></i> = bad user, which silently connects you under the guest account
3177 when you gave (maybe by accident) an incorrect username. Remove
3178 <a class="indexterm" name="id2947142"></a><i class="parameter"><tt>map to guest</tt></i>, if you want to prevent
3179 this.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2947158"></a>Upgrading to CUPS Drivers from Adobe Drivers</h3></div></div><div></div></div><p>
3180 This information came from a mailinglist posting regarding problems experienced when
3181 upgrading from Adobe drivers to CUPS drivers on Microsoft Windows NT/200x/XP Clients.
3182 </p><p>First delete all old Adobe-using printers. Then
3183 delete all old Adobe drivers. (On Windows 200x/XP, right-click in
3184 the background of <span class="guilabel">Printers</span> folder, select <span class="guimenuitem">Server Properties...</span>, select
3185 tab <span class="guilabel">Drivers</span> and delete here).</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2947200"></a>Can't Use &#8220;<span class="quote">cupsaddsmb</span>&#8221; on Samba Server Which Is a PDC</h3></div></div><div></div></div><p>Do you use the &#8220;<span class="quote">naked</span>&#8221; root user name? Try to do it
3186 this way: <b class="userinput"><tt>cupsaddsmb -U <i class="replaceable"><tt>DOMAINNAME</tt></i>\\root -v
3187 <i class="replaceable"><tt>printername</tt></i></tt></b>&gt; (note the two backslashes: the first one is
3188 required to &#8220;<span class="quote">escape</span>&#8221; the second one).</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2947239"></a>Deleted Windows 200x Printer Driver Is Still Shown</h3></div></div><div></div></div><p>Deleting a printer on the client will not delete the
3189 driver too (to verify, right-click on the white background of the
3190 <span class="guilabel">Printers</span> folder, select <span class="guimenuitem">Server Properties</span> and click on the
3191 <span class="guilabel">Drivers</span> tab). These same old drivers will be re-used when you try to
3192 install a printer with the same name. If you want to update to a new
3193 driver, delete the old ones first. Deletion is only possible if no
3194 other printer uses the same driver.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2947278"></a>Windows 200x/XP "Local Security Policies"</h3></div></div><div></div></div><p>Local Security Policies may not
3195 allow the installation of unsigned drivers. &#8220;<span class="quote">Local Security Policies</span>&#8221;
3196 may not allow the installation of printer drivers at
3197 all.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2947293"></a>Administrator Cannot Install Printers for All Local Users</h3></div></div><div></div></div><p>Windows XP handles SMB printers on a &#8220;<span class="quote">per-user</span>&#8221; basis.
3198 This means every user needs to install the printer himself. To have a
3199 printer available for everybody, you might want to use the built-in
3200 IPP client capabilities of WinXP. Add a printer with the print path of
3201 <i class="parameter"><tt>http://cupsserver:631/printers/printername</tt></i>.
3202 We're still looking into this one. Maybe a logon script could
3203 automatically install printers for all
3204 users.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2947323"></a>Print Change Notify Functions on NT-clients</h3></div></div><div></div></div><p>For print change, notify functions on NT++ clients.
3205 These need to run the <b class="command">Server</b> service first (renamed to
3206 <b class="command">File &amp; Print Sharing for MS Networks</b> in
3207 XP).</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2947350"></a>WinXP-SP1</h3></div></div><div></div></div><p>WinXP-SP1 introduced a Point and Print Restriction Policy (this restriction does not apply to
3208 &#8220;<span class="quote">Administrator</span>&#8221; or &#8220;<span class="quote">Power User</span>&#8221; groups of users). In Group Policy
3209 Object Editor, go to <span class="guimenu">User Configuration -&gt; Administrative Templates -&gt;
3210 Control Panel -&gt; Printers</span>. The policy is automatically set to
3211 <tt class="constant">Enabled</tt> and the <tt class="constant">Users can only Point
3212 and Print to machines in their Forest</tt> . You probably need
3213 to change it to <tt class="constant">Disabled</tt> or <tt class="constant">Users can
3214 only Point and Print to these servers</tt> to make
3215 driver downloads from Samba possible.
3216 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2947402"></a>Print Options for All Users Can't Be Set on Windows 200x/XP</h3></div></div><div></div></div><p>How are you doing it? I bet the wrong way (it is not
3217 easy to find out, though). There are three different ways to bring
3218 you to a dialog that <span class="emphasis"><em>seems</em></span> to set everything. All
3219 three dialogs <span class="emphasis"><em>look</em></span> the same, yet only one of them
3220 does what you intend. You need to be
3221 Administrator or Print Administrator to do this for all users. Here
3222 is how I do in on XP:
3223 </p><div class="orderedlist"><ol type="A"><li><p>The first wrong way:
3225 </p><div class="orderedlist"><ol type="I"><li><p>Open the <span class="guilabel">Printers</span>
3226 folder.</p></li><li><p>Right-click on the printer
3227 (<span class="guilabel">remoteprinter on cupshost</span>) and
3228 select in context menu <span class="guimenuitem">Printing
3229 Preferences...</span></p></li><li><p>Look at this dialog closely and remember what it looks
3230 like.</p></li></ol></div><p>
3231 </p></li><li><p>The second wrong way:
3233 </p><div class="orderedlist"><ol type="I"><li><p>Open the <span class="guilabel">Printers</span>
3234 folder.</p></li><li><p>Right-click on the printer (<span class="guilabel">remoteprinter on
3235 cupshost</span>) and select the context menu
3236 <span class="guimenuitem">Properties</span>.</p></li><li><p>Click on the <span class="guilabel">General</span>
3237 tab.</p></li><li><p>Click on the button <span class="guibutton">Printing
3238 Preferences...</span></p></li><li><p>A new dialog opens. Keep this dialog open and go back
3239 to the parent dialog.</p></li></ol></div><p>
3240 </p></li><li><p>The third, and the correct way:
3242 </p><div class="orderedlist"><ol type="I"><li><p>Open the <span class="guilabel">Printers</span>
3243 folder.</p></li><li><p>Click on the <span class="guilabel">Advanced</span>
3244 tab. (If everything is &#8220;<span class="quote">grayed out,</span>&#8221; then you are not logged
3245 in as a user with enough privileges).</p></li><li><p>Click on the <span class="guibutton">Printing
3246 Defaults...</span> button.</p></li><li><p>On any of the two new tabs, click on the
3247 <span class="guibutton">Advanced...</span>
3248 button.</p></li><li><p>A new dialog opens. Compare this one to the other
3249 identical looking one from &#8220;<span class="quote">B.5</span>&#8221; or A.3".</p></li></ol></div><p>
3250 </p></li></ol></div><p>
3251 Do you see any difference? I don't either. However, only the last
3252 one, which you arrived at with steps &#8220;<span class="quote">C.1.-6.</span>&#8221;, will save any settings
3253 permanently and be the defaults for new users. If you want all clients
3254 to get the same defaults, you need to conduct these steps <span class="emphasis"><em>as
3255 Administrator</em></span> (<a class="indexterm" name="id2947677"></a><i class="parameter"><tt>printer admin</tt></i> in
3256 <tt class="filename">smb.conf</tt>) <span class="emphasis"><em>before</em></span> a client
3257 downloads the driver (the clients can later set their own
3258 <span class="emphasis"><em>per-user defaults</em></span> by following the
3259 procedures <span class="emphasis"><em>A</em></span> or <span class="emphasis"><em>B</em></span>
3260 above).</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2947717"></a>Most Common Blunders in Driver Settings on Windows Clients</h3></div></div><div></div></div><p>Don't use <i class="parameter"><tt>Optimize for
3261 Speed</tt></i>, but use <i class="parameter"><tt>Optimize for
3262 Portability</tt></i> instead (Adobe PS Driver). Don't use
3263 <i class="parameter"><tt>Page Independence: No</tt></i>: always
3264 settle with <i class="parameter"><tt>Page Independence:
3265 Yes</tt></i> (Microsoft PS Driver and CUPS PS Driver for
3266 Windows NT/200x/XP). If there are problems with fonts, use
3267 <i class="parameter"><tt>Download as Softfont into
3268 printer</tt></i> (Adobe PS Driver). For
3269 <span class="guilabel">TrueType Download Options</span>
3270 choose <tt class="constant">Outline</tt>. Use PostScript
3271 Level 2, if you are having trouble with a non-PS printer and if
3272 there is a choice.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2947779"></a><b class="command">cupsaddsmb</b> Does Not Work with Newly Installed Printer</h3></div></div><div></div></div><p>Symptom: The last command of
3273 <b class="command">cupsaddsmb</b> does not complete successfully:
3274 <b class="command">cmd = setdriver printername printername</b> result was
3275 NT_STATUS_UNSUCCESSFUL then possibly the printer was not yet
3276 recognized by Samba. Did it show up in Network
3277 Neighborhood? Did it show up i n <b class="command">rpcclient
3278 hostname -c `enumprinters'</b>? Restart smbd (or send a
3279 <b class="command">kill -HUP</b> to all processes listed by
3280 <b class="command">smbstatus</b> and try
3281 again.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2947835"></a>Permissions on <tt class="filename">/var/spool/samba/</tt> Get Reset After Each Reboot</h3></div></div><div></div></div><p>Have you ever by accident set the CUPS spool directory to
3282 the same location? (<i class="parameter"><tt>RequestRoot /var/spool/samba/</tt></i> in <tt class="filename">cupsd.conf</tt> or
3283 the other way round: <tt class="filename">/var/spool/cups/</tt> is set as
3284 <a class="indexterm" name="id2947875"></a><i class="parameter"><tt>path</tt></i>&gt; in the <i class="parameter"><tt>[printers]</tt></i>
3285 section). These <i class="parameter"><tt>must</tt></i> be different. Set
3287 <i class="parameter"><tt>RequestRoot /var/spool/cups/</tt></i> in
3288 <tt class="filename">cupsd.conf</tt> and <a class="indexterm" name="id2947919"></a><i class="parameter"><tt>path</tt></i> =
3289 /var/spool/samba in the <i class="parameter"><tt>[printers]</tt></i>
3290 section of <tt class="filename">smb.conf</tt>. Otherwise cupsd will
3291 sanitize permissions to its spool directory with each restart and
3292 printing will not work reliably.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2947951"></a>Print Queue Called &#8220;<span class="quote">lp</span>&#8221; Mis-handles Print Jobs</h3></div></div><div></div></div><p>
3293 In this case a print queue called &#8220;<span class="quote">lp</span>&#8221; intermittently swallows jobs and
3294 spits out completely different ones from what was sent.
3295 </p><p>It is a bad idea to name any printer &#8220;<span class="quote">lp</span>&#8221;. This
3296 is the traditional UNIX name for the default printer. CUPS may be set
3297 up to do an automatic creation of Implicit Classes. This means, to
3298 group all printers with the same name to a pool of devices, and
3299 load-balancing the jobs across them in a round-robin fashion. Chances
3300 are high that someone else has a printer named &#8220;<span class="quote">lp</span>&#8221; too. You may
3301 receive his jobs and send your own to his device unwittingly. To have
3302 tight control over the printer names, set <i class="parameter"><tt>BrowseShortNames
3303 No</tt></i>. It will present any printer as <i class="replaceable"><tt>printername@cupshost</tt></i>
3304 and then gives you better control over what may happen in a large
3305 networked environment.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2948008"></a>Location of Adobe PostScript Driver Files for &#8220;<span class="quote">cupsaddsmb</span>&#8221;</h3></div></div><div></div></div><p>Use <b class="command">smbclient</b> to connect to any
3306 Windows box with a shared PostScript printer: <b class="command">smbclient
3307 //windowsbox/print\$ -U guest</b>. You can navigate to the
3308 <tt class="filename">W32X86/2</tt> subdir to <b class="command">mget ADOBE*</b>
3309 and other files or to <tt class="filename">WIN40/0</tt> to do the same.
3310 Another option is to download the <tt class="filename">*.exe</tt> packaged
3311 files from the Adobe Web site.</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2948065"></a>Overview of the CUPS Printing Processes</h2></div></div><div></div></div><p>A complete overview of the CUPS printing processes can be found in <link linkend="a_small">.</p><div class="figure"><a name="a_small"></a><p class="title"><b>Figure 19.19. CUPS printing overview.</b></p><div class="mediaobject"><img src="projdoc/imagefiles/a_small.png" width="270" alt="CUPS printing overview."></div></div></div><div class="footnotes"><br><hr width="100" align="left"><div class="footnote"><ulink url="http://www.cups.org/cups-help.html"><sup>[<a name="ftn.id2936587" href="#id2936587">4</a>] </sup>http://www.cups.org/cups-help.html</ulink></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>