~ubuntu-branches/ubuntu/maverick/samba/maverick-security

« back to all changes in this revision

Viewing changes to docs/htmldocs/Samba3-HOWTO/CUPS-printing.html

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-01-29 06:16:15 UTC
  • mfrom: (0.27.9 upstream) (0.34.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100129061615-37hs6xqpsdhjq3ld
Tags: 2:3.4.5~dfsg-1ubuntu1
* Merge from debian testing.  Remaining changes:
  + debian/patches/VERSION.patch:
    - set SAMBA_VERSION_SUFFIX to Ubuntu.
  + debian/smb.conf:
    - Add "(Samba, Ubuntu)" to server string.
    - Comment out the default [homes] share, and add a comment about "valid users = %s"
      to show users how to restrict access to \\server\username to only username.
    - Set 'usershare allow guests', so that usershare admins are allowed to create
      public shares in additon to authenticated ones.
    - add map to guest = Bad user, maps bad username to gues access.
  + debian/samba-common.conf:
    - Do not change priority to high if dhclient3 is installed.
    - Use priority medium instead of high for the workgroup question.
  + debian/mksambapasswd.awk:
    - Do not add user with UID less than 1000 to smbpasswd.
  + debian/control: 
    - Make libswbclient0 replace/conflict with hardy's likewise-open.
    - Don't build against ctdb, since its not in main yet.
  + debian/rules:
    - Enable "native" PIE hardening.
    - Add BIND_NOW to maximize benefit of RELRO hardening.
  + Add ufw integration:
    - Created debian/samba.ufw.profile.
    - debian/rules, debian/samba.dirs, debian/samba.files: install
  + Add apoort hook:
    - Created debian/source_samba.py.
    - debian/rules, debian/samba.dirs, debian/samba-common-bin.files: install
  + debian/rules, debian/samba.if-up: allow "NetworkManager" as a recognized address
    family... it's obviously /not/ an address family, but it's what gets
    sent when using NM, so we'll cope for now.  (LP: #462169). Taken from karmic-proposed.
  + debian/control: Recommend keyutils for smbfs (LP: #493565)
  + Dropped patches:
    - debian/patches/security-CVE-2009-3297.patch: No longer needed
    - debian/patches/fix-too-many-open-files.patch: No longer needed

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter�22.�CUPS Printing Support</title><link rel="stylesheet" href="../samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"><link rel="home" href="index.html" title="The Official Samba 3.4.x HOWTO and Reference Guide"><link rel="up" href="optional.html" title="Part�III.�Advanced Configuration"><link rel="prev" href="classicalprinting.html" title="Chapter�21.�Classical Printing Support"><link rel="next" href="VFS.html" title="Chapter�23.�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�22.�CUPS Printing Support</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="classicalprinting.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�22.�CUPS Printing Support</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Kurt</span> <span class="orgname">Danka Deutschland GmbH </span> <span class="surname">Pfeifle</span></h3><div class="affiliation"><span class="orgname">Danka Deutschland GmbH <br></span><div class="address"><p><code class="email">&lt;<a class="email" href="mailto:kpfeifle@danka.de">kpfeifle@danka.de</a>&gt;</code></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><code class="email">&lt;<a class="email" href="mailto:CVizitiu@gbif.org">CVizitiu@gbif.org</a>&gt;</code></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Jelmer</span> <span class="othername">R.</span> <span class="orgname">The Samba Team</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><code class="email">&lt;<a class="email" href="mailto:jelmer@samba.org">jelmer@samba.org</a>&gt;</code></p></div></div></div></div><div><p class="pubdate"> (27 Jan 2004) </p></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="CUPS-printing.html#id2632968">Introduction</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2632974">Features and Benefits</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2633034">Overview</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2633153">Basic CUPS Support Configuration</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2633268">Linking smbd with libcups.so</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2633517">Simple smb.conf Settings for CUPS</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2633762">More Complex CUPS smb.conf Settings</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2634138">Advanced Configuration</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2634156">Central Spooling vs. Peer-to-Peer Printing</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2634206">Raw Print Serving: Vendor Drivers on Windows Clients</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2634441">Installation of Windows Client Drivers</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#cups-raw">Explicitly Enable raw Printing for application/octet-stream</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2634728">Driver Upload Methods</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2634850">Advanced Intelligent Printing with PostScript Driver Download</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#gdipost">GDI on Windows, PostScript on UNIX</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2635042">Windows Drivers, GDI, and EMF</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2635220">UNIX Printfile Conversion and GUI Basics</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#post-and-ghost">PostScript and Ghostscript</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2635579">Ghostscript: The Software RIP for Non-PostScript Printers</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2635733">PostScript Printer Description (PPD) Specification</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2635816">Using Windows-Formatted Vendor PPDs</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2635936">CUPS Also Uses PPDs for Non-PostScript Printers</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2635975">The CUPS Filtering Architecture</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2636211">MIME Types and CUPS Filters</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2636640">MIME Type Conversion Rules</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2636848">Filtering  Overview</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2637005">Prefilters</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2637193">pstops</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2637361">pstoraster</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2637630">imagetops and imagetoraster</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2637715">rasterto [printers specific]</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2637934">CUPS Backends</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2638273">The Role of cupsomatic/foomatic</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2638508">The Complete Picture</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2638521">mime.convs</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2638590">Raw Printing</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2638698">application/octet-stream Printing</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2638977">PostScript Printer Descriptions for Non-PostScript Printers</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2639260">cupsomatic/foomatic-rip Versus Native CUPS Printing</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2639597">Examples for Filtering Chains</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2640025">Sources of CUPS Drivers/PPDs</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2640148">Printing with Interface Scripts</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2640243">Network Printing (Purely Windows)</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2640259">From Windows Clients to an NT Print Server</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2640321">Driver Execution on the Client</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2640393">Driver Execution on the Server</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2640498">Network Printing (Windows Clients and UNIX/Samba Print
2
 
Servers)</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2640516">From Windows Clients to a CUPS/Samba Print Server</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2640706">Samba Receiving Job-Files and Passing Them to CUPS</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2640785">Network PostScript RIP</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2640876">PPDs for Non-PS Printers on UNIX</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2640920">PPDs for Non-PS Printers on Windows</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2640988">Windows Terminal Servers (WTS) as CUPS Clients</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2641003">Printer Drivers Running in Kernel Mode Cause Many
3
 
Problems</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2641041">Workarounds Impose Heavy Limitations</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2641059">CUPS: A Magical Stone?</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2641102">PostScript Drivers with No Major Problems, Even in Kernel
4
 
Mode</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2641189">Configuring CUPS for Driver Download</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2641212">cupsaddsmb: The Unknown Utility</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2641310">Prepare Your smb.conf for cupsaddsmb</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2641591">CUPS PostScript Driver for Windows NT/200x/XP</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2641830">Recognizing Different Driver Files</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2641949">Acquiring the Adobe Driver Files</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2641974">ESP Print Pro PostScript Driver for Windows NT/200x/XP</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2642037">Caveats to Be Considered</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2642336">Windows CUPS PostScript Driver Versus Adobe Driver</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2642554">Run cupsaddsmb (Quiet Mode)</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2642694">Run cupsaddsmb with Verbose Output</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2642886">Understanding cupsaddsmb</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2643030">How to Recognize If cupsaddsmb Completed Successfully</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2643152">cupsaddsmb with a Samba PDC</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2643233">cupsaddsmb Flowchart</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2643314">Installing the PostScript Driver on a Client</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#cups-avoidps1">Avoiding Critical PostScript Driver Settings on the Client</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2643549">Installing PostScript Driver Files Manually Using rpcclient</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2643723">A Check of the rpcclient man Page</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2643895">Understanding the rpcclient man Page</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2644000">Producing an Example by Querying a Windows Box</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2644132">Requirements for adddriver and setdriver to Succeed</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2644357">Manual Driver Installation in 15 Steps</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2645315">Troubleshooting Revisited</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2645458">The Printing *.tdb Files</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2645661">Trivial Database Files</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2645729">Binary Format</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2645795">Losing *.tdb Files</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2645846">Using tdbbackup</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2645965">CUPS Print Drivers from Linuxprinting.org</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2646141">foomatic-rip and Foomatic Explained</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2646962">foomatic-rip and Foomatic PPD Download and Installation</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2647435">Page Accounting with CUPS</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2647471">Setting Up Quotas</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2647525">Correct and Incorrect Accounting</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2647565">Adobe and CUPS PostScript Drivers for Windows Clients</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2647706">The page_log File Syntax</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2647851">Possible Shortcomings</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2647917">Future Developments</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2647957">Other Accounting Tools</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2647971">Additional Material</a></span></dt><dt><span class="sect1"><a href="CUPS-printing.html#id2648188">Autodeletion or Preservation of CUPS Spool Files</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2648264">CUPS Configuration Settings Explained</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2648349">Preconditions</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2648488">Manual Configuration</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2648535">Printing from CUPS to Windows-Attached Printers</a></span></dt><dt><span class="sect1"><a href="CUPS-printing.html#id2648832">More CUPS Filtering Chains</a></span></dt><dt><span class="sect1"><a href="CUPS-printing.html#id2648943">Common Errors</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2648949">Windows 9x/Me Client Can't Install Driver</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#root-ask-loop">cupsaddsmb Keeps Asking for Root Password in Never-ending Loop</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2649025">cupsaddsmb or rpcclient addriver Emit Error</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2649063">cupsaddsmb Errors</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2649137">Client Can't Connect to Samba Printer</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2649162">New Account Reconnection from Windows 200x/XP Troubles</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2649253">Avoid Being Connected to the Samba Server as the Wrong User</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2649304">Upgrading to CUPS Drivers from Adobe Drivers</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2649342">Can't Use cupsaddsmb on Samba Server, Which Is a PDC</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2649378">Deleted Windows 200x Printer Driver Is Still Shown</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2649412">Windows 200x/XP Local Security Policies</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2649445">Administrator Cannot Install Printers for All Local Users</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2649486">Print Change, Notify Functions on NT Clients</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2649512">Windows XP SP1</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2649558">Print Options for All Users Can't Be Set on Windows 200x/XP</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2649842">Most Common Blunders in Driver Settings on Windows Clients</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2649897">cupsaddsmb Does Not Work with Newly Installed Printer</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2649947">Permissions on /var/spool/samba/ Get Reset After Each Reboot</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2650045">Print Queue Called lp Mishandles Print Jobs</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2650114">Location of Adobe PostScript Driver Files for cupsaddsmb</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2650168">Overview of the CUPS Printing Processes</a></span></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2632968"></a>Introduction</h2></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2632974"></a>Features and Benefits</h3></div></div></div><p>
5
 
<a class="indexterm" name="id2632982"></a>
 
1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter�22.�CUPS Printing Support</title><link rel="stylesheet" href="../samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="The Official Samba 3.4.x HOWTO and Reference Guide"><link rel="up" href="optional.html" title="Part�III.�Advanced Configuration"><link rel="prev" href="classicalprinting.html" title="Chapter�21.�Classical Printing Support"><link rel="next" href="VFS.html" title="Chapter�23.�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�22.�CUPS Printing Support</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="classicalprinting.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" title="Chapter�22.�CUPS Printing Support"><div class="titlepage"><div><div><h2 class="title"><a name="CUPS-printing"></a>Chapter�22.�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><code class="email">&lt;<a class="email" href="mailto:kpfeifle@danka.de">kpfeifle@danka.de</a>&gt;</code></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><code class="email">&lt;<a class="email" href="mailto:CVizitiu@gbif.org">CVizitiu@gbif.org</a>&gt;</code></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><code class="email">&lt;<a class="email" href="mailto:jelmer@samba.org">jelmer@samba.org</a>&gt;</code></p></div></div></div></div><div><p class="pubdate"> (27 Jan 2004) </p></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="CUPS-printing.html#id2639060">Introduction</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2639066">Features and Benefits</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2639126">Overview</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2639245">Basic CUPS Support Configuration</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2639361">Linking smbd with libcups.so</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2639609">Simple <code class="filename">smb.conf</code> Settings for CUPS</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2639853">More Complex CUPS <code class="filename">smb.conf</code> Settings</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2640231">Advanced Configuration</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2640248">Central Spooling vs. <span class="quote">&#8220;<span class="quote">Peer-to-Peer</span>&#8221;</span> Printing</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2640299">Raw Print Serving: Vendor Drivers on Windows Clients</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2640534">Installation of Windows Client Drivers</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#cups-raw">Explicitly Enable <span class="quote">&#8220;<span class="quote">raw</span>&#8221;</span> Printing for <span class="emphasis"><em>application/octet-stream</em></span></a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2640821">Driver Upload Methods</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2640942">Advanced Intelligent Printing with PostScript Driver Download</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#gdipost">GDI on Windows, PostScript on UNIX</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2641134">Windows Drivers, GDI, and EMF</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2641313">UNIX Printfile Conversion and GUI Basics</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#post-and-ghost">PostScript and Ghostscript</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2641672">Ghostscript: The Software RIP for Non-PostScript Printers</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2641826">PostScript Printer Description (PPD) Specification</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2641909">Using Windows-Formatted Vendor PPDs</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2642028">CUPS Also Uses PPDs for Non-PostScript Printers</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2642068">The CUPS Filtering Architecture</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2642304">MIME Types and CUPS Filters</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2642732">MIME Type Conversion Rules</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2642940">Filtering  Overview</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2643098">Prefilters</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2643286">pstops</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2643453">pstoraster</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2643723">imagetops and imagetoraster</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2643807">rasterto [printers specific]</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2644027">CUPS Backends</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2644365">The Role of <em class="parameter"><code>cupsomatic/foomatic</code></em></a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2644600">The Complete Picture</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2644613"><code class="filename">mime.convs</code></a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2644682"><span class="quote">&#8220;<span class="quote">Raw</span>&#8221;</span> Printing</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2644790">application/octet-stream Printing</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2645069">PostScript Printer Descriptions for Non-PostScript Printers</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2645352"><span class="emphasis"><em>cupsomatic/foomatic-rip</em></span> Versus <span class="emphasis"><em>Native CUPS</em></span> Printing</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2645689">Examples for Filtering Chains</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2646117">Sources of CUPS Drivers/PPDs</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2646240">Printing with Interface Scripts</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2646335">Network Printing (Purely Windows)</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2646352">From Windows Clients to an NT Print Server</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2646414">Driver Execution on the Client</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2646485">Driver Execution on the Server</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2646590">Network Printing (Windows Clients and UNIX/Samba Print
 
2
Servers)</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2646608">From Windows Clients to a CUPS/Samba Print Server</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2646799">Samba Receiving Job-Files and Passing Them to CUPS</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2646878">Network PostScript RIP</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2646968">PPDs for Non-PS Printers on UNIX</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2647013">PPDs for Non-PS Printers on Windows</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2647081">Windows Terminal Servers (WTS) as CUPS Clients</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2647095">Printer Drivers Running in <span class="quote">&#8220;<span class="quote">Kernel Mode</span>&#8221;</span> Cause Many
 
3
Problems</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2647134">Workarounds Impose Heavy Limitations</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2647151">CUPS: A <span class="quote">&#8220;<span class="quote">Magical Stone</span>&#8221;</span>?</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2647194">PostScript Drivers with No Major Problems, Even in Kernel
 
4
Mode</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2647282">Configuring CUPS for Driver Download</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2647304"><span class="emphasis"><em>cupsaddsmb</em></span>: The Unknown Utility</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2647402">Prepare Your <code class="filename">smb.conf</code> for <code class="literal">cupsaddsmb</code></a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2647683">CUPS <span class="quote">&#8220;<span class="quote">PostScript Driver for Windows NT/200x/XP</span>&#8221;</span></a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2647923">Recognizing Different Driver Files</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2648041">Acquiring the Adobe Driver Files</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2648067">ESP Print Pro PostScript Driver for Windows NT/200x/XP</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2648129">Caveats to Be Considered</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2648429">Windows CUPS PostScript Driver Versus Adobe Driver</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2648647">Run cupsaddsmb (Quiet Mode)</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2648787">Run cupsaddsmb with Verbose Output</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2648978">Understanding cupsaddsmb</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2649123">How to Recognize If cupsaddsmb Completed Successfully</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2649245">cupsaddsmb with a Samba PDC</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2649326">cupsaddsmb Flowchart</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2649407">Installing the PostScript Driver on a Client</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#cups-avoidps1">Avoiding Critical PostScript Driver Settings on the Client</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2649642">Installing PostScript Driver Files Manually Using rpcclient</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2649816">A Check of the rpcclient man Page</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2649987">Understanding the rpcclient man Page</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2650092">Producing an Example by Querying a Windows Box</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2650224">Requirements for adddriver and setdriver to Succeed</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2650449">Manual Driver Installation in 15 Steps</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2651408">Troubleshooting Revisited</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2651551">The Printing <code class="filename">*.tdb</code> Files</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2651754">Trivial Database Files</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2651821">Binary Format</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2651887">Losing <code class="filename">*.tdb</code> Files</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2651938">Using <code class="literal">tdbbackup</code></a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2652058">CUPS Print Drivers from Linuxprinting.org</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2652233">foomatic-rip and Foomatic Explained</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2653055">foomatic-rip and Foomatic PPD Download and Installation</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2653528">Page Accounting with CUPS</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2653563">Setting Up Quotas</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2653617">Correct and Incorrect Accounting</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2653658">Adobe and CUPS PostScript Drivers for Windows Clients</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2653798">The page_log File Syntax</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2653943">Possible Shortcomings</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2654009">Future Developments</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2654049">Other Accounting Tools</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2654063">Additional Material</a></span></dt><dt><span class="sect1"><a href="CUPS-printing.html#id2654280">Autodeletion or Preservation of CUPS Spool Files</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2654356">CUPS Configuration Settings Explained</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2654441">Preconditions</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2654580">Manual Configuration</a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2654628">Printing from CUPS to Windows-Attached Printers</a></span></dt><dt><span class="sect1"><a href="CUPS-printing.html#id2654924">More CUPS Filtering Chains</a></span></dt><dt><span class="sect1"><a href="CUPS-printing.html#id2655035">Common Errors</a></span></dt><dd><dl><dt><span class="sect2"><a href="CUPS-printing.html#id2655041">Windows 9x/Me Client Can't Install Driver</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#root-ask-loop"><span class="quote">&#8220;<span class="quote">cupsaddsmb</span>&#8221;</span> Keeps Asking for Root Password in Never-ending Loop</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2655118"><span class="quote">&#8220;<span class="quote">cupsaddsmb</span>&#8221;</span> or <span class="quote">&#8220;<span class="quote">rpcclient addriver</span>&#8221;</span> Emit Error</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2655156"><span class="quote">&#8220;<span class="quote">cupsaddsmb</span>&#8221;</span> Errors</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2655230">Client Can't Connect to Samba Printer</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2655254">New Account Reconnection from Windows 200x/XP Troubles</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2655345">Avoid Being Connected to the Samba Server as the Wrong User</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2655397">Upgrading to CUPS Drivers from Adobe Drivers</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2655434">Can't Use <span class="quote">&#8220;<span class="quote">cupsaddsmb</span>&#8221;</span> on Samba Server, Which Is a PDC</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2655470">Deleted Windows 200x Printer Driver Is Still Shown</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2655505">Windows 200x/XP Local Security Policies</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2655538">Administrator Cannot Install Printers for All Local Users</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2655579">Print Change, Notify Functions on NT Clients</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2655604">Windows XP SP1</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2655651">Print Options for All Users Can't Be Set on Windows 200x/XP</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2655934">Most Common Blunders in Driver Settings on Windows Clients</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2655990"><code class="literal">cupsaddsmb</code> Does Not Work with Newly Installed Printer</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2656039">Permissions on <code class="filename">/var/spool/samba/</code> Get Reset After Each Reboot</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2656138">Print Queue Called <span class="quote">&#8220;<span class="quote">lp</span>&#8221;</span> Mishandles Print Jobs</a></span></dt><dt><span class="sect2"><a href="CUPS-printing.html#id2656207">Location of Adobe PostScript Driver Files for <span class="quote">&#8220;<span class="quote">cupsaddsmb</span>&#8221;</span></a></span></dt></dl></dd><dt><span class="sect1"><a href="CUPS-printing.html#id2656260">Overview of the CUPS Printing Processes</a></span></dt></dl></div><div class="sect1" title="Introduction"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2639060"></a>Introduction</h2></div></div></div><div class="sect2" title="Features and Benefits"><div class="titlepage"><div><div><h3 class="title"><a name="id2639066"></a>Features and Benefits</h3></div></div></div><p>
 
5
<a class="indexterm" name="id2639074"></a>
6
6
                The Common UNIX Print System (<a class="ulink" href="http://www.cups.org/" target="_top">CUPS</a>)
7
7
                has become quite popular. All major Linux distributions now ship it as their default printing
8
8
                system. To many, it is still a mystical tool. Mostly, it just works.  People tend to regard
9
 
                it as a &#8220;<span class="quote">black box</span>&#8221; that they do not want to look into as long as it works. But once
 
9
                it as a <span class="quote">&#8220;<span class="quote">black box</span>&#8221;</span> that they do not want to look into as long as it works. But once
10
10
                there is a little problem, they have trouble finding out where to start debugging it. Refer to
11
11
                <a class="link" href="classicalprinting.html" title="Chapter�21.�Classical Printing Support">Classical Printing</a>, which contains much information
12
12
                that is also relevant to CUPS.
13
13
                </p><p>
14
 
<a class="indexterm" name="id2633017"></a>
 
14
<a class="indexterm" name="id2639109"></a>
15
15
                CUPS sports quite a few unique and powerful features. While its basic functions may be grasped quite
16
16
                easily, they are also new. Because it is different from other, more traditional printing systems, it is best
17
17
                not to try to apply any prior knowledge about printing to this new system. Rather, try to understand CUPS from
18
18
                the beginning. This documentation will lead you to a complete understanding of CUPS. Let's start with the most
19
19
                basic things first.
20
 
                </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2633034"></a>Overview</h3></div></div></div><p>
21
 
<a class="indexterm" name="id2633042"></a>
22
 
<a class="indexterm" name="id2633049"></a>
23
 
<a class="indexterm" name="id2633055"></a>
24
 
<a class="indexterm" name="id2633062"></a>
25
 
<a class="indexterm" name="id2633069"></a>
26
 
<a class="indexterm" name="id2633079"></a>
27
 
<a class="indexterm" name="id2633088"></a>
28
 
<a class="indexterm" name="id2633095"></a>
 
20
                </p></div><div class="sect2" title="Overview"><div class="titlepage"><div><div><h3 class="title"><a name="id2639126"></a>Overview</h3></div></div></div><p>
 
21
<a class="indexterm" name="id2639134"></a>
 
22
<a class="indexterm" name="id2639141"></a>
 
23
<a class="indexterm" name="id2639148"></a>
 
24
<a class="indexterm" name="id2639155"></a>
 
25
<a class="indexterm" name="id2639162"></a>
 
26
<a class="indexterm" name="id2639171"></a>
 
27
<a class="indexterm" name="id2639181"></a>
 
28
<a class="indexterm" name="id2639188"></a>
29
29
        CUPS is more than just a print spooling system. It is a complete printer management system that
30
30
        complies with the new Internet Printing Protocol (IPP). IPP is an industry and Internet Engineering Task Force
31
31
        (IETF) standard for network printing. Many of its functions can be managed remotely (or locally) via a Web
33
33
        traditional command line and several more modern GUI interfaces (GUI interfaces developed by third parties,
34
34
        like KDE's overwhelming <a class="ulink" href="http://printing.kde.org/" target="_top">KDEPrint</a>).
35
35
        </p><p>
36
 
<a class="indexterm" name="id2633121"></a>
37
 
<a class="indexterm" name="id2633128"></a>
 
36
<a class="indexterm" name="id2639213"></a>
 
37
<a class="indexterm" name="id2639220"></a>
38
38
        CUPS allows creation of <span class="emphasis"><em>raw</em></span> printers (i.e., no print file format translation) as
39
39
        well as <span class="emphasis"><em>smart</em></span> printers (i.e., CUPS does file format conversion as required for the
40
40
        printer). In many ways, this gives CUPS capabilities similar to the MS Windows print monitoring system. Of
41
41
        course, if you are a CUPS advocate, you would argue that CUPS is better! In any case, let us now explore how
42
42
        to configure CUPS for interfacing with MS Windows print clients via Samba.
43
 
        </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2633153"></a>Basic CUPS Support Configuration</h2></div></div></div><p>
44
 
<a class="indexterm" name="id2633161"></a>
45
 
<a class="indexterm" name="id2633168"></a>
46
 
<a class="indexterm" name="id2633174"></a>
47
 
<a class="indexterm" name="id2633181"></a>
48
 
<a class="indexterm" name="id2633188"></a>
 
43
        </p></div></div><div class="sect1" title="Basic CUPS Support Configuration"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2639245"></a>Basic CUPS Support Configuration</h2></div></div></div><p>
 
44
<a class="indexterm" name="id2639253"></a>
 
45
<a class="indexterm" name="id2639260"></a>
 
46
<a class="indexterm" name="id2639267"></a>
 
47
<a class="indexterm" name="id2639274"></a>
 
48
<a class="indexterm" name="id2639280"></a>
49
49
Printing with CUPS in the most basic <code class="filename">smb.conf</code> setup in Samba-3.0 (as was true for 2.2.x) requires just two
50
50
parameters: <a class="link" href="smb.conf.5.html#PRINTING" target="_top">printing = cups</a> and <a class="link" href="smb.conf.5.html#PRINTCAP" target="_top">printcap = cups</a>. CUPS does not need a printcap file.  However, the
51
51
<code class="filename">cupsd.conf</code> configuration file knows of two related directives that control how such a
55
55
print. Make sure CUPS is set to generate and maintain a printcap file. For details, see <code class="literal">man
56
56
cupsd.conf</code> and other CUPS-related documentation, like the wealth of documents regarding the CUPS
57
57
server itself available from the <a class="ulink" href="http://localhost:631/documentation.html" target="_top">CUPS</a> web site.
58
 
        </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2633268"></a>Linking smbd with libcups.so</h3></div></div></div><p>
59
 
<a class="indexterm" name="id2633276"></a>
 
58
        </p><div class="sect2" title="Linking smbd with libcups.so"><div class="titlepage"><div><div><h3 class="title"><a name="id2639361"></a>Linking smbd with libcups.so</h3></div></div></div><p>
 
59
<a class="indexterm" name="id2639369"></a>
60
60
        Samba has a special relationship to CUPS. Samba can be compiled with CUPS library support.
61
61
        Most recent installations have this support enabled. By default, CUPS linking is compiled
62
62
        into smbd and other Samba binaries. Of course, you can use CUPS even
63
63
        if Samba is not linked against <code class="filename">libcups.so</code>  but
64
64
        there are some differences in required or supported configuration.
65
65
        </p><p>
66
 
<a class="indexterm" name="id2633302"></a>
67
 
<a class="indexterm" name="id2633308"></a>
 
66
<a class="indexterm" name="id2639394"></a>
 
67
<a class="indexterm" name="id2639400"></a>
68
68
        When Samba is compiled and linked with <code class="filename">libcups</code>, <a class="link" href="smb.conf.5.html#PRINTCAP" target="_top">printcap = cups</a>
69
69
        uses the CUPS API to list printers, submit jobs, query queues, and so on. Otherwise it maps to the System V
70
70
        commands with an additional <code class="literal">-oraw</code> option for printing. On a Linux
79
79
[....]
80
80
</pre><p>
81
81
        </p><p>
82
 
<a class="indexterm" name="id2633379"></a>
 
82
<a class="indexterm" name="id2639471"></a>
83
83
        The line <code class="computeroutput">libcups.so.2 =&gt; /usr/lib/libcups.so.2 (0x40123000)</code> shows
84
84
        there is CUPS support compiled into this version of Samba. If this is the case, and printing = cups
85
85
        is set, then <span class="emphasis"><em>any otherwise manually set print command in <code class="filename">smb.conf</code> is ignored</em></span>.
86
86
        This is an important point to remember!
87
 
        </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
 
87
        </p><div class="tip" title="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
88
88
        <a class="link" href="smb.conf.5.html#PRINTING" target="_top">printing = sysv</a>. However, you will lose all the benefits
89
89
        of tight CUPS-Samba integration. When you do this, you must manually configure the printing system commands
90
90
        (most important: 
95
95
        <a class="link" href="smb.conf.5.html#LPRMCOMMAND" target="_top">lprm command</a>,
96
96
        <a class="link" href="smb.conf.5.html#QUEUEPAUSECOMMAND" target="_top">queuepause command</a> and
97
97
        <a class="link" href="smb.conf.5.html#QUEUERESUMECOMMAND" target="_top">queue resume command</a>).
98
 
        </p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2633517"></a>Simple <code class="filename">smb.conf</code> Settings for CUPS</h3></div></div></div><p>
 
98
        </p></div></div><div class="sect2" title="Simple smb.conf Settings for CUPS"><div class="titlepage"><div><div><h3 class="title"><a name="id2639609"></a>Simple <code class="filename">smb.conf</code> Settings for CUPS</h3></div></div></div><p>
99
99
        To summarize, <a class="link" href="CUPS-printing.html#cups-exam-simple" title="Example�22.1.�Simplest Printing-Related smb.conf">the Simplest Printing-Related 
100
100
        <code class="filename">smb.conf</code> file</a> shows the simplest printing-related setup for <code class="filename">smb.conf</code> to 
101
101
        enable basic CUPS support:
102
 
        </p><div class="example"><a name="cups-exam-simple"></a><p class="title"><b>Example�22.1.�Simplest Printing-Related smb.conf</b></p><div class="example-contents"><table class="simplelist" border="0" summary="Simple list"><tr><td> </td></tr><tr><td><em class="parameter"><code>[global]</code></em></td></tr><tr><td><a class="indexterm" name="id2633577"></a><em class="parameter"><code>load printers = yes</code></em></td></tr><tr><td><a class="indexterm" name="id2633589"></a><em class="parameter"><code>printing = cups</code></em></td></tr><tr><td><a class="indexterm" name="id2633600"></a><em class="parameter"><code>printcap name = cups</code></em></td></tr><tr><td> </td></tr><tr><td><em class="parameter"><code>[printers]</code></em></td></tr><tr><td><a class="indexterm" name="id2633621"></a><em class="parameter"><code>comment = All Printers</code></em></td></tr><tr><td><a class="indexterm" name="id2633633"></a><em class="parameter"><code>path = /var/spool/samba</code></em></td></tr><tr><td><a class="indexterm" name="id2633644"></a><em class="parameter"><code>browseable = no</code></em></td></tr><tr><td><a class="indexterm" name="id2633656"></a><em class="parameter"><code>guest ok = yes</code></em></td></tr><tr><td><a class="indexterm" name="id2633668"></a><em class="parameter"><code>writable = no</code></em></td></tr><tr><td><a class="indexterm" name="id2633679"></a><em class="parameter"><code>printable = yes</code></em></td></tr><tr><td><a class="indexterm" name="id2633691"></a><em class="parameter"><code>printer admin = root, @ntadmins, @smbprintadm</code></em></td></tr></table></div></div><br class="example-break"><p>
103
 
<a class="indexterm" name="id2633706"></a>
104
 
<a class="indexterm" name="id2633713"></a>
105
 
<a class="indexterm" name="id2633720"></a>
 
102
        </p><div class="example"><a name="cups-exam-simple"></a><p class="title"><b>Example�22.1.�Simplest Printing-Related smb.conf</b></p><div class="example-contents"><table border="0" summary="Simple list" class="simplelist"><tr><td> </td></tr><tr><td><em class="parameter"><code>[global]</code></em></td></tr><tr><td><a class="indexterm" name="id2639670"></a><em class="parameter"><code>load printers = yes</code></em></td></tr><tr><td><a class="indexterm" name="id2639681"></a><em class="parameter"><code>printing = cups</code></em></td></tr><tr><td><a class="indexterm" name="id2639692"></a><em class="parameter"><code>printcap name = cups</code></em></td></tr><tr><td> </td></tr><tr><td><em class="parameter"><code>[printers]</code></em></td></tr><tr><td><a class="indexterm" name="id2639713"></a><em class="parameter"><code>comment = All Printers</code></em></td></tr><tr><td><a class="indexterm" name="id2639725"></a><em class="parameter"><code>path = /var/spool/samba</code></em></td></tr><tr><td><a class="indexterm" name="id2639737"></a><em class="parameter"><code>browseable = no</code></em></td></tr><tr><td><a class="indexterm" name="id2639748"></a><em class="parameter"><code>guest ok = yes</code></em></td></tr><tr><td><a class="indexterm" name="id2639760"></a><em class="parameter"><code>writable = no</code></em></td></tr><tr><td><a class="indexterm" name="id2639772"></a><em class="parameter"><code>printable = yes</code></em></td></tr><tr><td><a class="indexterm" name="id2639783"></a><em class="parameter"><code>printer admin = root, @ntadmins, @smbprintadm</code></em></td></tr></table></div></div><br class="example-break"><p>
 
103
<a class="indexterm" name="id2639799"></a>
 
104
<a class="indexterm" name="id2639805"></a>
 
105
<a class="indexterm" name="id2639812"></a>
106
106
        This is all you need for basic printing setup for CUPS. It will print all graphic, text, PDF, and PostScript
107
107
        files submitted from Windows clients. However, most of your Windows users would not know how to send these
108
108
        kinds of files to print without opening a GUI application. Windows clients tend to have local printer drivers
109
109
        installed, and the GUI application's print buttons start a printer driver. Your users also rarely send files
110
110
        from the command line. Unlike UNIX clients, they rarely submit graphic, text, or PDF formatted files directly
111
 
        to the spooler. They nearly exclusively print from GUI applications with a &#8220;<span class="quote">printer driver</span>&#8221;
 
111
        to the spooler. They nearly exclusively print from GUI applications with a <span class="quote">&#8220;<span class="quote">printer driver</span>&#8221;</span>
112
112
        hooked between the application's native format and the print data stream. If the backend printer is not a
113
 
        PostScript device, the print data stream is &#8220;<span class="quote">binary,</span>&#8221; sensible only for the target printer. Read
 
113
        PostScript device, the print data stream is <span class="quote">&#8220;<span class="quote">binary,</span>&#8221;</span> sensible only for the target printer. Read
114
114
        on to learn what problem this may cause and how to avoid it.
115
 
        </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2633762"></a>More Complex CUPS <code class="filename">smb.conf</code> Settings</h3></div></div></div><p>
 
115
        </p></div><div class="sect2" title="More Complex CUPS smb.conf Settings"><div class="titlepage"><div><div><h3 class="title"><a name="id2639853"></a>More Complex CUPS <code class="filename">smb.conf</code> Settings</h3></div></div></div><p>
116
116
        <a class="link" href="CUPS-printing.html#overridesettings" title="Example�22.2.�Overriding Global CUPS Settings for One Printer">The Overriding Global CUPS Settings for One Printer example</a> 
117
117
        is a slightly more complex printing-related setup for <code class="filename">smb.conf</code>. It enables general CUPS printing
118
118
        support for all printers, but defines one printer share, which is set up differently. 
119
 
        </p><div class="example"><a name="overridesettings"></a><p class="title"><b>Example�22.2.�Overriding Global CUPS Settings for One Printer</b></p><div class="example-contents"><table class="simplelist" border="0" summary="Simple list"><tr><td> </td></tr><tr><td><em class="parameter"><code>[global]</code></em></td></tr><tr><td><a class="indexterm" name="id2633819"></a><em class="parameter"><code>printing = cups</code></em></td></tr><tr><td><a class="indexterm" name="id2633830"></a><em class="parameter"><code>printcap name = cups</code></em></td></tr><tr><td><a class="indexterm" name="id2633842"></a><em class="parameter"><code>load printers = yes</code></em></td></tr><tr><td> </td></tr><tr><td><em class="parameter"><code>[printers]</code></em></td></tr><tr><td><a class="indexterm" name="id2633863"></a><em class="parameter"><code>comment = All Printers</code></em></td></tr><tr><td><a class="indexterm" name="id2633874"></a><em class="parameter"><code>path = /var/spool/samba</code></em></td></tr><tr><td><a class="indexterm" name="id2633885"></a><em class="parameter"><code>guest ok = yes</code></em></td></tr><tr><td><a class="indexterm" name="id2633897"></a><em class="parameter"><code>writable = no</code></em></td></tr><tr><td><a class="indexterm" name="id2633908"></a><em class="parameter"><code>printable = yes</code></em></td></tr><tr><td><a class="indexterm" name="id2633920"></a><em class="parameter"><code>printer admin = root, @ntadmins, @smbprintadm</code></em></td></tr><tr><td> </td></tr><tr><td><em class="parameter"><code>[special_printer]</code></em></td></tr><tr><td><a class="indexterm" name="id2633941"></a><em class="parameter"><code>comment = A special printer with his own settings</code></em></td></tr><tr><td><a class="indexterm" name="id2633954"></a><em class="parameter"><code>path = /var/spool/samba-special</code></em></td></tr><tr><td><a class="indexterm" name="id2633965"></a><em class="parameter"><code>printing = sysv</code></em></td></tr><tr><td><a class="indexterm" name="id2633977"></a><em class="parameter"><code>printcap = lpstat</code></em></td></tr><tr><td><a class="indexterm" name="id2633989"></a><em class="parameter"><code>print command = echo "NEW: `date`: printfile %f" &gt;&gt; /tmp/smbprn.log ; echo "     `date`: p-%p s-%s f-%f" &gt;&gt; /tmp/smbprn.log ; echo "     `date`: j-%j J-%J z-%z c-%c" &gt;&gt; /tmp/smbprn.log ; rm %f </code></em></td></tr><tr><td><a class="indexterm" name="id2634005"></a><em class="parameter"><code>guest ok = no</code></em></td></tr><tr><td><a class="indexterm" name="id2634017"></a><em class="parameter"><code>writable = no</code></em></td></tr><tr><td><a class="indexterm" name="id2634028"></a><em class="parameter"><code>printable = yes</code></em></td></tr><tr><td><a class="indexterm" name="id2634040"></a><em class="parameter"><code>printer admin = kurt</code></em></td></tr><tr><td><a class="indexterm" name="id2634052"></a><em class="parameter"><code>hosts deny = 0.0.0.0</code></em></td></tr><tr><td><a class="indexterm" name="id2634064"></a><em class="parameter"><code>hosts allow = turbo_xp, 10.160.50.23, 10.160.51.60</code></em></td></tr></table></div></div><br class="example-break"><p>
 
119
        </p><div class="example"><a name="overridesettings"></a><p class="title"><b>Example�22.2.�Overriding Global CUPS Settings for One Printer</b></p><div class="example-contents"><table border="0" summary="Simple list" class="simplelist"><tr><td> </td></tr><tr><td><em class="parameter"><code>[global]</code></em></td></tr><tr><td><a class="indexterm" name="id2639910"></a><em class="parameter"><code>printing = cups</code></em></td></tr><tr><td><a class="indexterm" name="id2639922"></a><em class="parameter"><code>printcap name = cups</code></em></td></tr><tr><td><a class="indexterm" name="id2639934"></a><em class="parameter"><code>load printers = yes</code></em></td></tr><tr><td> </td></tr><tr><td><em class="parameter"><code>[printers]</code></em></td></tr><tr><td><a class="indexterm" name="id2639954"></a><em class="parameter"><code>comment = All Printers</code></em></td></tr><tr><td><a class="indexterm" name="id2639966"></a><em class="parameter"><code>path = /var/spool/samba</code></em></td></tr><tr><td><a class="indexterm" name="id2639978"></a><em class="parameter"><code>guest ok = yes</code></em></td></tr><tr><td><a class="indexterm" name="id2639989"></a><em class="parameter"><code>writable = no</code></em></td></tr><tr><td><a class="indexterm" name="id2640001"></a><em class="parameter"><code>printable = yes</code></em></td></tr><tr><td><a class="indexterm" name="id2640012"></a><em class="parameter"><code>printer admin = root, @ntadmins, @smbprintadm</code></em></td></tr><tr><td> </td></tr><tr><td><em class="parameter"><code>[special_printer]</code></em></td></tr><tr><td><a class="indexterm" name="id2640034"></a><em class="parameter"><code>comment = A special printer with his own settings</code></em></td></tr><tr><td><a class="indexterm" name="id2640046"></a><em class="parameter"><code>path = /var/spool/samba-special</code></em></td></tr><tr><td><a class="indexterm" name="id2640058"></a><em class="parameter"><code>printing = sysv</code></em></td></tr><tr><td><a class="indexterm" name="id2640069"></a><em class="parameter"><code>printcap = lpstat</code></em></td></tr><tr><td><a class="indexterm" name="id2640081"></a><em class="parameter"><code>print command = echo "NEW: `date`: printfile %f" &gt;&gt; /tmp/smbprn.log ; echo "     `date`: p-%p s-%s f-%f" &gt;&gt; /tmp/smbprn.log ; echo "     `date`: j-%j J-%J z-%z c-%c" &gt;&gt; /tmp/smbprn.log ; rm %f </code></em></td></tr><tr><td><a class="indexterm" name="id2640098"></a><em class="parameter"><code>guest ok = no</code></em></td></tr><tr><td><a class="indexterm" name="id2640109"></a><em class="parameter"><code>writable = no</code></em></td></tr><tr><td><a class="indexterm" name="id2640121"></a><em class="parameter"><code>printable = yes</code></em></td></tr><tr><td><a class="indexterm" name="id2640132"></a><em class="parameter"><code>printer admin = kurt</code></em></td></tr><tr><td><a class="indexterm" name="id2640144"></a><em class="parameter"><code>hosts deny = 0.0.0.0</code></em></td></tr><tr><td><a class="indexterm" name="id2640156"></a><em class="parameter"><code>hosts allow = turbo_xp, 10.160.50.23, 10.160.51.60</code></em></td></tr></table></div></div><br class="example-break"><p>
120
120
        This special share is only for testing purposes. It does not write the print job to a file. It just logs the job parameters
121
121
        known to Samba into the <code class="filename">/tmp/smbprn.log</code> file and deletes the job-file. Moreover, the
122
 
        <a class="link" href="smb.conf.5.html#PRINTERADMIN" target="_top">printer admin</a> of this share is &#8220;<span class="quote">kurt</span>&#8221; (not the &#8220;<span class="quote">@ntadmins</span>&#8221; group),
 
122
        <a class="link" href="smb.conf.5.html#PRINTERADMIN" target="_top">printer admin</a> of this share is <span class="quote">&#8220;<span class="quote">kurt</span>&#8221;</span> (not the <span class="quote">&#8220;<span class="quote">@ntadmins</span>&#8221;</span> group),
123
123
        guest access is not allowed, the share isn't published to the Network Neighborhood (so you need to know it is there), and it
124
124
        allows access from only three hosts. To prevent CUPS from kicking in and taking over the print jobs for that share, we need to set
125
125
        <a class="link" href="smb.conf.5.html#PRINTING" target="_top">printing = sysv</a> and <a class="link" href="smb.conf.5.html#PRINTCAP" target="_top">printcap = lpstat</a>.
126
 
        </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2634138"></a>Advanced Configuration</h2></div></div></div><p>
 
126
        </p></div></div><div class="sect1" title="Advanced Configuration"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2640231"></a>Advanced Configuration</h2></div></div></div><p>
127
127
        Before we delve into all the configuration options, let us clarify a few points. <span class="emphasis"><em>Network printing
128
128
        needs to be organized and set up correctly</em></span>. This frequently doesn't happen. Legacy systems or small
129
129
        business LAN environments often lack design and good housekeeping.
130
 
        </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2634156"></a>Central Spooling vs. &#8220;<span class="quote">Peer-to-Peer</span>&#8221; Printing</h3></div></div></div><p>
131
 
<a class="indexterm" name="id2634167"></a>
132
 
        <a class="indexterm" name="id2634174"></a>
133
 
        <a class="indexterm" name="id2634183"></a>
 
130
        </p><div class="sect2" title="Central Spooling vs. &#8220;Peer-to-Peer&#8221; Printing"><div class="titlepage"><div><div><h3 class="title"><a name="id2640248"></a>Central Spooling vs. <span class="quote">&#8220;<span class="quote">Peer-to-Peer</span>&#8221;</span> Printing</h3></div></div></div><p>
 
131
<a class="indexterm" name="id2640260"></a>
 
132
        <a class="indexterm" name="id2640266"></a>
 
133
        <a class="indexterm" name="id2640275"></a>
134
134
        Many small office or home networks, as well as badly organized larger environments, allow each client a direct
135
135
        access to available network printers. This is generally a bad idea. It often blocks one client's access to the
136
136
        printer when another client's job is printing. It might freeze the first client's application while it is
138
138
        pages mixed with each other. A better concept is the use of a print server: it routes all jobs through one
139
139
        central system, which responds immediately, takes jobs from multiple concurrent clients, and transfers them to
140
140
        the printer(s) in the correct order.
141
 
        </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2634206"></a>Raw Print Serving: Vendor Drivers on Windows Clients</h3></div></div></div><p>
142
 
        <a class="indexterm" name="id2634215"></a>
143
 
        <a class="indexterm" name="id2634221"></a>
 
141
        </p></div><div class="sect2" title="Raw Print Serving: Vendor Drivers on Windows Clients"><div class="titlepage"><div><div><h3 class="title"><a name="id2640299"></a>Raw Print Serving: Vendor Drivers on Windows Clients</h3></div></div></div><p>
 
142
        <a class="indexterm" name="id2640307"></a>
 
143
        <a class="indexterm" name="id2640313"></a>
144
144
        Most traditionally configured UNIX print servers acting on behalf of
145
145
        Samba's Windows clients represented a really simple setup. Their only
146
 
        task was to manage the &#8220;<span class="quote">raw</span>&#8221; spooling of all jobs handed to them by
 
146
        task was to manage the <span class="quote">&#8220;<span class="quote">raw</span>&#8221;</span> spooling of all jobs handed to them by
147
147
        Samba. This approach meant that the Windows clients were expected to
148
148
        prepare the print job file that is ready to be sent to the printing
149
149
        device. In this case, a native (vendor-supplied) Windows printer driver needs to
150
150
        be installed on each and every client for the target device.
151
151
        </p><p>
152
 
<a class="indexterm" name="id2634243"></a>
153
 
<a class="indexterm" name="id2634250"></a>
 
152
<a class="indexterm" name="id2640335"></a>
 
153
<a class="indexterm" name="id2640342"></a>
154
154
        It is possible to configure CUPS, Samba, and your Windows clients in the
155
155
        same traditional and simple way. When CUPS printers are configured
156
156
        for raw print-through mode operation, it is the responsibility of the
164
164
        This is achieved by installation of the printer as if it were physically
165
165
        attached to the Windows client. You then redirect output to a raw network
166
166
        print queue. This procedure may be followed to achieve this:
167
 
        </p><div class="procedure"><a name="id2634274"></a><p class="title"><b>Procedure�22.1.�Configuration Steps for Raw CUPS Printing Support</b></p><ol type="1"><li><p>
168
 
<a class="indexterm" name="id2634286"></a>
 
167
        </p><div class="procedure" title="Procedure�22.1.�Configuration Steps for Raw CUPS Printing Support"><a name="id2640366"></a><p class="title"><b>Procedure�22.1.�Configuration Steps for Raw CUPS Printing Support</b></p><ol class="procedure" type="1"><li class="step" title="Step 1"><p>
 
168
<a class="indexterm" name="id2640378"></a>
169
169
                Edit <code class="filename">/etc/cups/mime.types</code> to uncomment the line
170
170
                near the end of the file that has:
171
171
</p><pre class="screen">
172
172
#application/octet-...
173
173
</pre><p>
174
 
                </p></li><li><p>
175
 
<a class="indexterm" name="id2634313"></a>
 
174
                </p></li><li class="step" title="Step 2"><p>
 
175
<a class="indexterm" name="id2640405"></a>
176
176
                Do the same for the file <code class="filename">/etc/cups/mime.convs</code>.
177
 
                </p></li><li><p>
 
177
                </p></li><li class="step" title="Step 3"><p>
178
178
                Add a raw printer using the Web interface. Point your browser at
179
179
                <code class="constant">http://localhost:631</code>. Enter Administration, and add
180
180
                the printer following the prompts. Do not install any drivers for it.
181
181
                Choose Raw. Choose queue name <code class="constant">Raw Queue</code>.
182
 
                </p></li><li><p>
 
182
                </p></li><li class="step" title="Step 4"><p>
183
183
                In the <code class="filename">smb.conf</code> file <code class="constant">[printers]</code> section add
184
184
                <a class="link" href="smb.conf.5.html#USECLIENTDRIVER" target="_top">use client driver = Yes</a>,
185
185
                and in the <code class="constant">[global]</code> section add
186
186
                <a class="link" href="smb.conf.5.html#PRINTING" target="_top">printing = CUPS</a>, plus
187
187
                <a class="link" href="smb.conf.5.html#PRINTCAP" target="_top">printcap = CUPS</a>.
188
 
                </p></li><li><p>
 
188
                </p></li><li class="step" title="Step 5"><p>
189
189
                Install the printer as if it is a local printer, that is, Printing to <code class="constant">LPT1:</code>.
190
 
                </p></li><li><p>
 
190
                </p></li><li class="step" title="Step 6"><p>
191
191
                Edit the configuration under the <span class="guimenu">Detail</span> tab and create a
192
192
                <code class="constant">local port</code> that points to the raw printer queue that
193
193
                you have configured above. Example: <code class="constant">\\server\raw_q</code>.
194
194
                Here, the name <code class="constant">raw_q</code> is the name you gave the print
195
195
                queue in the CUPS environment.
196
 
                </p></li></ol></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2634441"></a>Installation of Windows Client Drivers</h3></div></div></div><p>
 
196
                </p></li></ol></div></div><div class="sect2" title="Installation of Windows Client Drivers"><div class="titlepage"><div><div><h3 class="title"><a name="id2640534"></a>Installation of Windows Client Drivers</h3></div></div></div><p>
197
197
        The printer drivers on the Windows clients may be installed
198
198
        in two functionally different ways:
199
 
        </p><div class="itemizedlist"><ul type="disc"><li><p>Manually install the drivers locally on each client,
 
199
        </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Manually install the drivers locally on each client,
200
200
        one by one; this yields the old LanMan style
201
201
        printing and uses a <code class="filename">\\sambaserver\printershare</code>
202
 
        type of connection.</p></li><li><p>
203
 
        <a class="indexterm" name="id2634471"></a>
 
202
        type of connection.</p></li><li class="listitem"><p>
 
203
        <a class="indexterm" name="id2640563"></a>
204
204
                        Deposit and prepare the drivers (for later download) on
205
205
                        the print server (Samba); this enables the clients to use
206
 
        &#8220;<span class="quote">Point'n'Print</span>&#8221; to get drivers semi-automatically installed the
 
206
        <span class="quote">&#8220;<span class="quote">Point'n'Print</span>&#8221;</span> to get drivers semi-automatically installed the
207
207
        first time they access the printer; with this method NT/200x/XP
208
208
        clients use the <span class="emphasis"><em>SPOOLSS/MS-RPC</em></span>
209
209
        type printing calls.</p></li></ul></div><p>
210
210
        The second method is recommended for use over the first as it reduces the
211
211
        administrative efforts and prevents that different versions of the drivers
212
212
        are used accidentally.
213
 
        </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><p>
214
 
        <a class="indexterm" name="id2634517"></a>
215
 
        <a class="indexterm" name="id2634524"></a>
216
 
        <a class="indexterm" name="id2634531"></a>
 
213
        </p></div><div class="sect2" title="Explicitly Enable &#8220;raw&#8221; Printing for application/octet-stream"><div class="titlepage"><div><div><h3 class="title"><a name="cups-raw"></a>Explicitly Enable <span class="quote">&#8220;<span class="quote">raw</span>&#8221;</span> Printing for <span class="emphasis"><em>application/octet-stream</em></span></h3></div></div></div><p>
 
214
        <a class="indexterm" name="id2640610"></a>
 
215
        <a class="indexterm" name="id2640616"></a>
 
216
        <a class="indexterm" name="id2640623"></a>
217
217
        If you use the first option (drivers are installed on the client
218
218
        side), there is one setting to take care of: CUPS needs to be told
219
 
        that it should allow &#8220;<span class="quote">raw</span>&#8221; printing of deliberate (binary) file
 
219
        that it should allow <span class="quote">&#8220;<span class="quote">raw</span>&#8221;</span> printing of deliberate (binary) file
220
220
        formats. The CUPS files that need to be correctly set for raw mode
221
221
        printers to work are:
222
 
        </p><div class="itemizedlist"><ul type="disc"><li><p><code class="filename">/etc/cups/mime.types</code></p></li><li><p><code class="filename">/etc/cups/mime.convs</code></p></li></ul></div><p>
 
222
        </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><code class="filename">/etc/cups/mime.types</code></p></li><li class="listitem"><p><code class="filename">/etc/cups/mime.convs</code></p></li></ul></div><p>
223
223
        Both contain entries (at the end of the respective files) that must be uncommented to allow RAW mode
224
224
        operation.  In <code class="filename">/etc/cups/mime.types</code>, make sure this line is present:
225
225
</p><pre class="programlisting">
226
226
application/octet-stream
227
227
</pre><p>
228
 
        <a class="indexterm" name="id2634586"></a>
229
 
        <a class="indexterm" name="id2634593"></a>
 
228
        <a class="indexterm" name="id2640678"></a>
 
229
        <a class="indexterm" name="id2640685"></a>
230
230
        In <code class="filename">/etc/cups/mime.convs</code>, have this line:
231
 
        <a class="indexterm" name="id2634606"></a>
 
231
        <a class="indexterm" name="id2640699"></a>
232
232
</p><pre class="programlisting">
233
233
application/octet-stream   application/vnd.cups-raw   0   - 
234
234
</pre><p>
235
235
        If these two files are not set up correctly for raw Windows client
236
236
        printing, you may encounter the dreaded <code class="computeroutput">Unable to
237
237
        convert file 0</code> in your CUPS <code class="filename">error_log</code> file. 
238
 
        </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
 
238
        </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
239
239
        Editing the <code class="filename">mime.convs</code> and the <code class="filename">mime.types</code> file does
240
 
        not <span class="emphasis"><em>enforce</em></span> &#8220;<span class="quote">raw</span>&#8221; printing, it only <span class="emphasis"><em>allows</em></span> it.
241
 
        </p></div><p><b>Background.�</b>
242
 
        <a class="indexterm" name="id2634670"></a>
243
 
<a class="indexterm" name="id2634677"></a>
 
240
        not <span class="emphasis"><em>enforce</em></span> <span class="quote">&#8220;<span class="quote">raw</span>&#8221;</span> printing, it only <span class="emphasis"><em>allows</em></span> it.
 
241
        </p></div><p title="Background"><b>Background.�</b>
 
242
        <a class="indexterm" name="id2640762"></a>
 
243
<a class="indexterm" name="id2640770"></a>
244
244
        That CUPS is a more security-aware printing system than traditional ones does not by default allow a user to
245
245
        send deliberate (possibly binary) data to printing devices. This could be easily abused to launch a
246
 
        &#8220;<span class="quote">Denial of Service</span>&#8221; attack on your printer(s), causing at least the loss of a lot of paper and
247
 
        ink. &#8220;<span class="quote">Unknown</span>&#8221; data are tagged by CUPS as <em class="parameter"><code>MIME type: application/octet-stream</code></em>
248
 
        and not allowed to go to the printer. By default, you can only send other (known) MIME types &#8220;<span class="quote">raw.</span>&#8221;
249
 
        Sending data &#8220;<span class="quote">raw</span>&#8221; means that CUPS does not try to convert them and passes them to the printer
 
246
        <span class="quote">&#8220;<span class="quote">Denial of Service</span>&#8221;</span> attack on your printer(s), causing at least the loss of a lot of paper and
 
247
        ink. <span class="quote">&#8220;<span class="quote">Unknown</span>&#8221;</span> data are tagged by CUPS as <em class="parameter"><code>MIME type: application/octet-stream</code></em>
 
248
        and not allowed to go to the printer. By default, you can only send other (known) MIME types <span class="quote">&#8220;<span class="quote">raw.</span>&#8221;</span>
 
249
        Sending data <span class="quote">&#8220;<span class="quote">raw</span>&#8221;</span> means that CUPS does not try to convert them and passes them to the printer
250
250
        untouched.
251
251
        </p><p>
252
252
        This is all you need to know to get the CUPS/Samba combo printing
253
 
        &#8220;<span class="quote">raw</span>&#8221; files prepared by Windows clients, which have vendor drivers
 
253
        <span class="quote">&#8220;<span class="quote">raw</span>&#8221;</span> files prepared by Windows clients, which have vendor drivers
254
254
        locally installed. If you are not interested in background information about
255
255
        more advanced CUPS/Samba printing, simply skip the remaining sections
256
256
        of this chapter.
257
 
        </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2634728"></a>Driver Upload Methods</h3></div></div></div><p>
 
257
        </p></div><div class="sect2" title="Driver Upload Methods"><div class="titlepage"><div><div><h3 class="title"><a name="id2640821"></a>Driver Upload Methods</h3></div></div></div><p>
258
258
        This section describes three familiar methods, plus one new one, by which
259
259
        printer drivers may be uploaded.
260
260
        </p><p>
261
 
        <a class="indexterm" name="id2634742"></a>
 
261
        <a class="indexterm" name="id2640834"></a>
262
262
        If you want to use the MS-RPC-type printing, you must upload the
263
263
        drivers onto the Samba server first (<em class="parameter"><code>[print$]</code></em>
264
264
        share). For a discussion on how to deposit printer drivers on the
265
265
        Samba host (so the Windows clients can download and use them via
266
 
        &#8220;<span class="quote">Point'n'Print</span>&#8221;), please refer to the <a class="link" href="classicalprinting.html" title="Chapter�21.�Classical Printing Support">Classical Printing
 
266
        <span class="quote">&#8220;<span class="quote">Point'n'Print</span>&#8221;</span>), please refer to the <a class="link" href="classicalprinting.html" title="Chapter�21.�Classical Printing Support">Classical Printing
267
267
        chapter</a> of this book. There you will find a description or reference to
268
268
        three methods of preparing the client drivers on the Samba server:
269
 
        </p><div class="itemizedlist"><ul type="disc"><li><p>
270
 
                <a class="indexterm" name="id2634779"></a>
271
 
                The GUI, &#8220;<span class="quote">Add Printer Wizard</span>&#8221; <span class="emphasis"><em>upload-from-a-Windows-client</em></span> method.
272
 
                </p></li><li><p>
273
 
                The command line, &#8220;<span class="quote">smbclient/rpcclient</span>&#8221; upload-from-a-UNIX-workstation method.
274
 
                </p></li><li><p>
275
 
                <a class="indexterm" name="id2634807"></a>
 
269
        </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
 
270
                <a class="indexterm" name="id2640871"></a>
 
271
                The GUI, <span class="quote">&#8220;<span class="quote">Add Printer Wizard</span>&#8221;</span> <span class="emphasis"><em>upload-from-a-Windows-client</em></span> method.
 
272
                </p></li><li class="listitem"><p>
 
273
                The command line, <span class="quote">&#8220;<span class="quote">smbclient/rpcclient</span>&#8221;</span> upload-from-a-UNIX-workstation method.
 
274
                </p></li><li class="listitem"><p>
 
275
                <a class="indexterm" name="id2640900"></a>
276
276
                The Imprints tool set method.
277
277
                </p></li></ul></div><p> 
278
 
<a class="indexterm" name="id2634819"></a>
 
278
<a class="indexterm" name="id2640911"></a>
279
279
        These three methods apply to CUPS all the same. The <code class="literal">cupsaddsmb</code> utility is a new and more
280
280
        convenient way to load the Windows drivers into Samba and is provided if you use CUPS.
281
281
        </p><p>
282
282
        <code class="literal">cupsaddsmb</code> is discussed in much detail later in this chapter. But we first
283
283
        explore the CUPS filtering system and compare the Windows and UNIX printing architectures.
284
 
        </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2634850"></a>Advanced Intelligent Printing with PostScript Driver Download</h2></div></div></div><p>
285
 
        <a class="indexterm" name="id2634858"></a>
286
 
        We now know how to set up a &#8220;<span class="quote">dump</span>&#8221; print server, that is, a server that spools
287
 
        print jobs &#8220;<span class="quote">raw</span>&#8221;, leaving the print data untouched.
 
284
        </p></div></div><div class="sect1" title="Advanced Intelligent Printing with PostScript Driver Download"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2640942"></a>Advanced Intelligent Printing with PostScript Driver Download</h2></div></div></div><p>
 
285
        <a class="indexterm" name="id2640951"></a>
 
286
        We now know how to set up a <span class="quote">&#8220;<span class="quote">dump</span>&#8221;</span> print server, that is, a server that spools
 
287
        print jobs <span class="quote">&#8220;<span class="quote">raw</span>&#8221;</span>, leaving the print data untouched.
288
288
        </p><p>
289
289
        You might need to set up CUPS in a smarter way. The reasons could be manifold:
290
 
        </p><a class="indexterm" name="id2634882"></a><a class="indexterm" name="id2634889"></a><a class="indexterm" name="id2634896"></a><div class="itemizedlist"><ul type="disc"><li><p>Maybe your boss wants to get monthly statistics: Which
 
290
        </p><a class="indexterm" name="id2640975"></a><a class="indexterm" name="id2640982"></a><a class="indexterm" name="id2640989"></a><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Maybe your boss wants to get monthly statistics: Which
291
291
        printer did how many pages? What was the average data size of a job?
292
292
        What was the average print run per day? What are the typical hourly
293
 
        peaks in printing? Which department prints how much?</p></li><li><p>Maybe you are asked to set up a print quota system:
 
293
        peaks in printing? Which department prints how much?</p></li><li class="listitem"><p>Maybe you are asked to set up a print quota system:
294
294
        Users should not be able to print more jobs once they have surpassed
295
 
        a given limit per period.</p></li><li><p>Maybe your previous network printing setup is a mess
296
 
        and must be re-organized from a clean beginning.</p></li><li><p>Maybe you are experiencing too many &#8220;<span class="quote">blue screens</span>&#8221;
297
 
        originating from poorly debugged printer drivers running in NT &#8220;<span class="quote">kernel mode</span>&#8221;?</p></li></ul></div><p>
 
295
        a given limit per period.</p></li><li class="listitem"><p>Maybe your previous network printing setup is a mess
 
296
        and must be re-organized from a clean beginning.</p></li><li class="listitem"><p>Maybe you are experiencing too many <span class="quote">&#8220;<span class="quote">blue screens</span>&#8221;</span>
 
297
        originating from poorly debugged printer drivers running in NT <span class="quote">&#8220;<span class="quote">kernel mode</span>&#8221;</span>?</p></li></ul></div><p>
298
298
        These goals cannot be achieved by a raw print server. To build a
299
299
        server meeting these requirements, you'll first need to learn
300
300
        how CUPS works and how you can enable its features.
302
302
        What follows is the comparison of some fundamental concepts for
303
303
        Windows and UNIX printing, then a description of the
304
304
        CUPS filtering system, how it works, and how you can tweak it.
305
 
        </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><p>
306
 
        <a class="indexterm" name="id2634965"></a>
307
 
        <a class="indexterm" name="id2634972"></a>
 
305
        </p><div class="sect2" title="GDI on Windows, PostScript on UNIX"><div class="titlepage"><div><div><h3 class="title"><a name="gdipost"></a>GDI on Windows, PostScript on UNIX</h3></div></div></div><p>
 
306
        <a class="indexterm" name="id2641058"></a>
 
307
        <a class="indexterm" name="id2641064"></a>
308
308
        Network printing is one of the most complicated and error-prone
309
309
        day-to-day tasks any user or administrator may encounter. This is
310
310
        true for all OS platforms, and there are reasons it is so.
311
311
        </p><p>
312
 
        <a class="indexterm" name="id2634985"></a>
313
 
        <a class="indexterm" name="id2634992"></a>
314
 
<a class="indexterm" name="id2634999"></a>
315
 
<a class="indexterm" name="id2635006"></a>
316
 
<a class="indexterm" name="id2635013"></a>
 
312
        <a class="indexterm" name="id2641078"></a>
 
313
        <a class="indexterm" name="id2641085"></a>
 
314
<a class="indexterm" name="id2641092"></a>
 
315
<a class="indexterm" name="id2641098"></a>
 
316
<a class="indexterm" name="id2641105"></a>
317
317
        You can't expect to throw just any file format at a printer and have it get printed. A file format conversion
318
318
        must take place. The problem is that there is no common standard for print file formats across all
319
319
        manufacturers and printer types. While PostScript (trademark held by Adobe) and, to an extent, PCL (trademark
320
 
        held by Hewlett-Packard) have developed into semi-official &#8220;<span class="quote">standards</span>&#8221; by being the most widely
321
 
        used page description languages (PDLs), there are still many manufacturers who &#8220;<span class="quote">roll their own</span>&#8221;
 
320
        held by Hewlett-Packard) have developed into semi-official <span class="quote">&#8220;<span class="quote">standards</span>&#8221;</span> by being the most widely
 
321
        used page description languages (PDLs), there are still many manufacturers who <span class="quote">&#8220;<span class="quote">roll their own</span>&#8221;</span>
322
322
        (their reasons may be unacceptable license fees for using printer-embedded PostScript interpreters, and so on).
323
 
        </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2635042"></a>Windows Drivers, GDI, and EMF</h3></div></div></div><p>
324
 
        <a class="indexterm" name="id2635050"></a>
325
 
        <a class="indexterm" name="id2635056"></a>
326
 
        <a class="indexterm" name="id2635063"></a>
327
 
<a class="indexterm" name="id2635070"></a>
 
323
        </p></div><div class="sect2" title="Windows Drivers, GDI, and EMF"><div class="titlepage"><div><div><h3 class="title"><a name="id2641134"></a>Windows Drivers, GDI, and EMF</h3></div></div></div><p>
 
324
        <a class="indexterm" name="id2641142"></a>
 
325
        <a class="indexterm" name="id2641149"></a>
 
326
        <a class="indexterm" name="id2641156"></a>
 
327
<a class="indexterm" name="id2641162"></a>
328
328
        In Windows OS, the format conversion job is done by the printer drivers. On MS Windows OS platforms all
329
329
        application programmers have at their disposal a built-in API, the graphical device interface (GDI), as part
330
330
        and parcel of the OS itself to base themselves on. This GDI core is used as one common unified ground for all
334
334
        on-screen graphic primitives, as well as the on-paper drawn objects, come from one common source. This source,
335
335
        the GDI, often produces a file format called Enhanced MetaFile (EMF). The EMF is processed by the printer
336
336
        driver and converted to the printer-specific file format.
337
 
        </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
338
 
        <a class="indexterm" name="id2635105"></a>
339
 
<a class="indexterm" name="id2635112"></a>
340
 
<a class="indexterm" name="id2635119"></a>
 
337
        </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
 
338
        <a class="indexterm" name="id2641198"></a>
 
339
<a class="indexterm" name="id2641204"></a>
 
340
<a class="indexterm" name="id2641211"></a>
341
341
        To the GDI foundation in MS Windows, Apple has chosen to put paper and screen output on a common foundation
342
 
        for its (BSD-UNIX-based, did you know?) Mac OS X and Darwin operating <a class="indexterm" name="id2635129"></a> <a class="indexterm" name="id2635136"></a>
343
 
        <a class="indexterm" name="id2635143"></a> <a class="indexterm" name="id2635149"></a> systems.
 
342
        for its (BSD-UNIX-based, did you know?) Mac OS X and Darwin operating <a class="indexterm" name="id2641221"></a> <a class="indexterm" name="id2641228"></a>
 
343
        <a class="indexterm" name="id2641235"></a> <a class="indexterm" name="id2641242"></a> systems.
344
344
        Apple's <span class="emphasis"><em>core graphic engine</em></span> uses a <span class="emphasis"><em>PDF</em></span> derivative for all display work.
345
345
        </p></div><p>
346
346
        The example in <a class="link" href="CUPS-printing.html#1small" title="Figure�22.1.�Windows Printing to a Local Printer.">Windows Printing to a Local Printer</a> illustrates local Windows
347
347
        printing.
348
 
        </p><div class="figure"><a name="1small"></a><p class="title"><b>Figure�22.1.�Windows Printing to a Local Printer.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/1small.png" alt="Windows Printing to a Local Printer."></div></div></div><br class="figure-break"></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2635220"></a>UNIX Printfile Conversion and GUI Basics</h3></div></div></div><p>
349
 
        <a class="indexterm" name="id2635229"></a>
350
 
        <a class="indexterm" name="id2635236"></a>
351
 
        <a class="indexterm" name="id2635242"></a>
352
 
        <a class="indexterm" name="id2635249"></a>
 
348
        </p><div class="figure"><a name="1small"></a><p class="title"><b>Figure�22.1.�Windows Printing to a Local Printer.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/1small.png" alt="Windows Printing to a Local Printer."></div></div></div><br class="figure-break"></div><div class="sect2" title="UNIX Printfile Conversion and GUI Basics"><div class="titlepage"><div><div><h3 class="title"><a name="id2641313"></a>UNIX Printfile Conversion and GUI Basics</h3></div></div></div><p>
 
349
        <a class="indexterm" name="id2641321"></a>
 
350
        <a class="indexterm" name="id2641328"></a>
 
351
        <a class="indexterm" name="id2641335"></a>
 
352
        <a class="indexterm" name="id2641341"></a>
353
353
        In UNIX and Linux, there is no comparable layer built into the OS kernel(s) or the X (screen display) server.
354
354
        Every application is responsible for itself to create its print output. Fortunately, most use PostScript and
355
355
        that at least gives some common ground. Unfortunately, there are many different levels of quality for this
356
356
        PostScript. And worse, there is a huge difference (and no common root) in the way the same document is
357
357
        displayed on screen and how it is presented on paper. WYSIWYG is more difficult to achieve. This goes back to
358
358
        the time, decades ago, when the predecessors of X.org, designing the UNIX foundations and protocols for
359
 
        graphical user interfaces, refused to take responsibility for &#8220;<span class="quote">paper output</span>&#8221;, as some had
360
 
        demanded at the time, and restricted itself to &#8220;<span class="quote">on-screen only.</span>&#8221; (For some years now, the
361
 
        &#8220;<span class="quote">Xprint</span>&#8221; project has been under development, attempting to build printing support into the X
 
359
        graphical user interfaces, refused to take responsibility for <span class="quote">&#8220;<span class="quote">paper output</span>&#8221;</span>, as some had
 
360
        demanded at the time, and restricted itself to <span class="quote">&#8220;<span class="quote">on-screen only.</span>&#8221;</span> (For some years now, the
 
361
        <span class="quote">&#8220;<span class="quote">Xprint</span>&#8221;</span> project has been under development, attempting to build printing support into the X
362
362
        framework, including a PostScript and a PCL driver, but it is not yet ready for prime time.) You can see this
363
 
        unfavorable inheritance up to the present day by looking into the various &#8220;<span class="quote">font</span>&#8221; directories on
 
363
        unfavorable inheritance up to the present day by looking into the various <span class="quote">&#8220;<span class="quote">font</span>&#8221;</span> directories on
364
364
        your system; there are separate ones for fonts used for X display and fonts to be used on paper.
365
 
        </p><p><b>Background.�</b>
366
 
        <a class="indexterm" name="id2635299"></a>
367
 
<a class="indexterm" name="id2635306"></a>
368
 
<a class="indexterm" name="id2635313"></a>
369
 
<a class="indexterm" name="id2635319"></a>
370
 
<a class="indexterm" name="id2635326"></a>
371
 
<a class="indexterm" name="id2635333"></a>
372
 
<a class="indexterm" name="id2635340"></a>
373
 
<a class="indexterm" name="id2635347"></a>
374
 
<a class="indexterm" name="id2635354"></a>
375
 
<a class="indexterm" name="id2635360"></a>
376
 
        The PostScript programming language is an &#8220;<span class="quote">invention</span>&#8221; by Adobe, but its specifications have been
 
365
        </p><p title="Background"><b>Background.�</b>
 
366
        <a class="indexterm" name="id2641391"></a>
 
367
<a class="indexterm" name="id2641398"></a>
 
368
<a class="indexterm" name="id2641405"></a>
 
369
<a class="indexterm" name="id2641412"></a>
 
370
<a class="indexterm" name="id2641419"></a>
 
371
<a class="indexterm" name="id2641425"></a>
 
372
<a class="indexterm" name="id2641432"></a>
 
373
<a class="indexterm" name="id2641439"></a>
 
374
<a class="indexterm" name="id2641446"></a>
 
375
<a class="indexterm" name="id2641453"></a>
 
376
        The PostScript programming language is an <span class="quote">&#8220;<span class="quote">invention</span>&#8221;</span> by Adobe, but its specifications have been
377
377
        published extensively. Its strength lies in its powerful abilities to describe graphical objects (fonts,
378
378
        shapes, patterns, lines, curves, and dots), their attributes (color, linewidth), and the way to manipulate
379
379
        (scale, distort, rotate, shift) them. Because of its open specification, anybody with the skill can start
380
380
        writing his or her own implementation of a PostScript interpreter and use it to display PostScript files on
381
 
        screen or on paper. Most graphical output devices are based on the concept of &#8220;<span class="quote">raster images</span>&#8221; or
382
 
        &#8220;<span class="quote">pixels</span>&#8221; (one notable exception is pen plotters). Of course, you can look at a PostScript file in
 
381
        screen or on paper. Most graphical output devices are based on the concept of <span class="quote">&#8220;<span class="quote">raster images</span>&#8221;</span> or
 
382
        <span class="quote">&#8220;<span class="quote">pixels</span>&#8221;</span> (one notable exception is pen plotters). Of course, you can look at a PostScript file in
383
383
        its textual form and you will be reading its PostScript code, the language instructions that need to be
384
384
        interpreted by a rasterizer. Rasterizers produce pixel images, which may be displayed on screen by a viewer
385
385
        program or on paper by a printer.
386
 
        </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><p>
387
 
        <a class="indexterm" name="id2635410"></a>
388
 
        <a class="indexterm" name="id2635417"></a>
389
 
        <a class="indexterm" name="id2635426"></a>
390
 
<a class="indexterm" name="id2635435"></a>
391
 
<a class="indexterm" name="id2635442"></a>
 
386
        </p></div><div class="sect2" title="PostScript and Ghostscript"><div class="titlepage"><div><div><h3 class="title"><a name="post-and-ghost"></a>PostScript and Ghostscript</h3></div></div></div><p>
 
387
        <a class="indexterm" name="id2641503"></a>
 
388
        <a class="indexterm" name="id2641509"></a>
 
389
        <a class="indexterm" name="id2641519"></a>
 
390
<a class="indexterm" name="id2641528"></a>
 
391
<a class="indexterm" name="id2641535"></a>
392
392
        So UNIX is lacking a common ground for printing on paper and displaying on screen. Despite this unfavorable
393
393
        legacy for UNIX, basic printing is fairly easy if you have PostScript printers at your disposal. The reason is
394
 
        that these devices have a built-in PostScript language &#8220;<span class="quote">interpreter,</span>&#8221; also called a raster image
 
394
        that these devices have a built-in PostScript language <span class="quote">&#8220;<span class="quote">interpreter,</span>&#8221;</span> also called a raster image
395
395
        processor (RIP), (which makes them more expensive than other types of printers; throw PostScript toward them,
396
396
        and they will spit out your printed pages. The RIP does all the hard work of converting the PostScript drawing
397
397
        commands into a bitmap picture as you see it on paper, in a resolution as done by your printer. This is no
398
398
        different than PostScript printing a file from a Windows origin.
399
 
        </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
400
 
        <a class="indexterm" name="id2635471"></a>
401
 
<a class="indexterm" name="id2635478"></a>
402
 
<a class="indexterm" name="id2635485"></a>
 
399
        </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
 
400
        <a class="indexterm" name="id2641564"></a>
 
401
<a class="indexterm" name="id2641570"></a>
 
402
<a class="indexterm" name="id2641577"></a>
403
403
        Traditional UNIX programs and printing systems  while using PostScript  are largely not
404
 
        PPD-aware. PPDs are &#8220;<span class="quote">PostScript Printer Description</span>&#8221; files. They enable you to specify and
 
404
        PPD-aware. PPDs are <span class="quote">&#8220;<span class="quote">PostScript Printer Description</span>&#8221;</span> files. They enable you to specify and
405
405
        control all options a printer supports: duplexing, stapling, and punching. Therefore, UNIX users for a long
406
406
        time couldn't choose many of the supported device and job options, unlike Windows or Apple users. But now
407
407
        there is CUPS. as illustrated in <a class="link" href="CUPS-printing.html#2small" title="Figure�22.2.�Printing to a PostScript Printer.">Printing to a PostScript Printer</a>.
408
408
        </p></div><div class="figure"><a name="2small"></a><p class="title"><b>Figure�22.2.�Printing to a PostScript Printer.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/2small.png" alt="Printing to a PostScript Printer."></div></div></div><br class="figure-break"><p>
409
 
        <a class="indexterm" name="id2635563"></a>
 
409
        <a class="indexterm" name="id2641656"></a>
410
410
        However, there are other types of printers out there. These do not know how to print PostScript. They use
411
411
        their own PDL, often proprietary. To print to them is much more demanding. Since your UNIX applications mostly
412
412
        produce PostScript, and since these devices do not understand PostScript, you need to convert the print files
413
413
        to a format suitable for your printer on the host before you can send it away.
414
 
        </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2635579"></a>Ghostscript: The Software RIP for Non-PostScript Printers</h3></div></div></div><p>
415
 
        <a class="indexterm" name="id2635588"></a>
 
414
        </p></div><div class="sect2" title="Ghostscript: The Software RIP for Non-PostScript Printers"><div class="titlepage"><div><div><h3 class="title"><a name="id2641672"></a>Ghostscript: The Software RIP for Non-PostScript Printers</h3></div></div></div><p>
 
415
        <a class="indexterm" name="id2641680"></a>
416
416
        Here is where Ghostscript kicks in. Ghostscript is the traditional (and quite powerful) PostScript interpreter
417
417
        used on UNIX platforms. It is a RIP in software, capable of doing a <span class="emphasis"><em>lot</em></span> of file format
418
418
        conversions for a very broad spectrum of hardware devices as well as software file formats.  Ghostscript
419
419
        technology and drivers are what enable PostScript printing to non-PostScript hardware. This is shown in
420
420
        <a class="link" href="CUPS-printing.html#3small" title="Figure�22.3.�Ghostscript as a RIP for Non-PostScript Printers.">Ghostscript as a RIP for Non-PostScript Printers</a>.
421
 
        </p><div class="figure"><a name="3small"></a><p class="title"><b>Figure�22.3.�Ghostscript as a RIP for Non-PostScript Printers.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/3small.png" alt="Ghostscript as a RIP for Non-PostScript Printers."></div></div></div><br class="figure-break"><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>
422
 
<a class="indexterm" name="id2635659"></a>
423
 
<a class="indexterm" name="id2635665"></a>
424
 
<a class="indexterm" name="id2635672"></a>
425
 
        Use the &#8220;<span class="quote">gs -h</span>&#8221; command to check for all built-in &#8220;<span class="quote">devices</span>&#8221; on your Ghostscript
 
421
        </p><div class="figure"><a name="3small"></a><p class="title"><b>Figure�22.3.�Ghostscript as a RIP for Non-PostScript Printers.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/3small.png" alt="Ghostscript as a RIP for Non-PostScript Printers."></div></div></div><br class="figure-break"><div class="tip" title="Tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>
 
422
<a class="indexterm" name="id2641751"></a>
 
423
<a class="indexterm" name="id2641758"></a>
 
424
<a class="indexterm" name="id2641764"></a>
 
425
        Use the <span class="quote">&#8220;<span class="quote">gs -h</span>&#8221;</span> command to check for all built-in <span class="quote">&#8220;<span class="quote">devices</span>&#8221;</span> on your Ghostscript
426
426
        version. If you specify a parameter of <em class="parameter"><code>-sDEVICE=png256</code></em> on your Ghostscript command
427
 
        line, you are asking Ghostscript to convert the input into a PNG file. Naming a &#8220;<span class="quote">device</span>&#8221; on the
 
427
        line, you are asking Ghostscript to convert the input into a PNG file. Naming a <span class="quote">&#8220;<span class="quote">device</span>&#8221;</span> on the
428
428
        command line is the most important single parameter to tell Ghostscript exactly how it should render the
429
429
        input. New Ghostscript versions are released at fairly regular intervals, now by artofcode LLC. They are
430
 
        initially put under the &#8220;<span class="quote">AFPL</span>&#8221; license, but re-released under the GNU GPL as soon as the next
 
430
        initially put under the <span class="quote">&#8220;<span class="quote">AFPL</span>&#8221;</span> license, but re-released under the GNU GPL as soon as the next
431
431
        AFPL version appears. GNU Ghostscript is probably the version installed on most Samba systems. But it has some
432
 
        deficiencies.  <a class="indexterm" name="id2635710"></a> Therefore, ESP Ghostscript was developed as an enhancement over GNU Ghostscript,
 
432
        deficiencies.  <a class="indexterm" name="id2641803"></a> Therefore, ESP Ghostscript was developed as an enhancement over GNU Ghostscript,
433
433
        with lots of bug-fixes, additional devices, and improvements. It is jointly maintained by developers from
434
 
        CUPS, Gutenprint, MandrakeSoft, SuSE, Red Hat, and Debian. It includes the &#8220;<span class="quote">cups</span>&#8221; device
 
434
        CUPS, Gutenprint, MandrakeSoft, SuSE, Red Hat, and Debian. It includes the <span class="quote">&#8220;<span class="quote">cups</span>&#8221;</span> device
435
435
        (essential to print to non-PS printers from CUPS).
436
 
        </p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2635733"></a>PostScript Printer Description (PPD) Specification</h3></div></div></div><p>
437
 
        <a class="indexterm" name="id2635742"></a>
438
 
<a class="indexterm" name="id2635748"></a>
439
 
<a class="indexterm" name="id2635755"></a>
 
436
        </p></div></div><div class="sect2" title="PostScript Printer Description (PPD) Specification"><div class="titlepage"><div><div><h3 class="title"><a name="id2641826"></a>PostScript Printer Description (PPD) Specification</h3></div></div></div><p>
 
437
        <a class="indexterm" name="id2641834"></a>
 
438
<a class="indexterm" name="id2641841"></a>
 
439
<a class="indexterm" name="id2641847"></a>
440
440
        While PostScript in essence is a PDL to represent the page layout in a device-independent way, real-world
441
441
        print jobs are always ending up being output on hardware with device-specific features. To take care of all
442
442
        the differences in hardware and to allow for innovations, Adobe has specified a syntax and file format for
457
457
        user selections are somehow written (in the form of special
458
458
        PostScript, PJL, JCL, or vendor-dependent commands) into the PostScript
459
459
        file created by the driver.
460
 
        </p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>
461
 
        <a class="indexterm" name="id2635795"></a>
462
 
<a class="indexterm" name="id2635801"></a>
 
460
        </p><div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>
 
461
        <a class="indexterm" name="id2641887"></a>
 
462
<a class="indexterm" name="id2641894"></a>
463
463
        A PostScript file that was created to contain device-specific commands
464
464
        for achieving a certain print job output (e.g., duplexed, stapled, and
465
465
        punched) on a specific target machine may not print as expected, or
466
466
        may not be printable at all on other models; it also may not be fit
467
467
        for further processing by software (e.g., by a PDF distilling program).
468
 
        </p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2635816"></a>Using Windows-Formatted Vendor PPDs</h3></div></div></div><p>
469
 
<a class="indexterm" name="id2635824"></a>
470
 
<a class="indexterm" name="id2635831"></a>
471
 
<a class="indexterm" name="id2635838"></a>
 
468
        </p></div></div><div class="sect2" title="Using Windows-Formatted Vendor PPDs"><div class="titlepage"><div><div><h3 class="title"><a name="id2641909"></a>Using Windows-Formatted Vendor PPDs</h3></div></div></div><p>
 
469
<a class="indexterm" name="id2641917"></a>
 
470
<a class="indexterm" name="id2641924"></a>
 
471
<a class="indexterm" name="id2641930"></a>
472
472
        CUPS can handle all spec-compliant PPDs as supplied by the manufacturers for their PostScript models. Even if
473
473
        a vendor does not mention our favorite OS in his or her manuals and brochures, you can safely trust this:
474
474
        <span class="emphasis"><em>If you get the Windows NT version of the PPD, you can use it unchanged in CUPS</em></span> and thus
475
475
        access the full power of your printer just like a Windows NT user could!
476
 
        </p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>
 
476
        </p><div class="tip" title="Tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>
477
477
        To check the spec compliance of any PPD online, go to <a class="ulink" href="http://www.cups.org/testppd.php" target="_top">http://www.cups.org/testppd.php</a> and upload your PPD. You will
478
478
        see the results displayed immediately. CUPS in all versions after 1.1.19 has a much stricter internal PPD
479
479
        parsing and checking code enabled; in case of printing trouble, this online resource should be one of your
480
480
        first pit stops.
481
 
        </p></div><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>
482
 
        <a class="indexterm" name="id2635878"></a>
483
 
        <a class="indexterm" name="id2635884"></a>
 
481
        </p></div><div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>
 
482
        <a class="indexterm" name="id2641970"></a>
 
483
        <a class="indexterm" name="id2641977"></a>
484
484
        For real PostScript printers, <span class="emphasis"><em>do not</em></span> use the <span class="emphasis"><em>Foomatic</em></span> or
485
485
        <span class="emphasis"><em>cupsomatic</em></span> PPDs from Linuxprinting.org. With these devices, the original vendor-provided
486
486
        PPDs are always the first choice.
487
 
        </p></div><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>
488
 
<a class="indexterm" name="id2635909"></a>
 
487
        </p></div><div class="tip" title="Tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>
 
488
<a class="indexterm" name="id2642002"></a>
489
489
        If you are looking for an original vendor-provided PPD of a specific device, and you know that an NT4 box (or
490
490
        any other Windows box) on your LAN has the PostScript driver installed, just use <code class="literal">smbclient
491
491
        //NT4-box/print\$ -U username</code> to access the Windows directory where all printer driver files are
492
492
        stored. First look in the <code class="filename">W32X86/2</code> subdirectory for the PPD you are seeking.
493
 
        </p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2635936"></a>CUPS Also Uses PPDs for Non-PostScript Printers</h3></div></div></div><p>
494
 
<a class="indexterm" name="id2635944"></a>
495
 
<a class="indexterm" name="id2635951"></a>
496
 
<a class="indexterm" name="id2635958"></a>
 
493
        </p></div></div><div class="sect2" title="CUPS Also Uses PPDs for Non-PostScript Printers"><div class="titlepage"><div><div><h3 class="title"><a name="id2642028"></a>CUPS Also Uses PPDs for Non-PostScript Printers</h3></div></div></div><p>
 
494
<a class="indexterm" name="id2642037"></a>
 
495
<a class="indexterm" name="id2642044"></a>
 
496
<a class="indexterm" name="id2642050"></a>
497
497
        CUPS also uses specially crafted PPDs to handle non-PostScript printers. These PPDs are usually not available
498
498
        from the vendors (and no, you can't just take the PPD of a PostScript printer with the same model name and
499
499
        hope it works for the non-PostScript version too). To understand how these PPDs work for non-PS printers, we
500
500
        first need to dive deeply into the CUPS filtering and file format conversion architecture. Stay tuned.
501
 
        </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2635975"></a>The CUPS Filtering Architecture</h2></div></div></div><p>
502
 
<a class="indexterm" name="id2635984"></a>
503
 
<a class="indexterm" name="id2635990"></a>
504
 
<a class="indexterm" name="id2635997"></a>
505
 
<a class="indexterm" name="id2636004"></a>
506
 
<a class="indexterm" name="id2636011"></a>
 
501
        </p></div></div><div class="sect1" title="The CUPS Filtering Architecture"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2642068"></a>The CUPS Filtering Architecture</h2></div></div></div><p>
 
502
<a class="indexterm" name="id2642076"></a>
 
503
<a class="indexterm" name="id2642083"></a>
 
504
<a class="indexterm" name="id2642090"></a>
 
505
<a class="indexterm" name="id2642096"></a>
 
506
<a class="indexterm" name="id2642103"></a>
507
507
The core of the CUPS filtering system is based on Ghostscript. In addition to Ghostscript, CUPS uses some
508
508
other filters of its own. You (or your OS vendor) may have plugged in even more filters. CUPS handles all data
509
509
file formats under the label of various MIME types. Every incoming print file is subjected to an initial
513
513
given input data format.
514
514
</p><p>
515
515
If CUPS rasterizes a PostScript file natively to a bitmap, this is done in two stages:
516
 
</p><div class="itemizedlist"><ul type="disc"><li><p>
517
 
<a class="indexterm" name="id2636041"></a>
518
 
<a class="indexterm" name="id2636048"></a>
519
 
        The first stage uses a Ghostscript device named &#8220;<span class="quote">cups</span>&#8221;
 
516
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
 
517
<a class="indexterm" name="id2642133"></a>
 
518
<a class="indexterm" name="id2642140"></a>
 
519
        The first stage uses a Ghostscript device named <span class="quote">&#8220;<span class="quote">cups</span>&#8221;</span>
520
520
        (this is since version 1.1.15) and produces a generic raster format
521
 
        called &#8220;<span class="quote">CUPS raster</span>&#8221;.
522
 
        </p></li><li><p>
523
 
<a class="indexterm" name="id2636068"></a>
524
 
        The second stage uses a &#8220;<span class="quote">raster driver</span>&#8221; that converts
 
521
        called <span class="quote">&#8220;<span class="quote">CUPS raster</span>&#8221;</span>.
 
522
        </p></li><li class="listitem"><p>
 
523
<a class="indexterm" name="id2642160"></a>
 
524
        The second stage uses a <span class="quote">&#8220;<span class="quote">raster driver</span>&#8221;</span> that converts
525
525
        the generic CUPS raster to a device-specific raster.
526
526
        </p></li></ul></div><p>
527
 
<a class="indexterm" name="id2636085"></a>
528
 
<a class="indexterm" name="id2636092"></a>
529
 
<a class="indexterm" name="id2636098"></a>
530
 
Make sure your Ghostscript version has the &#8220;<span class="quote">cups</span>&#8221; device compiled in (check with <code class="literal">gs -h |
 
527
<a class="indexterm" name="id2642177"></a>
 
528
<a class="indexterm" name="id2642184"></a>
 
529
<a class="indexterm" name="id2642191"></a>
 
530
Make sure your Ghostscript version has the <span class="quote">&#8220;<span class="quote">cups</span>&#8221;</span> device compiled in (check with <code class="literal">gs -h |
531
531
grep cups</code>). Otherwise you may encounter the dreaded <code class="computeroutput">Unable to convert file
532
 
0</code> in your CUPS error_log file. To have &#8220;<span class="quote">cups</span>&#8221; as a device in your Ghostscript,
 
532
0</code> in your CUPS error_log file. To have <span class="quote">&#8220;<span class="quote">cups</span>&#8221;</span> as a device in your Ghostscript,
533
533
you either need to patch GNU Ghostscript and recompile or use
534
 
<a class="indexterm" name="id2636129"></a><a class="ulink" href="http://www.cups.org/ghostscript.php" target="_top">ESP Ghostscript</a>. The superior alternative is ESP
 
534
<a class="indexterm" name="id2642222"></a><a class="ulink" href="http://www.cups.org/ghostscript.php" target="_top">ESP Ghostscript</a>. The superior alternative is ESP
535
535
Ghostscript. It supports not just CUPS, but 300 other devices (while GNU Ghostscript supports only about 180).
536
536
Because of this broad output device support, ESP Ghostscript is the first choice for non-CUPS spoolers, too.
537
537
It is now recommended by Linuxprinting.org for all spoolers.
538
538
</p><p>
539
 
<a class="indexterm" name="id2636152"></a>
540
 
<a class="indexterm" name="id2636159"></a>
541
 
<a class="indexterm" name="id2636165"></a>
542
 
<a class="indexterm" name="id2636172"></a>
 
539
<a class="indexterm" name="id2642244"></a>
 
540
<a class="indexterm" name="id2642251"></a>
 
541
<a class="indexterm" name="id2642258"></a>
 
542
<a class="indexterm" name="id2642265"></a>
543
543
CUPS printers may be set up to use external rendering paths. One of the most common is provided by the
544
544
Foomatic/cupsomatic concept from <a class="ulink" href="http://www.linuxprinting.org/" target="_top">Linuxprinting.org</a>. This
545
545
uses the classical Ghostscript approach, doing everything in one step.  It does not use the
546
 
&#8220;<span class="quote">cups</span>&#8221; device, but one of the many others. However, even for Foomatic/cupsomatic usage, best
547
 
results and <a class="indexterm" name="id2636195"></a> broadest printer
 
546
<span class="quote">&#8220;<span class="quote">cups</span>&#8221;</span> device, but one of the many others. However, even for Foomatic/cupsomatic usage, best
 
547
results and <a class="indexterm" name="id2642287"></a> broadest printer
548
548
model support is provided by ESP Ghostscript (more about Foomatic/cupsomatic, particularly the new version
549
549
called now <span class="emphasis"><em>foomatic-rip</em></span>, follows).
550
 
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2636211"></a>MIME Types and CUPS Filters</h3></div></div></div><p>
551
 
        <a class="indexterm" name="id2636219"></a>
552
 
        <a class="indexterm" name="id2636228"></a>
553
 
<a class="indexterm" name="id2636235"></a>
554
 
<a class="indexterm" name="id2636242"></a>
555
 
<a class="indexterm" name="id2636249"></a>
 
550
</p><div class="sect2" title="MIME Types and CUPS Filters"><div class="titlepage"><div><div><h3 class="title"><a name="id2642304"></a>MIME Types and CUPS Filters</h3></div></div></div><p>
 
551
        <a class="indexterm" name="id2642312"></a>
 
552
        <a class="indexterm" name="id2642321"></a>
 
553
<a class="indexterm" name="id2642328"></a>
 
554
<a class="indexterm" name="id2642334"></a>
 
555
<a class="indexterm" name="id2642341"></a>
556
556
        CUPS reads the file <code class="filename">/etc/cups/mime.types</code> (and all other files carrying a
557
557
        <code class="filename">*.types</code> suffix in the same directory) upon startup. These files contain the MIME type
558
558
        recognition rules that are applied when CUPS runs its autotyping routines. The rule syntax is explained in the
559
559
        man page for <code class="filename">mime.types</code> and in the comments section of the
560
560
        <code class="filename">mime.types</code> file itself. A simple rule reads like this:
561
 
        <a class="indexterm" name="id2636286"></a>
 
561
        <a class="indexterm" name="id2642378"></a>
562
562
</p><pre class="programlisting">
563
563
application/pdf         pdf string(0,%PDF)
564
564
</pre><p>
565
 
<a class="indexterm" name="id2636299"></a>
566
 
<a class="indexterm" name="id2636306"></a>
 
565
<a class="indexterm" name="id2642391"></a>
 
566
<a class="indexterm" name="id2642398"></a>
567
567
        This means if a filename has a <code class="filename">.pdf</code> suffix or if the magic string
568
568
        <span class="emphasis"><em>%PDF</em></span> is right at the beginning of the file itself (offset 0 from the start), then it is a
569
569
        PDF file (<em class="parameter"><code>application/pdf</code></em>).  Another rule is this:
570
570
</p><pre class="programlisting">
571
571
application/postscript  ai eps ps string(0,%!) string(0,&lt;04&gt;%!)
572
572
</pre><p>
573
 
<a class="indexterm" name="id2636339"></a>
574
 
<a class="indexterm" name="id2636346"></a>
575
 
<a class="indexterm" name="id2636353"></a>
576
 
<a class="indexterm" name="id2636360"></a>
577
 
<a class="indexterm" name="id2636366"></a>
578
 
<a class="indexterm" name="id2636373"></a>
 
573
<a class="indexterm" name="id2642431"></a>
 
574
<a class="indexterm" name="id2642438"></a>
 
575
<a class="indexterm" name="id2642445"></a>
 
576
<a class="indexterm" name="id2642452"></a>
 
577
<a class="indexterm" name="id2642459"></a>
 
578
<a class="indexterm" name="id2642466"></a>
579
579
        If the filename has one of the suffixes <code class="filename">.ai</code>, <code class="filename">.eps</code>,
580
580
        <code class="filename">.ps</code>, or if the file itself starts with one of the strings <span class="emphasis"><em>%!</em></span> or
581
581
        <span class="emphasis"><em>&lt;04&gt;%!</em></span>, it is a generic PostScript file
582
582
        (<em class="parameter"><code>application/postscript</code></em>).
583
 
        </p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>
584
 
<a class="indexterm" name="id2636418"></a>
 
583
        </p><div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>
 
584
<a class="indexterm" name="id2642510"></a>
585
585
        Don't confuse the other mime.types files your system might be using
586
586
        with the one in the <code class="filename">/etc/cups/</code> directory.
587
 
        </p></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
588
 
<a class="indexterm" name="id2636436"></a>
589
 
<a class="indexterm" name="id2636444"></a>
590
 
<a class="indexterm" name="id2636450"></a>
591
 
<a class="indexterm" name="id2636457"></a>
592
 
<a class="indexterm" name="id2636464"></a>
 
587
        </p></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
 
588
<a class="indexterm" name="id2642529"></a>
 
589
<a class="indexterm" name="id2642536"></a>
 
590
<a class="indexterm" name="id2642543"></a>
 
591
<a class="indexterm" name="id2642550"></a>
 
592
<a class="indexterm" name="id2642556"></a>
593
593
        There is an important difference between two similar MIME types in CUPS: one is
594
594
        <em class="parameter"><code>application/postscript</code></em>, the other is
595
595
        <em class="parameter"><code>application/vnd.cups-postscript</code></em>. While <em class="parameter"><code>application/postscript</code></em> is
600
600
        (<em class="parameter"><code>application/vnd.cups-postscript</code></em>) is the responsibility of the CUPS
601
601
        <em class="parameter"><code>pstops</code></em> filter. pstops uses information contained in the PPD to do the transformation.
602
602
        </p></div><p>
603
 
<a class="indexterm" name="id2636526"></a>
604
 
<a class="indexterm" name="id2636533"></a>
605
 
<a class="indexterm" name="id2636540"></a>
606
 
<a class="indexterm" name="id2636546"></a>
607
 
<a class="indexterm" name="id2636553"></a>
608
 
<a class="indexterm" name="id2636560"></a>
609
 
<a class="indexterm" name="id2636566"></a>
610
 
<a class="indexterm" name="id2636573"></a>
611
 
<a class="indexterm" name="id2636580"></a>
612
 
<a class="indexterm" name="id2636586"></a>
613
 
<a class="indexterm" name="id2636593"></a>
614
 
<a class="indexterm" name="id2636600"></a>
615
 
<a class="indexterm" name="id2636607"></a>
616
 
<a class="indexterm" name="id2636614"></a>
617
 
<a class="indexterm" name="id2636621"></a>
618
 
<a class="indexterm" name="id2636627"></a>
 
603
<a class="indexterm" name="id2642619"></a>
 
604
<a class="indexterm" name="id2642625"></a>
 
605
<a class="indexterm" name="id2642632"></a>
 
606
<a class="indexterm" name="id2642639"></a>
 
607
<a class="indexterm" name="id2642646"></a>
 
608
<a class="indexterm" name="id2642652"></a>
 
609
<a class="indexterm" name="id2642659"></a>
 
610
<a class="indexterm" name="id2642665"></a>
 
611
<a class="indexterm" name="id2642672"></a>
 
612
<a class="indexterm" name="id2642679"></a>
 
613
<a class="indexterm" name="id2642686"></a>
 
614
<a class="indexterm" name="id2642692"></a>
 
615
<a class="indexterm" name="id2642699"></a>
 
616
<a class="indexterm" name="id2642706"></a>
 
617
<a class="indexterm" name="id2642713"></a>
 
618
<a class="indexterm" name="id2642720"></a>
619
619
        CUPS can handle ASCII text, HP-GL, PDF, PostScript, DVI, and
620
620
        many image formats (GIF, PNG, TIFF, JPEG, Photo-CD, SUN-Raster,
621
621
        PNM, PBM, SGI-RGB, and more) and their associated MIME types
622
622
        with its filters.
623
 
        </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2636640"></a>MIME Type Conversion Rules</h3></div></div></div><p>
624
 
        <a class="indexterm" name="id2636648"></a>
625
 
        <a class="indexterm" name="id2636655"></a>
626
 
<a class="indexterm" name="id2636662"></a>
627
 
<a class="indexterm" name="id2636669"></a>
628
 
<a class="indexterm" name="id2636676"></a>
 
623
        </p></div><div class="sect2" title="MIME Type Conversion Rules"><div class="titlepage"><div><div><h3 class="title"><a name="id2642732"></a>MIME Type Conversion Rules</h3></div></div></div><p>
 
624
        <a class="indexterm" name="id2642740"></a>
 
625
        <a class="indexterm" name="id2642747"></a>
 
626
<a class="indexterm" name="id2642754"></a>
 
627
<a class="indexterm" name="id2642761"></a>
 
628
<a class="indexterm" name="id2642768"></a>
629
629
        CUPS reads the file <code class="filename">/etc/cups/mime.convs</code>
630
630
        (and all other files named with a <code class="filename">*.convs</code>
631
631
        suffix in the same directory) upon startup. These files contain
636
636
</p><pre class="programlisting">
637
637
application/pdf         application/postscript   33   pdftops
638
638
</pre><p>
639
 
<a class="indexterm" name="id2636708"></a>
 
639
<a class="indexterm" name="id2642800"></a>
640
640
        This means that the <em class="parameter"><code>pdftops</code></em> filter will take
641
641
        <em class="parameter"><code>application/pdf</code></em> as input and produce
642
642
        <em class="parameter"><code>application/postscript</code></em> as output; the virtual
643
643
        cost of this operation is 33 CUPS-$. The next filter is more
644
644
        expensive, costing 66 CUPS-$:
645
 
        <a class="indexterm" name="id2636736"></a>
 
645
        <a class="indexterm" name="id2642828"></a>
646
646
</p><pre class="programlisting">
647
647
application/vnd.hp-HPGL application/postscript   66   hpgltops
648
648
</pre><p>
649
 
<a class="indexterm" name="id2636749"></a>
 
649
<a class="indexterm" name="id2642842"></a>
650
650
        This is the <em class="parameter"><code>hpgltops</code></em>, which processes HP-GL
651
651
        plotter files to PostScript.
652
 
        <a class="indexterm" name="id2636763"></a>
 
652
        <a class="indexterm" name="id2642856"></a>
653
653
</p><pre class="programlisting">
654
654
application/octet-stream
655
655
</pre><p>
656
656
        Here are two more examples: 
657
 
        <a class="indexterm" name="id2636777"></a>
658
 
<a class="indexterm" name="id2636784"></a>
659
 
<a class="indexterm" name="id2636791"></a>
660
 
<a class="indexterm" name="id2636798"></a>
 
657
        <a class="indexterm" name="id2642870"></a>
 
658
<a class="indexterm" name="id2642876"></a>
 
659
<a class="indexterm" name="id2642883"></a>
 
660
<a class="indexterm" name="id2642890"></a>
661
661
</p><pre class="programlisting">
662
662
application/x-shell     application/postscript   33    texttops
663
663
text/plain              application/postscript   33    texttops
664
664
</pre><p>
665
 
<a class="indexterm" name="id2636812"></a>
 
665
<a class="indexterm" name="id2642905"></a>
666
666
        The last two examples name the <em class="parameter"><code>texttops</code></em> filter to work on
667
667
        <em class="parameter"><code>text/plain</code></em> as well as on <em class="parameter"><code>application/x-shell</code></em>. (Hint: This
668
668
        differentiation is needed for the syntax highlighting feature of <em class="parameter"><code>texttops</code></em>).
669
 
        </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2636848"></a>Filtering  Overview</h3></div></div></div><p>
670
 
        <a class="indexterm" name="id2636856"></a>
 
669
        </p></div><div class="sect2" title="Filtering Overview"><div class="titlepage"><div><div><h3 class="title"><a name="id2642940"></a>Filtering  Overview</h3></div></div></div><p>
 
670
        <a class="indexterm" name="id2642948"></a>
671
671
        There are many more combinations named in <code class="filename">mime.convs</code>. However, you are not limited to use
672
672
        the ones predefined there. You can plug in any filter you like to the CUPS framework. It must meet, or must be
673
673
        made to meet, some minimal requirements. If you find (or write) a cool conversion filter of some kind, make
674
674
        sure it complies with what CUPS needs and put in the right lines in <code class="filename">mime.types</code> and
675
675
        <code class="filename">mime.convs</code>; then it will work seamlessly inside CUPS.
676
 
        </p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2636888"></a>Filter Requirements</h4></div></div></div><p>
677
 
        The &#8220;<span class="quote">CUPS requirements</span>&#8221; for filters are simple. Take filenames or <code class="filename">stdin</code> as
 
676
        </p><div class="sect3" title="Filter Requirements"><div class="titlepage"><div><div><h4 class="title"><a name="id2642981"></a>Filter Requirements</h4></div></div></div><p>
 
677
        The <span class="quote">&#8220;<span class="quote">CUPS requirements</span>&#8221;</span> for filters are simple. Take filenames or <code class="filename">stdin</code> as
678
678
        input and write to <code class="filename">stdout</code>. They should take these arguments:
679
679
        </p><div class="variablelist"><dl><dt><span class="term">printer</span></dt><dd><p>
680
680
                        The name of the printer queue (normally this is the name of the filter being run).
692
692
                        (optionally) The print request file (if missing, filters expect data
693
693
                        fed through <code class="filename">stdin</code>). In most cases, it is easy to
694
694
                        write a simple wrapper script around existing filters to make them work with CUPS.
695
 
                        </p></dd></dl></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2637005"></a>Prefilters</h3></div></div></div><p>
696
 
        <a class="indexterm" name="id2637013"></a>
697
 
<a class="indexterm" name="id2637020"></a>
698
 
<a class="indexterm" name="id2637027"></a>
 
695
                        </p></dd></dl></div></div></div><div class="sect2" title="Prefilters"><div class="titlepage"><div><div><h3 class="title"><a name="id2643098"></a>Prefilters</h3></div></div></div><p>
 
696
        <a class="indexterm" name="id2643105"></a>
 
697
<a class="indexterm" name="id2643112"></a>
 
698
<a class="indexterm" name="id2643119"></a>
699
699
        As previously stated, PostScript is the central file format to any UNIX-based
700
700
        printing system. From PostScript, CUPS generates raster data to feed
701
701
        non-PostScript printers.
702
702
        </p><p>
703
 
<a class="indexterm" name="id2637040"></a>
704
 
<a class="indexterm" name="id2637047"></a>
705
 
<a class="indexterm" name="id2637054"></a>
706
 
<a class="indexterm" name="id2637060"></a>
707
 
<a class="indexterm" name="id2637067"></a>
708
 
<a class="indexterm" name="id2637073"></a>
709
 
<a class="indexterm" name="id2637080"></a>
710
 
<a class="indexterm" name="id2637087"></a>
711
 
<a class="indexterm" name="id2637094"></a>
712
 
<a class="indexterm" name="id2637101"></a>
 
703
<a class="indexterm" name="id2643132"></a>
 
704
<a class="indexterm" name="id2643139"></a>
 
705
<a class="indexterm" name="id2643146"></a>
 
706
<a class="indexterm" name="id2643153"></a>
 
707
<a class="indexterm" name="id2643159"></a>
 
708
<a class="indexterm" name="id2643166"></a>
 
709
<a class="indexterm" name="id2643173"></a>
 
710
<a class="indexterm" name="id2643179"></a>
 
711
<a class="indexterm" name="id2643186"></a>
 
712
<a class="indexterm" name="id2643193"></a>
713
713
        But what happens if you send one of the supported non-PS formats to print? Then CUPS runs
714
 
        &#8220;<span class="quote">prefilters</span>&#8221; on these input formats to generate PostScript first. There are prefilters to create
 
714
        <span class="quote">&#8220;<span class="quote">prefilters</span>&#8221;</span> on these input formats to generate PostScript first. There are prefilters to create
715
715
        PostScript from ASCII text, PDF, DVI, or HP-GL. The outcome of these filters is always of MIME type
716
716
        <em class="parameter"><code>application/postscript</code></em> (meaning that any device-specific print options are not yet
717
717
        embedded into the PostScript by CUPS and that the next filter to be called is pstops). Another prefilter is
719
719
        MIME type <em class="parameter"><code>application/vnd.cups-postscript</code></em> (not application/postscript), meaning it has
720
720
        the print options already embedded into the file. This is shown in <a class="link" href="CUPS-printing.html#4small" title="Figure�22.4.�Prefiltering in CUPS to Form PostScript.">Prefiltering in
721
721
        CUPS to Form PostScript</a>.
722
 
        </p><div class="figure"><a name="4small"></a><p class="title"><b>Figure�22.4.�Prefiltering in CUPS to Form PostScript.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/4small.png" width="135" alt="Prefiltering in CUPS to Form PostScript."></div></div></div><br class="figure-break"></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2637193"></a>pstops</h3></div></div></div><p>
723
 
<a class="indexterm" name="id2637201"></a>
724
 
<a class="indexterm" name="id2637208"></a>
725
 
<a class="indexterm" name="id2637215"></a>
726
 
<a class="indexterm" name="id2637222"></a>
727
 
<a class="indexterm" name="id2637229"></a>
728
 
<a class="indexterm" name="id2637236"></a>
729
 
<a class="indexterm" name="id2637243"></a>
 
722
        </p><div class="figure"><a name="4small"></a><p class="title"><b>Figure�22.4.�Prefiltering in CUPS to Form PostScript.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/4small.png" width="135" alt="Prefiltering in CUPS to Form PostScript."></div></div></div><br class="figure-break"></div><div class="sect2" title="pstops"><div class="titlepage"><div><div><h3 class="title"><a name="id2643286"></a>pstops</h3></div></div></div><p>
 
723
<a class="indexterm" name="id2643294"></a>
 
724
<a class="indexterm" name="id2643300"></a>
 
725
<a class="indexterm" name="id2643307"></a>
 
726
<a class="indexterm" name="id2643315"></a>
 
727
<a class="indexterm" name="id2643322"></a>
 
728
<a class="indexterm" name="id2643328"></a>
 
729
<a class="indexterm" name="id2643335"></a>
730
730
        <span class="emphasis"><em>pstops</em></span> is a filter that is used to convert <em class="parameter"><code>application/postscript</code></em> to
731
731
        <em class="parameter"><code>application/vnd.cups-postscript</code></em>. As stated earlier, this filter inserts all
732
732
        device-specific print options (commands to the printer to ask for the duplexing of output, or stapling and
733
733
        punching it, and so on) into the PostScript file. An example is illustrated in <a class="link" href="CUPS-printing.html#5small" title="Figure�22.5.�Adding Device-Specific Print Options.">Adding Device-Specific Print Options</a>.
734
734
        </p><div class="figure"><a name="5small"></a><p class="title"><b>Figure�22.5.�Adding Device-Specific Print Options.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/5small.png" width="135" alt="Adding Device-Specific Print Options."></div></div></div><br class="figure-break"><p>
735
735
        This is not all. Other tasks performed by it are:
736
 
        </p><div class="itemizedlist"><ul type="disc"><li><p>
 
736
        </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
737
737
                Selecting the range of pages to be printed (e.g., you can choose to
738
 
                print only pages &#8220;<span class="quote">3, 6, 8-11, 16, and 19-21</span>&#8221;, or only odd-numbered
 
738
                print only pages <span class="quote">&#8220;<span class="quote">3, 6, 8-11, 16, and 19-21</span>&#8221;</span>, or only odd-numbered
739
739
                pages).
740
 
                </p></li><li><p>
 
740
                </p></li><li class="listitem"><p>
741
741
                Putting two or more logical pages on one sheet of paper (the
742
 
                so-called &#8220;<span class="quote">number-up</span>&#8221; function).
743
 
                </p></li><li><p>Counting the pages of the job to insert the accounting
 
742
                so-called <span class="quote">&#8220;<span class="quote">number-up</span>&#8221;</span> function).
 
743
                </p></li><li class="listitem"><p>Counting the pages of the job to insert the accounting
744
744
                information into the <code class="filename">/var/log/cups/page_log</code>.
745
 
                </p></li></ul></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2637361"></a>pstoraster</h3></div></div></div><p>
746
 
<a class="indexterm" name="id2637369"></a>
747
 
<a class="indexterm" name="id2637376"></a>
748
 
<a class="indexterm" name="id2637382"></a>
 
745
                </p></li></ul></div></div><div class="sect2" title="pstoraster"><div class="titlepage"><div><div><h3 class="title"><a name="id2643453"></a>pstoraster</h3></div></div></div><p>
 
746
<a class="indexterm" name="id2643461"></a>
 
747
<a class="indexterm" name="id2643468"></a>
 
748
<a class="indexterm" name="id2643475"></a>
749
749
        <em class="parameter"><code>pstoraster</code></em> is at the core of the CUPS filtering system. It is responsible for the first
750
750
        stage of the rasterization process. Its input is of MIME type application/vnd.cups-postscript; its output is
751
751
        application/vnd.cups-raster. This output format is not yet meant to be printable. Its aim is to serve as a
753
753
        generate device-specific printer data. This is shown in <a class="link" href="CUPS-printing.html#cups-raster" title="Figure�22.6.�PostScript to Intermediate Raster Format.">the PostScript to
754
754
        Intermediate Raster Format diagram</a>.
755
755
        </p><div class="figure"><a name="cups-raster"></a><p class="title"><b>Figure�22.6.�PostScript to Intermediate Raster Format.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/6small.png" width="135" alt="PostScript to Intermediate Raster Format."></div></div></div><br class="figure-break"><p>
756
 
<a class="indexterm" name="id2637458"></a>
757
 
<a class="indexterm" name="id2637465"></a>
758
 
<a class="indexterm" name="id2637472"></a>
759
 
<a class="indexterm" name="id2637479"></a>
 
756
<a class="indexterm" name="id2643551"></a>
 
757
<a class="indexterm" name="id2643558"></a>
 
758
<a class="indexterm" name="id2643564"></a>
 
759
<a class="indexterm" name="id2643571"></a>
760
760
        CUPS raster is a generic raster format with powerful features. It is able to include per-page information,
761
761
        color profiles, and more, to be used by the downstream raster drivers. Its MIME type is registered with IANA
762
762
        and its specification is, of course, completely open. It is designed to make it quite easy and inexpensive for
766
766
        raster drivers). This is illustrated in <a class="link" href="CUPS-printing.html#cups-raster2" title="Figure�22.7.�CUPS-Raster Production Using Ghostscript.">the CUPS-Raster Production Using
767
767
        Ghostscript illustration</a>.
768
768
        </p><div class="figure"><a name="cups-raster2"></a><p class="title"><b>Figure�22.7.�CUPS-Raster Production Using Ghostscript.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/7small.png" alt="CUPS-Raster Production Using Ghostscript."></div></div></div><br class="figure-break"><p>
769
 
<a class="indexterm" name="id2637551"></a>
770
 
<a class="indexterm" name="id2637558"></a>
771
 
<a class="indexterm" name="id2637565"></a>
772
 
<a class="indexterm" name="id2637572"></a>
 
769
<a class="indexterm" name="id2643644"></a>
 
770
<a class="indexterm" name="id2643651"></a>
 
771
<a class="indexterm" name="id2643658"></a>
 
772
<a class="indexterm" name="id2643664"></a>
773
773
        CUPS versions before version 1.1.15 shipped a binary (or source code) standalone filter, named
774
774
        <em class="parameter"><code>pstoraster</code></em>. <em class="parameter"><code>pstoraster</code></em>, which was derived from GNU Ghostscript
775
775
        5.50 and could be installed instead of and in addition to any GNU or AFPL Ghostscript package without
780
780
        now a simple shell script calling <code class="literal">gs</code> with the <code class="literal">-sDEVICE=cups</code> parameter.
781
781
        If your Ghostscript fails when this command is executed: <code class="literal">gs -h |grep cups</code>, you might not 
782
782
        be able to print, update your Ghostscript.
783
 
        </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2637630"></a>imagetops and imagetoraster</h3></div></div></div><p>
784
 
<a class="indexterm" name="id2637638"></a>
785
 
<a class="indexterm" name="id2637645"></a>
 
783
        </p></div><div class="sect2" title="imagetops and imagetoraster"><div class="titlepage"><div><div><h3 class="title"><a name="id2643723"></a>imagetops and imagetoraster</h3></div></div></div><p>
 
784
<a class="indexterm" name="id2643731"></a>
 
785
<a class="indexterm" name="id2643738"></a>
786
786
        In the section about prefilters, we mentioned the prefilter
787
787
        that generates PostScript from image formats. The <em class="parameter"><code>imagetoraster</code></em>
788
788
        filter is used to convert directly from image to raster, without the
789
789
        intermediate PostScript stage. It is used more often than the previously
790
790
        mentioned prefilters. We summarize in a flowchart the image file
791
791
        filtering in <a class="link" href="CUPS-printing.html#small8" title="Figure�22.8.�Image Format to CUPS-Raster Format Conversion.">the Image Format to CUPS-Raster Format Conversion illustration</a>.
792
 
        </p><div class="figure"><a name="small8"></a><p class="title"><b>Figure�22.8.�Image Format to CUPS-Raster Format Conversion.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/8small.png" alt="Image Format to CUPS-Raster Format Conversion."></div></div></div><br class="figure-break"></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2637715"></a>rasterto [printers specific]</h3></div></div></div><p>
793
 
<a class="indexterm" name="id2637723"></a>
794
 
<a class="indexterm" name="id2637730"></a>
795
 
<a class="indexterm" name="id2637737"></a>
796
 
<a class="indexterm" name="id2637744"></a>
797
 
<a class="indexterm" name="id2637751"></a>
798
 
<a class="indexterm" name="id2637758"></a>
799
 
<a class="indexterm" name="id2637764"></a>
800
 
<a class="indexterm" name="id2637771"></a>
801
 
<a class="indexterm" name="id2637778"></a>
802
 
<a class="indexterm" name="id2637785"></a>
803
 
<a class="indexterm" name="id2637792"></a>
 
792
        </p><div class="figure"><a name="small8"></a><p class="title"><b>Figure�22.8.�Image Format to CUPS-Raster Format Conversion.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/8small.png" alt="Image Format to CUPS-Raster Format Conversion."></div></div></div><br class="figure-break"></div><div class="sect2" title="rasterto [printers specific]"><div class="titlepage"><div><div><h3 class="title"><a name="id2643807"></a>rasterto [printers specific]</h3></div></div></div><p>
 
793
<a class="indexterm" name="id2643816"></a>
 
794
<a class="indexterm" name="id2643822"></a>
 
795
<a class="indexterm" name="id2643829"></a>
 
796
<a class="indexterm" name="id2643836"></a>
 
797
<a class="indexterm" name="id2643843"></a>
 
798
<a class="indexterm" name="id2643850"></a>
 
799
<a class="indexterm" name="id2643857"></a>
 
800
<a class="indexterm" name="id2643864"></a>
 
801
<a class="indexterm" name="id2643871"></a>
 
802
<a class="indexterm" name="id2643878"></a>
 
803
<a class="indexterm" name="id2643884"></a>
804
804
        CUPS ships with quite a variety of raster drivers for processing CUPS raster. On my system, I find in
805
805
        /usr/lib/cups/filter/ the following: <em class="parameter"><code>rastertoalps</code></em>, <em class="parameter"><code>rastertobj</code></em>,
806
806
        <em class="parameter"><code>rastertoepson</code></em>, <em class="parameter"><code>rastertoescp</code></em>, <em class="parameter"><code>rastertopcl</code></em>,
811
811
        <em class="parameter"><code>rastertoprinter</code></em>) by third-party driver development projects (such as Gutenprint)
812
812
        wanting to cooperate as closely as possible with CUPS. See <a class="link" href="CUPS-printing.html#small9" title="Figure�22.9.�Raster to Printer-Specific Formats.">the Raster to
813
813
        Printer-Specific Formats illustration</a>.
814
 
        </p><div class="figure"><a name="small9"></a><p class="title"><b>Figure�22.9.�Raster to Printer-Specific Formats.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/9small.png" alt="Raster to Printer-Specific Formats."></div></div></div><br class="figure-break"></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2637934"></a>CUPS Backends</h3></div></div></div><p>
815
 
<a class="indexterm" name="id2637942"></a>
816
 
<a class="indexterm" name="id2637949"></a>
 
814
        </p><div class="figure"><a name="small9"></a><p class="title"><b>Figure�22.9.�Raster to Printer-Specific Formats.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/9small.png" alt="Raster to Printer-Specific Formats."></div></div></div><br class="figure-break"></div><div class="sect2" title="CUPS Backends"><div class="titlepage"><div><div><h3 class="title"><a name="id2644027"></a>CUPS Backends</h3></div></div></div><p>
 
815
<a class="indexterm" name="id2644034"></a>
 
816
<a class="indexterm" name="id2644042"></a>
817
817
        The last part of any CUPS filtering chain is a backend. Backends
818
818
        are special programs that send the print-ready file to the final
819
819
        device. There is a separate backend program for any transfer
820
820
        protocol for sending print jobs over the network, and one for every local
821
 
        interface. Every CUPS print queue needs to have a CUPS &#8220;<span class="quote">device-URI</span>&#8221;
 
821
        interface. Every CUPS print queue needs to have a CUPS <span class="quote">&#8220;<span class="quote">device-URI</span>&#8221;</span>
822
822
        associated with it. The device URI is the way to encode the backend
823
823
        used to send the job to its destination. Network device-URIs use
824
824
        two slashes in their syntax, local device URIs only one, as you can
867
867
                This backend sends print files to printers shared by a Windows
868
868
                host. Examples of CUPS device-URIs that may be used includes:
869
869
                </p><p>
870
 
                </p><table class="simplelist" border="0" summary="Simple list"><tr><td><code class="filename">smb://workgroup/server/printersharename</code></td></tr><tr><td><code class="filename">smb://server/printersharename</code></td></tr><tr><td><code class="filename">smb://username:password@workgroup/server/printersharename</code></td></tr><tr><td><code class="filename">smb://username:password@server/printersharename</code></td></tr></table><p>
 
870
                </p><table border="0" summary="Simple list" class="simplelist"><tr><td><code class="filename">smb://workgroup/server/printersharename</code></td></tr><tr><td><code class="filename">smb://server/printersharename</code></td></tr><tr><td><code class="filename">smb://username:password@workgroup/server/printersharename</code></td></tr><tr><td><code class="filename">smb://username:password@server/printersharename</code></td></tr></table><p>
871
871
                </p><p>
872
872
                The smb:// backend is a symlink to the Samba utility
873
873
                <em class="parameter"><code>smbspool</code></em> (does not ship with CUPS). If the
877
877
                </p></dd></dl></div><p>
878
878
        It is easy to write your own backends as shell or Perl scripts if you
879
879
        need any modification or extension to the CUPS print system. One
880
 
        reason could be that you want to create &#8220;<span class="quote">special</span>&#8221; printers that send
881
 
        the print jobs as email (through a &#8220;<span class="quote">mailto:/</span>&#8221; backend), convert them to
882
 
        PDF (through a &#8220;<span class="quote">pdfgen:/</span>&#8221; backend) or dump them to &#8220;<span class="quote">/dev/null</span>&#8221;. (In
 
880
        reason could be that you want to create <span class="quote">&#8220;<span class="quote">special</span>&#8221;</span> printers that send
 
881
        the print jobs as email (through a <span class="quote">&#8220;<span class="quote">mailto:/</span>&#8221;</span> backend), convert them to
 
882
        PDF (through a <span class="quote">&#8220;<span class="quote">pdfgen:/</span>&#8221;</span> backend) or dump them to <span class="quote">&#8220;<span class="quote">/dev/null</span>&#8221;</span>. (In
883
883
        fact, I have the systemwide default printer set up to be connected to
884
884
        a devnull:/ backend: there are just too many people sending jobs
885
885
        without specifying a printer, and scripts and programs that do not name
887
887
        email back to the $USER asking him or her to always specify the correct
888
888
        printer name.)
889
889
        </p><p>
890
 
<a class="indexterm" name="id2638229"></a>
891
 
<a class="indexterm" name="id2638235"></a>
 
890
<a class="indexterm" name="id2644321"></a>
 
891
<a class="indexterm" name="id2644328"></a>
892
892
        Not all of the mentioned backends may be present on your system or
893
893
        usable (depending on your hardware configuration). One test for all
894
894
        available CUPS backends is provided by the <span class="emphasis"><em>lpinfo</em></span>
896
896
        all available backends:
897
897
        </p><pre class="screen">
898
898
        <code class="prompt">$ </code><strong class="userinput"><code>lpinfo -v</code></strong>
899
 
        </pre></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2638273"></a>The Role of <em class="parameter"><code>cupsomatic/foomatic</code></em></h3></div></div></div><p>
900
 
        <a class="indexterm" name="id2638285"></a>
901
 
        <a class="indexterm" name="id2638292"></a>
902
 
<a class="indexterm" name="id2638299"></a>
903
 
<a class="indexterm" name="id2638306"></a>
904
 
<a class="indexterm" name="id2638313"></a>
 
899
        </pre></div><div class="sect2" title="The Role of cupsomatic/foomatic"><div class="titlepage"><div><div><h3 class="title"><a name="id2644365"></a>The Role of <em class="parameter"><code>cupsomatic/foomatic</code></em></h3></div></div></div><p>
 
900
        <a class="indexterm" name="id2644378"></a>
 
901
        <a class="indexterm" name="id2644384"></a>
 
902
<a class="indexterm" name="id2644391"></a>
 
903
<a class="indexterm" name="id2644398"></a>
 
904
<a class="indexterm" name="id2644405"></a>
905
905
        <em class="parameter"><code>cupsomatic</code></em> filters may be the most widely used on CUPS
906
906
        installations. You must be clear that these were not
907
907
        developed by the CUPS people. They are a third-party add-on to
925
925
        autoconstructed from the selected PPD and command line options given to
926
926
        the print job.
927
927
        </p><p>
928
 
        <a class="indexterm" name="id2638379"></a>
929
 
<a class="indexterm" name="id2638386"></a>
930
 
<a class="indexterm" name="id2638393"></a>
931
 
<a class="indexterm" name="id2638400"></a>
932
 
<a class="indexterm" name="id2638407"></a>
933
 
<a class="indexterm" name="id2638414"></a>
934
 
<a class="indexterm" name="id2638420"></a>
935
 
<a class="indexterm" name="id2638427"></a>
936
 
<a class="indexterm" name="id2638434"></a>
937
 
<a class="indexterm" name="id2638441"></a>
938
 
<a class="indexterm" name="id2638448"></a>
 
928
        <a class="indexterm" name="id2644471"></a>
 
929
<a class="indexterm" name="id2644478"></a>
 
930
<a class="indexterm" name="id2644485"></a>
 
931
<a class="indexterm" name="id2644492"></a>
 
932
<a class="indexterm" name="id2644499"></a>
 
933
<a class="indexterm" name="id2644506"></a>
 
934
<a class="indexterm" name="id2644513"></a>
 
935
<a class="indexterm" name="id2644520"></a>
 
936
<a class="indexterm" name="id2644526"></a>
 
937
<a class="indexterm" name="id2644533"></a>
 
938
<a class="indexterm" name="id2644540"></a>
939
939
        However, <em class="parameter"><code>cupsomatic</code></em> is now deprecated. Its PPDs (especially the first
940
940
        generation of them, still in heavy use out there) are not meeting the
941
941
        Adobe specifications. You might also suffer difficulties when you try
942
 
        to download them with &#8220;<span class="quote">Point'n'Print</span>&#8221; to Windows clients. A better
 
942
        to download them with <span class="quote">&#8220;<span class="quote">Point'n'Print</span>&#8221;</span> to Windows clients. A better
943
943
        and more powerful successor is now available: it is called <em class="parameter"><code>foomatic-rip</code></em>. To use
944
944
        <em class="parameter"><code>foomatic-rip</code></em> as a filter with CUPS, you need the new type of PPDs, which
945
945
        have a similar but different line:
957
957
        best thing is that the new <code class="constant">foomatic-rip</code> works seamlessly with all
958
958
        legacy spoolers too (like LPRng, BSD-LPD, PDQ, PPR, and so on), providing
959
959
        for them access to use PPDs for their printing.
960
 
        </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2638508"></a>The Complete Picture</h3></div></div></div><p>
 
960
        </p></div><div class="sect2" title="The Complete Picture"><div class="titlepage"><div><div><h3 class="title"><a name="id2644600"></a>The Complete Picture</h3></div></div></div><p>
961
961
        If you want to see an overview of all the filters and how they
962
962
        relate to each other, the complete picture of the puzzle is at the end
963
963
        of this chapter.
964
 
        </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2638521"></a><code class="filename">mime.convs</code></h3></div></div></div><p>
 
964
        </p></div><div class="sect2" title="mime.convs"><div class="titlepage"><div><div><h3 class="title"><a name="id2644613"></a><code class="filename">mime.convs</code></h3></div></div></div><p>
965
965
        CUPS autoconstructs all possible filtering chain paths for any given
966
966
        MIME type and every printer installed. But how does it decide in
967
967
        favor of or against a specific alternative?  (There may be cases
969
969
        the same target printer.) Simple. You may have noticed the figures in
970
970
        the third column of the mime.convs file. They represent virtual costs
971
971
        assigned to this filter. Every possible filtering chain will sum up to
972
 
        a total &#8220;<span class="quote">filter cost.</span>&#8221; CUPS decides for the most &#8220;<span class="quote">inexpensive</span>&#8221; route.
973
 
        </p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>
974
 
<a class="indexterm" name="id2638552"></a>
975
 
<a class="indexterm" name="id2638559"></a>
 
972
        a total <span class="quote">&#8220;<span class="quote">filter cost.</span>&#8221;</span> CUPS decides for the most <span class="quote">&#8220;<span class="quote">inexpensive</span>&#8221;</span> route.
 
973
        </p><div class="tip" title="Tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>
 
974
<a class="indexterm" name="id2644645"></a>
 
975
<a class="indexterm" name="id2644652"></a>
976
976
        Setting <em class="parameter"><code>FilterLimit 1000</code></em> in
977
977
        <code class="filename">cupsd.conf</code> will not allow more filters to
978
978
        run concurrently than will consume a total of 1000 virtual filter
979
979
        cost. This is an efficient way to limit the load of any CUPS
980
 
        server by setting an appropriate &#8220;<span class="quote">FilterLimit</span>&#8221; value. A FilterLimit of
 
980
        server by setting an appropriate <span class="quote">&#8220;<span class="quote">FilterLimit</span>&#8221;</span> value. A FilterLimit of
981
981
        200 allows roughly one job at a time, while a FilterLimit of 1000 allows
982
982
        approximately five jobs maximum at a time.
983
 
        </p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2638590"></a>&#8220;<span class="quote">Raw</span>&#8221; Printing</h3></div></div></div><p>
984
 
<a class="indexterm" name="id2638599"></a>
985
 
<a class="indexterm" name="id2638606"></a>
986
 
<a class="indexterm" name="id2638613"></a>
987
 
        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 will not be
988
 
        filtered. CUPS will send the file to the printer &#8220;<span class="quote">as is</span>&#8221; without bothering if the printer is able
 
983
        </p></div></div><div class="sect2" title="&#8220;Raw&#8221; Printing"><div class="titlepage"><div><div><h3 class="title"><a name="id2644682"></a><span class="quote">&#8220;<span class="quote">Raw</span>&#8221;</span> Printing</h3></div></div></div><p>
 
984
<a class="indexterm" name="id2644692"></a>
 
985
<a class="indexterm" name="id2644698"></a>
 
986
<a class="indexterm" name="id2644705"></a>
 
987
        You can tell CUPS to print (nearly) any file <span class="quote">&#8220;<span class="quote">raw</span>&#8221;</span>. <span class="quote">&#8220;<span class="quote">Raw</span>&#8221;</span> means it will not be
 
988
        filtered. CUPS will send the file to the printer <span class="quote">&#8220;<span class="quote">as is</span>&#8221;</span> without bothering if the printer is able
989
989
        to digest it. Users need to take care themselves that they send sensible data formats only. Raw printing can
990
 
        happen on any queue if the &#8220;<span class="quote"><em class="parameter"><code>-o raw</code></em></span>&#8221; option is specified on the command
 
990
        happen on any queue if the <span class="quote">&#8220;<span class="quote"><em class="parameter"><code>-o raw</code></em></span>&#8221;</span> option is specified on the command
991
991
        line. You can also set up raw-only queues by simply not associating any PPD with it. This command:
992
992
</p><pre class="screen">
993
993
<code class="prompt">$ </code><strong class="userinput"><code>lpadmin -P rawprinter -v socket://11.12.13.14:9100 -E</code></strong>
994
994
</pre><p>
995
 
        sets up a queue named &#8220;<span class="quote">rawprinter</span>&#8221;, connected via the &#8220;<span class="quote">socket</span>&#8221; protocol (a.k.a.
996
 
        &#8220;<span class="quote">HP JetDirect</span>&#8221;) to the device at IP address 11.12.1.3.14, using port 9100. (If you had added a
 
995
        sets up a queue named <span class="quote">&#8220;<span class="quote">rawprinter</span>&#8221;</span>, connected via the <span class="quote">&#8220;<span class="quote">socket</span>&#8221;</span> protocol (a.k.a.
 
996
        <span class="quote">&#8220;<span class="quote">HP JetDirect</span>&#8221;</span>) to the device at IP address 11.12.1.3.14, using port 9100. (If you had added a
997
997
        PPD with <code class="literal">-P /path/to/PPD</code> to this command line, you would have installed a
998
 
        &#8220;<span class="quote">normal</span>&#8221; print queue.)
 
998
        <span class="quote">&#8220;<span class="quote">normal</span>&#8221;</span> print queue.)
999
999
        </p><p>
1000
 
        CUPS will automatically treat each job sent to a queue as a &#8220;<span class="quote">raw</span>&#8221; one
 
1000
        CUPS will automatically treat each job sent to a queue as a <span class="quote">&#8220;<span class="quote">raw</span>&#8221;</span> one
1001
1001
        if it can't find a PPD associated with the queue. However, CUPS will
1002
1002
        only send known MIME types (as defined in its own mime.types file) and
1003
1003
        refuse others.
1004
 
        </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2638698"></a>application/octet-stream Printing</h3></div></div></div><p>
1005
 
<a class="indexterm" name="id2638706"></a>
1006
 
<a class="indexterm" name="id2638713"></a>
 
1004
        </p></div><div class="sect2" title="application/octet-stream Printing"><div class="titlepage"><div><div><h3 class="title"><a name="id2644790"></a>application/octet-stream Printing</h3></div></div></div><p>
 
1005
<a class="indexterm" name="id2644798"></a>
 
1006
<a class="indexterm" name="id2644805"></a>
1007
1007
        Any MIME type with no rule in the <code class="filename">/etc/cups/mime.types</code> file is regarded as unknown
1008
1008
        or <em class="parameter"><code>application/octet-stream</code></em> and will not be
1009
1009
        sent. Because CUPS refuses to print unknown MIME types by default,
1015
1015
        </code></p><p>
1016
1016
        To enable the printing of <em class="parameter"><code>application/octet-stream</code></em> files, edit
1017
1017
        these two files:
1018
 
        </p><div class="itemizedlist"><ul type="disc"><li><p><code class="filename">/etc/cups/mime.convs</code></p></li><li><p><code class="filename">/etc/cups/mime.types</code></p></li></ul></div><p>
1019
 
<a class="indexterm" name="id2638778"></a>
 
1018
        </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><code class="filename">/etc/cups/mime.convs</code></p></li><li class="listitem"><p><code class="filename">/etc/cups/mime.types</code></p></li></ul></div><p>
 
1019
<a class="indexterm" name="id2644871"></a>
1020
1020
        Both contain entries (at the end of the respective files) that must be uncommented to allow raw mode
1021
1021
        operation for <em class="parameter"><code>application/octet-stream</code></em>. In <code class="filename">/etc/cups/mime.types</code>
1022
1022
        make sure this line is present:
1023
 
        <a class="indexterm" name="id2638800"></a>
 
1023
        <a class="indexterm" name="id2644893"></a>
1024
1024
</p><pre class="programlisting">
1025
1025
application/octet-stream
1026
1026
</pre><p>
1031
1031
</p><pre class="programlisting">
1032
1032
application/octet-stream   application/vnd.cups-raw   0   -
1033
1033
</pre><p>
1034
 
        <a class="indexterm" name="id2638835"></a>
 
1034
        <a class="indexterm" name="id2644927"></a>
1035
1035
        This line tells CUPS to use the <span class="emphasis"><em>Null Filter</em></span>
1036
 
        (denoted as &#8220;<span class="quote">-</span>&#8221;, doing nothing at all) on
 
1036
        (denoted as <span class="quote">&#8220;<span class="quote">-</span>&#8221;</span>, doing nothing at all) on
1037
1037
        <em class="parameter"><code>application/octet-stream</code></em>, and tag the result as
1038
1038
        <em class="parameter"><code>application/vnd.cups-raw</code></em>. This last one is
1039
1039
        always a green light to the CUPS scheduler to now hand the file over
1040
1040
        to the backend connecting to the printer and sending it over.
1041
 
        </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
 
1041
        </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
1042
1042
        Editing the <code class="filename">mime.convs</code> and the <code class="filename">mime.types</code> file does not
1043
 
        <span class="emphasis"><em>enforce</em></span> &#8220;<span class="quote">raw</span>&#8221; printing, it only <span class="emphasis"><em>allows</em></span> it.
1044
 
        </p></div><p><b>Background.�</b>
1045
 
<a class="indexterm" name="id2638902"></a>
1046
 
<a class="indexterm" name="id2638909"></a>
1047
 
<a class="indexterm" name="id2638915"></a>
1048
 
<a class="indexterm" name="id2638922"></a>
 
1043
        <span class="emphasis"><em>enforce</em></span> <span class="quote">&#8220;<span class="quote">raw</span>&#8221;</span> printing, it only <span class="emphasis"><em>allows</em></span> it.
 
1044
        </p></div><p title="Background"><b>Background.�</b>
 
1045
<a class="indexterm" name="id2644994"></a>
 
1046
<a class="indexterm" name="id2645001"></a>
 
1047
<a class="indexterm" name="id2645008"></a>
 
1048
<a class="indexterm" name="id2645015"></a>
1049
1049
        That CUPS is a more security-aware printing system than traditional ones
1050
1050
        does not by default allow one to send deliberate (possibly binary)
1051
1051
        data to printing devices. (This could be easily abused to launch a
1052
1052
        Denial of Service attack on your printer(s), causing at least the loss
1053
 
        of a lot of paper and ink.) &#8220;<span class="quote">Unknown</span>&#8221; data are regarded by CUPS
 
1053
        of a lot of paper and ink.) <span class="quote">&#8220;<span class="quote">Unknown</span>&#8221;</span> data are regarded by CUPS
1054
1054
        as <span class="emphasis"><em>MIME type</em></span> <span class="emphasis"><em>application/octet-stream</em></span>. While you
1055
 
        <span class="emphasis"><em>can</em></span> send data &#8220;<span class="quote">raw</span>&#8221;, the MIME type for these must
 
1055
        <span class="emphasis"><em>can</em></span> send data <span class="quote">&#8220;<span class="quote">raw</span>&#8221;</span>, the MIME type for these must
1056
1056
        be one that is known to CUPS and allowed by it. The file
1057
 
        <code class="filename">/etc/cups/mime.types</code> defines the &#8220;<span class="quote">rules</span>&#8221; of how CUPS
 
1057
        <code class="filename">/etc/cups/mime.types</code> defines the <span class="quote">&#8220;<span class="quote">rules</span>&#8221;</span> of how CUPS
1058
1058
        recognizes MIME types. The file <code class="filename">/etc/cups/mime.convs</code> decides which file
1059
1059
        conversion filter(s) may be applied to which MIME types.
1060
 
        </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2638977"></a>PostScript Printer Descriptions for Non-PostScript Printers</h3></div></div></div><p>
1061
 
        <a class="indexterm" name="id2638985"></a>
1062
 
<a class="indexterm" name="id2638992"></a>
1063
 
<a class="indexterm" name="id2638999"></a>
1064
 
<a class="indexterm" name="id2639006"></a>
1065
 
<a class="indexterm" name="id2639012"></a>
1066
 
<a class="indexterm" name="id2639019"></a>
 
1060
        </p></div><div class="sect2" title="PostScript Printer Descriptions for Non-PostScript Printers"><div class="titlepage"><div><div><h3 class="title"><a name="id2645069"></a>PostScript Printer Descriptions for Non-PostScript Printers</h3></div></div></div><p>
 
1061
        <a class="indexterm" name="id2645078"></a>
 
1062
<a class="indexterm" name="id2645084"></a>
 
1063
<a class="indexterm" name="id2645091"></a>
 
1064
<a class="indexterm" name="id2645098"></a>
 
1065
<a class="indexterm" name="id2645104"></a>
 
1066
<a class="indexterm" name="id2645111"></a>
1067
1067
        Originally PPDs were meant to be used for PostScript printers
1068
1068
        only. Here, they help to send device-specific commands and settings
1069
1069
        to the RIP, which processes the job file. CUPS has extended this
1076
1076
        </p><p>
1077
1077
        PPDs for a non-PostScript printer have a few lines that are unique to
1078
1078
        CUPS. The most important one looks similar to this:
1079
 
        <a class="indexterm" name="id2639041"></a>
 
1079
        <a class="indexterm" name="id2645134"></a>
1080
1080
</p><pre class="programlisting">
1081
1081
*cupsFilter: application/vnd.cups-raster  66   rastertoprinter
1082
1082
</pre><p>
1094
1094
        several hundred printer models. You may not be able to control
1095
1095
        different paper trays, or you may get larger margins than your
1096
1096
        specific model supports. See Table 21.1<a class="link" href="CUPS-printing.html#cups-ppds" title="Table�22.1.�PPDs Shipped with CUPS">&#8220;PPDs Shipped with CUPS&#8221;</a> for summary information.
1097
 
        </p><div class="table"><a name="cups-ppds"></a><p class="title"><b>Table�22.1.�PPDs Shipped with CUPS</b></p><div class="table-contents"><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 24-pin impact printers and compatible </td></tr><tr><td align="left">epson24.ppd</td><td align="justify">Epson 24-pin impact printers and compatible </td></tr><tr><td align="left">okidata9.ppd</td><td align="justify">Okidata 9-pin impact printers and compatible </td></tr><tr><td align="left">okidat24.ppd</td><td align="justify">Okidata 24-pin 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 </td></tr></tbody></table></div></div><br class="table-break"></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2639260"></a><span class="emphasis"><em>cupsomatic/foomatic-rip</em></span> Versus <span class="emphasis"><em>Native CUPS</em></span> Printing</h3></div></div></div><p>
1098
 
        <a class="indexterm" name="id2639274"></a>
1099
 
        <a class="indexterm" name="id2639281"></a>
 
1097
        </p><div class="table"><a name="cups-ppds"></a><p class="title"><b>Table�22.1.�PPDs Shipped with CUPS</b></p><div class="table-contents"><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 24-pin impact printers and compatible </td></tr><tr><td align="left">epson24.ppd</td><td align="justify">Epson 24-pin impact printers and compatible </td></tr><tr><td align="left">okidata9.ppd</td><td align="justify">Okidata 9-pin impact printers and compatible </td></tr><tr><td align="left">okidat24.ppd</td><td align="justify">Okidata 24-pin 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 </td></tr></tbody></table></div></div><br class="table-break"></div><div class="sect2" title="cupsomatic/foomatic-rip Versus Native CUPS Printing"><div class="titlepage"><div><div><h3 class="title"><a name="id2645352"></a><span class="emphasis"><em>cupsomatic/foomatic-rip</em></span> Versus <span class="emphasis"><em>Native CUPS</em></span> Printing</h3></div></div></div><p>
 
1098
        <a class="indexterm" name="id2645366"></a>
 
1099
        <a class="indexterm" name="id2645373"></a>
1100
1100
        Native CUPS rasterization works in two steps:
1101
 
        </p><div class="itemizedlist"><ul type="disc"><li><p>
1102
 
<a class="indexterm" name="id2639295"></a>
 
1101
        </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
 
1102
<a class="indexterm" name="id2645387"></a>
1103
1103
                First is the <em class="parameter"><code>pstoraster</code></em> step. It uses the special CUPS
1104
 
                <a class="indexterm" name="id2639309"></a>
 
1104
                <a class="indexterm" name="id2645401"></a>
1105
1105
                device from ESP Ghostscript 7.05.x as its tool.
1106
 
                </p></li><li><p>
 
1106
                </p></li><li class="listitem"><p>
1107
1107
                Second is the <em class="parameter"><code>rasterdriver</code></em> step. It uses various
1108
1108
                device-specific filters; there are several vendors who provide good
1109
1109
                quality filters for this step. Some are free software, some are
1116
1116
        One other method is the <em class="parameter"><code>cupsomatic/foomatic-rip</code></em>
1117
1117
        way. Note that <em class="parameter"><code>cupsomatic</code></em> is <span class="emphasis"><em>not</em></span> made by the CUPS
1118
1118
        developers. It is an independent contribution to printing development,
1119
 
        made by people from Linuxprinting.org.<sup>[<a name="id2639412" href="#ftn.id2639412" class="footnote">6</a>]</sup>
 
1119
        made by people from Linuxprinting.org.<sup>[<a name="id2645504" href="#ftn.id2645504" class="footnote">6</a>]</sup>
1120
1120
        <em class="parameter"><code>cupsomatic</code></em> is no longer developed, maintained, or supported. It now been
1121
1121
        replaced by <em class="parameter"><code>foomatic-rip</code></em>. <em class="parameter"><code>foomatic-rip</code></em> is a complete rewrite
1122
1122
        of the old <em class="parameter"><code>cupsomatic</code></em> idea, but very much improved and generalized to
1124
1124
        advised, especially if you are upgrading to a recent version of CUPS,
1125
1125
        too.
1126
1126
        </p><p>
1127
 
        <a class="indexterm" name="id2639461"></a>
1128
 
        <a class="indexterm" name="id2639468"></a>
 
1127
        <a class="indexterm" name="id2645554"></a>
 
1128
        <a class="indexterm" name="id2645560"></a>
1129
1129
        Like the old <em class="parameter"><code>cupsomatic</code></em> method, the <em class="parameter"><code>foomatic-rip</code></em> (new) method
1130
1130
        from Linuxprinting.org uses the traditional Ghostscript print file processing, doing everything in a single
1131
1131
        step. It therefore relies on all the other devices built into Ghostscript. The quality is as good (or bad) as
1135
1135
        Of course, you can use both methods side by side on one system (and even for one printer, if you set up
1136
1136
        different queues) and find out which works best for you.
1137
1137
        </p><p>
1138
 
<a class="indexterm" name="id2639503"></a>
1139
 
<a class="indexterm" name="id2639510"></a>
1140
 
<a class="indexterm" name="id2639517"></a>
1141
 
<a class="indexterm" name="id2639524"></a>
1142
 
<a class="indexterm" name="id2639531"></a>
1143
 
<a class="indexterm" name="id2639538"></a>
 
1138
<a class="indexterm" name="id2645596"></a>
 
1139
<a class="indexterm" name="id2645602"></a>
 
1140
<a class="indexterm" name="id2645609"></a>
 
1141
<a class="indexterm" name="id2645616"></a>
 
1142
<a class="indexterm" name="id2645623"></a>
 
1143
<a class="indexterm" name="id2645630"></a>
1144
1144
        <em class="parameter"><code>cupsomatic</code></em> kidnaps the print file after the
1145
1145
        <em class="parameter"><code>application/vnd.cups-postscript</code></em> stage and deviates it through the CUPS-external,
1146
1146
        systemwide Ghostscript installation. Therefore, the print file bypasses the <em class="parameter"><code>pstoraster</code></em>
1149
1149
        backend. <a class="link" href="CUPS-printing.html#cupsomatic-dia" title="Figure�22.10.�cupsomatic/foomatic Processing Versus Native CUPS.">cupsomatic/foomatic Processing Versus Native
1150
1150
        CUPS</a>, illustrates the difference between native CUPS rendering and the
1151
1151
        <em class="parameter"><code>Foomatic/cupsomatic</code></em> method.
1152
 
        </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2639597"></a>Examples for Filtering Chains</h3></div></div></div><p>
 
1152
        </p></div><div class="sect2" title="Examples for Filtering Chains"><div class="titlepage"><div><div><h3 class="title"><a name="id2645689"></a>Examples for Filtering Chains</h3></div></div></div><p>
1153
1153
        Here are a few examples of commonly occurring filtering chains to
1154
1154
        illustrate the workings of CUPS.
1155
1155
        </p><p>
1156
 
<a class="indexterm" name="id2639610"></a>
1157
 
<a class="indexterm" name="id2639617"></a>
1158
 
<a class="indexterm" name="id2639624"></a>
1159
 
<a class="indexterm" name="id2639631"></a>
 
1156
<a class="indexterm" name="id2645702"></a>
 
1157
<a class="indexterm" name="id2645709"></a>
 
1158
<a class="indexterm" name="id2645716"></a>
 
1159
<a class="indexterm" name="id2645723"></a>
1160
1160
        Assume you want to print a PDF file to an HP JetDirect-connected
1161
1161
        PostScript printer, but you want to print pages 3-5, 7, and 11-13
1162
 
        only, and you want to print them &#8220;<span class="quote">two-up</span>&#8221; and &#8220;<span class="quote">duplex</span>&#8221;:
1163
 
        </p><div class="itemizedlist"><ul type="disc"><li><p>Your print options (page selection as required, two-up,
1164
 
        duplex) are passed to CUPS on the command line.</p></li><li><p>The (complete) PDF file is sent to CUPS and autotyped as
1165
 
        <em class="parameter"><code>application/pdf</code></em>.</p></li><li><p>The file therefore must first pass the
 
1162
        only, and you want to print them <span class="quote">&#8220;<span class="quote">two-up</span>&#8221;</span> and <span class="quote">&#8220;<span class="quote">duplex</span>&#8221;</span>:
 
1163
        </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Your print options (page selection as required, two-up,
 
1164
        duplex) are passed to CUPS on the command line.</p></li><li class="listitem"><p>The (complete) PDF file is sent to CUPS and autotyped as
 
1165
        <em class="parameter"><code>application/pdf</code></em>.</p></li><li class="listitem"><p>The file therefore must first pass the
1166
1166
        <em class="parameter"><code>pdftops</code></em> prefilter, which produces PostScript
1167
1167
        MIME type <em class="parameter"><code>application/postscript</code></em> (a preview here
1168
 
        would still show all pages of the original PDF).</p></li><li><p>The file then passes the <em class="parameter"><code>pstops</code></em>
 
1168
        would still show all pages of the original PDF).</p></li><li class="listitem"><p>The file then passes the <em class="parameter"><code>pstops</code></em>
1169
1169
        filter that applies the command line options: it selects pages
1170
 
        2-5, 7, and 11-13, creates the imposed layout &#8220;<span class="quote">two pages on one sheet</span>&#8221;, and
1171
 
        inserts the correct &#8220;<span class="quote">duplex</span>&#8221; command (as defined in the printer's
 
1170
        2-5, 7, and 11-13, creates the imposed layout <span class="quote">&#8220;<span class="quote">two pages on one sheet</span>&#8221;</span>, and
 
1171
        inserts the correct <span class="quote">&#8220;<span class="quote">duplex</span>&#8221;</span> command (as defined in the printer's
1172
1172
        PPD) into the new PostScript file; the file is now of PostScript MIME
1173
1173
        type
1174
 
        <em class="parameter"><code>application/vnd.cups-postscript</code></em>.</p></li><li><p>The file goes to the <em class="parameter"><code>socket</code></em>
 
1174
        <em class="parameter"><code>application/vnd.cups-postscript</code></em>.</p></li><li class="listitem"><p>The file goes to the <em class="parameter"><code>socket</code></em>
1175
1175
        backend, which transfers the job to the printers.</p></li></ul></div><p>
1176
1176
        The resulting filter chain, therefore, is as shown in <a class="link" href="CUPS-printing.html#pdftosocket" title="Figure�22.11.�PDF to Socket Chain.">the PDF to socket chain
1177
1177
        illustration</a>.
1178
 
        </p><a class="indexterm" name="id2639742"></a><div class="figure"><a name="pdftosocket"></a><p class="title"><b>Figure�22.11.�PDF to Socket Chain.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/pdftosocket.png" alt="PDF to Socket Chain."></div></div></div><br class="figure-break"><p>
1179
 
<a class="indexterm" name="id2639792"></a>
1180
 
<a class="indexterm" name="id2639799"></a>
1181
 
<a class="indexterm" name="id2639806"></a>
 
1178
        </p><a class="indexterm" name="id2645834"></a><div class="figure"><a name="pdftosocket"></a><p class="title"><b>Figure�22.11.�PDF to Socket Chain.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/pdftosocket.png" alt="PDF to Socket Chain."></div></div></div><br class="figure-break"><p>
 
1179
<a class="indexterm" name="id2645884"></a>
 
1180
<a class="indexterm" name="id2645891"></a>
 
1181
<a class="indexterm" name="id2645898"></a>
1182
1182
        Assume you want to print the same filter to an USB-connected Epson Stylus Photo Printer installed with the CUPS
1183
1183
        <code class="filename">stphoto2.ppd</code>. The first few filtering stages are nearly the same:
1184
 
        </p><div class="itemizedlist"><ul type="disc"><li><p>
 
1184
        </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
1185
1185
                Your print options (page selection as required, two-up,
1186
1186
                duplex) are passed to CUPS on the command line.
1187
 
                </p></li><li><p>
 
1187
                </p></li><li class="listitem"><p>
1188
1188
                The (complete) PDF file is sent to CUPS and autotyped as
1189
1189
                <em class="parameter"><code>application/pdf</code></em>.
1190
 
                </p></li><li><p>
1191
 
<a class="indexterm" name="id2639846"></a>
1192
 
<a class="indexterm" name="id2639852"></a>
 
1190
                </p></li><li class="listitem"><p>
 
1191
<a class="indexterm" name="id2645938"></a>
 
1192
<a class="indexterm" name="id2645945"></a>
1193
1193
                The file must first pass the <em class="parameter"><code>pdftops</code></em> prefilter, which produces PostScript
1194
1194
                MIME type <em class="parameter"><code>application/postscript</code></em> (a preview here would still show all
1195
1195
                pages of the original PDF).
1196
 
                </p></li><li><p>
1197
 
<a class="indexterm" name="id2639878"></a>
1198
 
<a class="indexterm" name="id2639885"></a>
1199
 
                The file then passes the &#8220;<span class="quote">pstops</span>&#8221; filter that applies
 
1196
                </p></li><li class="listitem"><p>
 
1197
<a class="indexterm" name="id2645970"></a>
 
1198
<a class="indexterm" name="id2645977"></a>
 
1199
                The file then passes the <span class="quote">&#8220;<span class="quote">pstops</span>&#8221;</span> filter that applies
1200
1200
                the command line options: it selects the pages 2-5, 7, and 11-13,
1201
 
                creates the imposed layout &#8220;<span class="quote">two pages on one sheet,</span>&#8221; and inserts the
1202
 
                correct &#8220;<span class="quote">duplex</span>&#8221; command (oops  this printer and PPD
 
1201
                creates the imposed layout <span class="quote">&#8220;<span class="quote">two pages on one sheet,</span>&#8221;</span> and inserts the
 
1202
                correct <span class="quote">&#8220;<span class="quote">duplex</span>&#8221;</span> command (oops  this printer and PPD
1203
1203
                do not support duplex printing at all, so this option will
1204
1204
                be ignored) into the new PostScript file; the file is now of PostScript
1205
1205
                MIME type <em class="parameter"><code>application/vnd.cups-postscript</code></em>.
1206
 
                </p></li><li><p>
 
1206
                </p></li><li class="listitem"><p>
1207
1207
                The file then passes the <em class="parameter"><code>pstoraster</code></em> stage and becomes MIME type
1208
1208
                <em class="parameter"><code>application/cups-raster</code></em>.
1209
 
                </p></li><li><p>
1210
 
<a class="indexterm" name="id2639940"></a>
 
1209
                </p></li><li class="listitem"><p>
 
1210
<a class="indexterm" name="id2646032"></a>
1211
1211
                Finally, the <em class="parameter"><code>rastertoepson</code></em> filter
1212
1212
                does its work (as indicated in the printer's PPD), creating the
1213
1213
                printer-specific raster data and embedding any user-selected
1214
1214
                print options into the print data stream.
1215
 
                </p></li><li><p>
 
1215
                </p></li><li class="listitem"><p>
1216
1216
                The file goes to the <em class="parameter"><code>usb</code></em> backend, which transfers the job to the printers.
1217
1217
                </p></li></ul></div><p>
1218
1218
        The resulting filter chain therefore is as shown in <a class="link" href="CUPS-printing.html#pdftoepsonusb" title="Figure�22.12.�PDF to USB Chain.">the PDF to USB Chain
1219
1219
        illustration</a>.
1220
 
        </p><div class="figure"><a name="pdftoepsonusb"></a><p class="title"><b>Figure�22.12.�PDF to USB Chain.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/pdftoepsonusb.png" alt="PDF to USB Chain."></div></div></div><br class="figure-break"></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2640025"></a>Sources of CUPS Drivers/PPDs</h3></div></div></div><p>
 
1220
        </p><div class="figure"><a name="pdftoepsonusb"></a><p class="title"><b>Figure�22.12.�PDF to USB Chain.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/pdftoepsonusb.png" alt="PDF to USB Chain."></div></div></div><br class="figure-break"></div><div class="sect2" title="Sources of CUPS Drivers/PPDs"><div class="titlepage"><div><div><h3 class="title"><a name="id2646117"></a>Sources of CUPS Drivers/PPDs</h3></div></div></div><p>
1221
1221
        On the Internet you can now find many thousands of CUPS-PPD files
1222
1222
        (with their companion filters), in many national languages
1223
1223
        supporting more than 1,000 non-PostScript models.
1224
 
        </p><div class="itemizedlist"><a class="indexterm" name="id2640039"></a><a class="indexterm" name="id2640048"></a><ul type="disc"><li><p>
 
1224
        </p><div class="itemizedlist"><a class="indexterm" name="id2646132"></a><a class="indexterm" name="id2646141"></a><ul class="itemizedlist" type="disc"><li class="listitem"><p>
1225
1225
                <a class="ulink" href="http://www.easysw.com/printpro/" target="_top">ESP PrintPro</a>
1226
1226
                (commercial, non-free) is packaged with more than 3,000 PPDs, ready for
1227
 
                successful use &#8220;<span class="quote">out of the box</span>&#8221; on Linux, Mac OS X, IBM-AIX,
 
1227
                successful use <span class="quote">&#8220;<span class="quote">out of the box</span>&#8221;</span> on Linux, Mac OS X, IBM-AIX,
1228
1228
                HP-UX, Sun-Solaris, SGI-IRIX, Compaq Tru64, Digital UNIX, and
1229
1229
                other commercial Unices (it is written by the CUPS developers
1230
1230
                themselves and its sales help finance the further development of
1231
1231
                CUPS, as they feed their creators).
1232
 
                </p></li><li><p>
 
1232
                </p></li><li class="listitem"><p>
1233
1233
                The <a class="ulink" href="http://gimp-print.sourceforge.net/" target="_top">Gutenprint Project</a>
1234
1234
                (GPL, free software) provides around 140 PPDs (supporting nearly 400 printers, many driven
1235
1235
                to photo quality output), to be used alongside the Gutenprint CUPS filters.
1236
 
                </p></li><li><p>
 
1236
                </p></li><li class="listitem"><p>
1237
1237
                <a class="ulink" href="http://www.turboprint.de/english.html/" target="_top">TurboPrint </a> (shareware, non-free) supports
1238
1238
                roughly the same number of printers in excellent quality.
1239
 
                </p></li><li><p>
 
1239
                </p></li><li class="listitem"><p>
1240
1240
                <a class="ulink" href="http://www-124.ibm.com/developerworks/oss/linux/projects/omni/" target="_top">OMNI </a>
1241
1241
                (LPGL, free) is a package made by IBM, now containing support for more
1242
1242
                than 400 printers, stemming from the inheritance of IBM OS/2 know-how
1243
1243
                ported over to Linux (CUPS support is in a beta stage at present).
1244
 
                </p></li><li><p>
 
1244
                </p></li><li class="listitem"><p>
1245
1245
                <a class="ulink" href="http://hpinkjet.sourceforge.net/" target="_top">HPIJS </a> (BSD-style licenses, free)
1246
1246
                supports approximately 150 of HP's own printers and also provides
1247
1247
                excellent print quality now (currently available only via the Foomatic path).
1248
 
                </p></li><li><p>
 
1248
                </p></li><li class="listitem"><p>
1249
1249
                <a class="ulink" href="http://www.linuxprinting.org/" target="_top">Foomatic/cupsomatic </a>
1250
1250
                (LPGL, free) from Linuxprinting.org provide PPDs for practically every Ghostscript
1251
1251
                filter known to the world (including Omni, Gutenprint, and HPIJS).
1252
 
                </p></li></ul></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2640148"></a>Printing with Interface Scripts</h3></div></div></div><p>
1253
 
<a class="indexterm" name="id2640156"></a>
1254
 
<a class="indexterm" name="id2640163"></a>
1255
 
        CUPS also supports the use of &#8220;<span class="quote">interface scripts</span>&#8221; as known from
 
1252
                </p></li></ul></div></div><div class="sect2" title="Printing with Interface Scripts"><div class="titlepage"><div><div><h3 class="title"><a name="id2646240"></a>Printing with Interface Scripts</h3></div></div></div><p>
 
1253
<a class="indexterm" name="id2646248"></a>
 
1254
<a class="indexterm" name="id2646255"></a>
 
1255
        CUPS also supports the use of <span class="quote">&#8220;<span class="quote">interface scripts</span>&#8221;</span> as known from
1256
1256
        System V AT&amp;T printing systems. These are often used for PCL
1257
1257
        printers, from applications that generate PCL print jobs. Interface
1258
1258
        scripts are specific to printer models. They have a role similar to
1267
1267
<code class="prompt">root# </code><strong class="userinput"><code>lpadmin -p pclprinter -v socket://11.12.13.14:9100 \
1268
1268
          -i /path/to/interface-script</code></strong>
1269
1269
</pre><p>
1270
 
        Interface scripts might be the &#8220;<span class="quote">unknown animal</span>&#8221; to many. However,
 
1270
        Interface scripts might be the <span class="quote">&#8220;<span class="quote">unknown animal</span>&#8221;</span> to many. However,
1271
1271
        with CUPS they provide the easiest way to plug in your own custom-written filtering
1272
1272
        script or program into one specific print queue (some information about the traditional
1273
1273
        use of interface scripts is found at
1274
1274
        <a class="ulink" href="http://playground.sun.com/printing/documentation/interface.html" target="_top">
1275
1275
        http://playground.sun.com/printing/documentation/interface.html</a>).
1276
 
        </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2640243"></a>Network Printing (Purely Windows)</h2></div></div></div><p>
 
1276
        </p></div></div><div class="sect1" title="Network Printing (Purely Windows)"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2646335"></a>Network Printing (Purely Windows)</h2></div></div></div><p>
1277
1277
Network printing covers a lot of ground. To understand what exactly
1278
1278
goes on with Samba when it is printing on behalf of its Windows
1279
 
clients, let's first look at a &#8220;<span class="quote">purely Windows</span>&#8221; setup: Windows clients
 
1279
clients, let's first look at a <span class="quote">&#8220;<span class="quote">purely Windows</span>&#8221;</span> setup: Windows clients
1280
1280
with a Windows NT print server.
1281
 
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2640259"></a>From Windows Clients to an NT Print Server</h3></div></div></div><p>
 
1281
</p><div class="sect2" title="From Windows Clients to an NT Print Server"><div class="titlepage"><div><div><h3 class="title"><a name="id2646352"></a>From Windows Clients to an NT Print Server</h3></div></div></div><p>
1282
1282
Windows clients printing to an NT-based print server have two
1283
1283
options. They may:
1284
 
<a class="indexterm" name="id2640269"></a>
1285
 
<a class="indexterm" name="id2640276"></a>
1286
 
</p><div class="itemizedlist"><ul type="disc"><li><p>Execute the driver locally and render the GDI output
 
1284
<a class="indexterm" name="id2646362"></a>
 
1285
<a class="indexterm" name="id2646368"></a>
 
1286
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Execute the driver locally and render the GDI output
1287
1287
                        (EMF) into the printer-specific format on their own.
1288
 
        </p></li><li><p>Send the GDI output (EMF) to the server, where the
 
1288
        </p></li><li class="listitem"><p>Send the GDI output (EMF) to the server, where the
1289
1289
        driver is executed to render the printer-specific output.
1290
1290
        </p></li></ul></div><p>
1291
1291
Both print paths are shown in the flowcharts in <a class="link" href="CUPS-printing.html#small11" title="Figure�22.13.�Print Driver Execution on the Client.">
1292
1292
Print Driver Execution on the Client</a>, and
1293
1293
<a class="link" href="CUPS-printing.html#small12" title="Figure�22.14.�Print Driver Execution on the Server.">Print Driver Execution on the Server</a>.
1294
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2640321"></a>Driver Execution on the Client</h3></div></div></div><p>
 
1294
</p></div><div class="sect2" title="Driver Execution on the Client"><div class="titlepage"><div><div><h3 class="title"><a name="id2646414"></a>Driver Execution on the Client</h3></div></div></div><p>
1295
1295
In the first case, the print server must spool the file as raw, meaning it shouldn't touch the job file and try
1296
1296
to convert it in any way. This is what a traditional UNIX-based print server can do too, and at a better
1297
1297
performance and more reliably than an NT print server. This is what most Samba administrators probably are
1298
 
familiar with. One advantage of this setup is that this &#8220;<span class="quote">spooling-only</span>&#8221; print server may be used
 
1298
familiar with. One advantage of this setup is that this <span class="quote">&#8220;<span class="quote">spooling-only</span>&#8221;</span> print server may be used
1299
1299
even if no driver(s) for UNIX is available. It is sufficient to have the Windows client drivers available and
1300
1300
installed on the clients. This is illustrated in <a class="link" href="CUPS-printing.html#small11" title="Figure�22.13.�Print Driver Execution on the Client.">the Print Driver Execution on the
1301
1301
Client diagram</a>.
1302
 
</p><div class="figure"><a name="small11"></a><p class="title"><b>Figure�22.13.�Print Driver Execution on the Client.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/11small.png" alt="Print Driver Execution on the Client."></div></div></div><br class="figure-break"></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2640393"></a>Driver Execution on the Server</h3></div></div></div><p>
1303
 
<a class="indexterm" name="id2640401"></a>
1304
 
<a class="indexterm" name="id2640408"></a>
1305
 
<a class="indexterm" name="id2640414"></a>
1306
 
<a class="indexterm" name="id2640421"></a>
1307
 
<a class="indexterm" name="id2640427"></a>
 
1302
</p><div class="figure"><a name="small11"></a><p class="title"><b>Figure�22.13.�Print Driver Execution on the Client.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/11small.png" alt="Print Driver Execution on the Client."></div></div></div><br class="figure-break"></div><div class="sect2" title="Driver Execution on the Server"><div class="titlepage"><div><div><h3 class="title"><a name="id2646485"></a>Driver Execution on the Server</h3></div></div></div><p>
 
1303
<a class="indexterm" name="id2646493"></a>
 
1304
<a class="indexterm" name="id2646500"></a>
 
1305
<a class="indexterm" name="id2646506"></a>
 
1306
<a class="indexterm" name="id2646513"></a>
 
1307
<a class="indexterm" name="id2646520"></a>
1308
1308
The other path executes the printer driver on the server. The client transfers print files in EMF format to
1309
1309
the server. The server uses the PostScript, PCL, ESC/P, or other driver to convert the EMF file into the
1310
1310
printer-specific language. It is not possible for UNIX to do the same. Currently, there is no program or
1312
1312
This is illustrated in <a class="link" href="CUPS-printing.html#small12" title="Figure�22.14.�Print Driver Execution on the Server.">the Print Driver Execution on the Server diagram</a>.
1313
1313
</p><div class="figure"><a name="small12"></a><p class="title"><b>Figure�22.14.�Print Driver Execution on the Server.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/12small.png" alt="Print Driver Execution on the Server."></div></div></div><br class="figure-break"><p>
1314
1314
However, something similar is possible with CUPS, so read on.
1315
 
</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2640498"></a>Network Printing (Windows Clients and UNIX/Samba Print
 
1315
</p></div></div><div class="sect1" title="Network Printing (Windows Clients and UNIX/Samba Print Servers)"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2646590"></a>Network Printing (Windows Clients and UNIX/Samba Print
1316
1316
Servers)</h2></div></div></div><p>
1317
1317
Since UNIX print servers <span class="emphasis"><em>cannot</em></span> execute the Win32
1318
1318
program code on their platform, the picture is somewhat
1319
1319
different. However, this does not limit your options all that
1320
1320
much. On the contrary, you may have a way here to implement printing
1321
1321
features that are not possible otherwise.
1322
 
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2640516"></a>From Windows Clients to a CUPS/Samba Print Server</h3></div></div></div><p>
 
1322
</p><div class="sect2" title="From Windows Clients to a CUPS/Samba Print Server"><div class="titlepage"><div><div><h3 class="title"><a name="id2646608"></a>From Windows Clients to a CUPS/Samba Print Server</h3></div></div></div><p>
1323
1323
Here is a simple recipe showing how you can take advantage of CUPS's
1324
1324
powerful features for the benefit of your Windows network printing
1325
1325
clients:
1326
 
</p><div class="itemizedlist"><ul type="disc"><li><p>Let the Windows clients send PostScript to the CUPS
1327
 
        server.</p></li><li><p>Let the CUPS server render the PostScript into device-specific raster format.</p></li></ul></div><p>
 
1326
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Let the Windows clients send PostScript to the CUPS
 
1327
        server.</p></li><li class="listitem"><p>Let the CUPS server render the PostScript into device-specific raster format.</p></li></ul></div><p>
1328
1328
This requires the clients to use a PostScript driver (even if the
1329
1329
printer is a non-PostScript model. It also requires that you have a
1330
1330
driver on the CUPS server.
1331
1331
</p><p>
1332
1332
First, to enable CUPS-based printing through Samba, the following options should be set in your <code class="filename">smb.conf</code>
1333
1333
file <em class="parameter"><code>[global]</code></em> section:
1334
 
</p><table class="simplelist" border="0" summary="Simple list"><tr><td><a class="indexterm" name="id2640570"></a><em class="parameter"><code>printing = cups</code></em></td></tr><tr><td><a class="indexterm" name="id2640582"></a><em class="parameter"><code>printcap = cups</code></em></td></tr></table><p>
 
1334
</p><table border="0" summary="Simple list" class="simplelist"><tr><td><a class="indexterm" name="id2646663"></a><em class="parameter"><code>printing = cups</code></em></td></tr><tr><td><a class="indexterm" name="id2646674"></a><em class="parameter"><code>printcap = cups</code></em></td></tr></table><p>
1335
1335
When these parameters are specified, all manually set print directives (like <a class="link" href="smb.conf.5.html#PRINTCOMMAND" target="_top">print command</a> or <a class="link" href="smb.conf.5.html#LPPAUSECOMMAND" target="_top">lppause command</a>) in <code class="filename">smb.conf</code> (as well as in Samba itself) will be
1336
1336
ignored. Instead, Samba will directly interface with CUPS through its application program interface (API), as
1337
1337
long as Samba has been compiled with CUPS library (libcups) support. If Samba has not been compiled with CUPS
1339
1339
AT&amp;T command set, with the -oraw option automatically passing through (if you want your own defined print
1340
1340
commands to work with a Samba server that has CUPS support compiled in, simply use <a class="link" href="smb.conf.5.html#CLASSICALPRINTING" target="_top">classicalprinting = sysv</a>). This is illustrated in <a class="link" href="CUPS-printing.html#13small" title="Figure�22.15.�Printing via CUPS/Samba Server.">the Printing via
1341
1341
CUPS/Samba Server diagram</a>.
1342
 
</p><div class="figure"><a name="13small"></a><p class="title"><b>Figure�22.15.�Printing via CUPS/Samba Server.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/13small.png" alt="Printing via CUPS/Samba Server."></div></div></div><br class="figure-break"></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2640706"></a>Samba Receiving Job-Files and Passing Them to CUPS</h3></div></div></div><p>
 
1342
</p><div class="figure"><a name="13small"></a><p class="title"><b>Figure�22.15.�Printing via CUPS/Samba Server.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/13small.png" alt="Printing via CUPS/Samba Server."></div></div></div><br class="figure-break"></div><div class="sect2" title="Samba Receiving Job-Files and Passing Them to CUPS"><div class="titlepage"><div><div><h3 class="title"><a name="id2646799"></a>Samba Receiving Job-Files and Passing Them to CUPS</h3></div></div></div><p>
1343
1343
Samba <span class="emphasis"><em>must</em></span> use its own spool directory (it is set by a line similar to <a class="link" href="smb.conf.5.html#PATH" target="_top">path = /var/spool/samba</a>, in the <em class="parameter"><code>[printers]</code></em> or <em class="parameter"><code>[printername]</code></em> section of <code class="filename">smb.conf</code>). Samba receives the job in its own spool space and passes it
1344
1344
into the spool directory of CUPS (the CUPS spool directory is set by the <em class="parameter"><code>RequestRoot</code></em>
1345
1345
directive in a line that defaults to <em class="parameter"><code>RequestRoot /var/spool/cups</code></em>). CUPS checks the
1346
1346
access rights of its spool directory and resets it to healthy values with every restart. We have seen quite a
1347
1347
few people who used a common spooling space for Samba and CUPS, and struggled for weeks with this
1348
 
&#8220;<span class="quote">problem.</span>&#8221;
 
1348
<span class="quote">&#8220;<span class="quote">problem.</span>&#8221;</span>
1349
1349
</p><p>
1350
1350
A Windows user authenticates only to Samba (by whatever means is
1351
1351
configured). If Samba runs on the same host as CUPS, you only need to
1352
 
allow &#8220;<span class="quote">localhost</span>&#8221; to print. If it runs on different machines, you
 
1352
allow <span class="quote">&#8220;<span class="quote">localhost</span>&#8221;</span> to print. If it runs on different machines, you
1353
1353
need to make sure the Samba host gets access to printing on CUPS.
1354
 
</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2640785"></a>Network PostScript RIP</h2></div></div></div><p>
 
1354
</p></div></div><div class="sect1" title="Network PostScript RIP"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2646878"></a>Network PostScript RIP</h2></div></div></div><p>
1355
1355
This section discusses the use of CUPS filters on the server  configuration where
1356
1356
clients make use of a PostScript driver with CUPS-PPDs.
1357
1357
</p><p>
1358
 
<a class="indexterm" name="id2640802"></a>
1359
 
<a class="indexterm" name="id2640809"></a>
1360
 
<a class="indexterm" name="id2640815"></a>
 
1358
<a class="indexterm" name="id2646895"></a>
 
1359
<a class="indexterm" name="id2646901"></a>
 
1360
<a class="indexterm" name="id2646908"></a>
1361
1361
PPDs can control all print device options. They are usually provided by the manufacturer  if you own
1362
1362
a PostScript printer, that is. PPD files are always a component of PostScript printer drivers on MS Windows or
1363
1363
Apple Mac OS systems. They are ASCII files containing user-selectable print options, mapped to appropriate
1364
1364
PostScript, PCL, or PJL commands for the target printer. Printer driver GUI dialogs translate these options
1365
 
&#8220;<span class="quote">on the fly</span>&#8221; into buttons and drop-down lists for the user to select.
 
1365
<span class="quote">&#8220;<span class="quote">on the fly</span>&#8221;</span> into buttons and drop-down lists for the user to select.
1366
1366
</p><p>
1367
1367
CUPS can load, without any conversions, the PPD file from any Windows (NT is recommended) PostScript driver
1368
1368
and handle the options. There is a Web browser interface to the print options (select <a class="ulink" href="http://localhost:631/printers/" target="_top">http://localhost:631/printers/</a> and click on one
1370
1370
lpoptions</code> or see if you have <code class="literal">lphelp</code> on your system). There are also some
1371
1371
different GUI front-ends on Linux/UNIX, which can present PPD options to users. PPD options are normally meant
1372
1372
to be evaluated by the PostScript RIP on the real PostScript printer.
1373
 
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2640876"></a>PPDs for Non-PS Printers on UNIX</h3></div></div></div><p>
1374
 
<a class="indexterm" name="id2640884"></a>
1375
 
CUPS does not limit itself to &#8220;<span class="quote">real</span>&#8221; PostScript printers in its use of PPDs. The CUPS developers
 
1373
</p><div class="sect2" title="PPDs for Non-PS Printers on UNIX"><div class="titlepage"><div><div><h3 class="title"><a name="id2646968"></a>PPDs for Non-PS Printers on UNIX</h3></div></div></div><p>
 
1374
<a class="indexterm" name="id2646976"></a>
 
1375
CUPS does not limit itself to <span class="quote">&#8220;<span class="quote">real</span>&#8221;</span> PostScript printers in its use of PPDs. The CUPS developers
1376
1376
have extended the scope of the PPD concept to also describe available device and driver options for
1377
1377
non-PostScript printers through CUPS-PPDs.
1378
1378
</p><p>
1383
1383
for the interpretation of the supplied PostScript. Thus CUPS lets all its printers appear as PostScript
1384
1384
devices to its clients, because it can act as a PostScript RIP for those printers, processing the received
1385
1385
PostScript code into a proper raster print format.
1386
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2640920"></a>PPDs for Non-PS Printers on Windows</h3></div></div></div><p>
1387
 
<a class="indexterm" name="id2640928"></a>
1388
 
CUPS-PPDs can also be used on Windows clients, on top of a &#8220;<span class="quote">core</span>&#8221; PostScript driver (now
 
1386
</p></div><div class="sect2" title="PPDs for Non-PS Printers on Windows"><div class="titlepage"><div><div><h3 class="title"><a name="id2647013"></a>PPDs for Non-PS Printers on Windows</h3></div></div></div><p>
 
1387
<a class="indexterm" name="id2647021"></a>
 
1388
CUPS-PPDs can also be used on Windows clients, on top of a <span class="quote">&#8220;<span class="quote">core</span>&#8221;</span> PostScript driver (now
1389
1389
recommended is the CUPS PostScript Driver for Windows NT/200x/XP; you can also use the Adobe one, with
1390
1390
limitations). This feature enables CUPS to do a few tricks no other spooler can do:
1391
 
</p><div class="itemizedlist"><ul type="disc"><li><p>
 
1391
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
1392
1392
        Act as a networked PostScript RIP handling print files from all client platforms in a uniform way.
1393
 
        </p></li><li><p>
 
1393
        </p></li><li class="listitem"><p>
1394
1394
        Act as a central accounting and billing server, since all files are passed through the pstops filter and are therefore
1395
1395
        logged in the CUPS <code class="filename">page_log</code> file.  <span class="emphasis"><em>Note:</em></span> this cannot happen with
1396
 
        &#8220;<span class="quote">raw</span>&#8221; print jobs, which always remain unfiltered per definition.
1397
 
        </p></li><li><p>
 
1396
        <span class="quote">&#8220;<span class="quote">raw</span>&#8221;</span> print jobs, which always remain unfiltered per definition.
 
1397
        </p></li><li class="listitem"><p>
1398
1398
        Enable clients to consolidate on a single PostScript driver, even for many different target printers.
1399
1399
        </p></li></ul></div><p>
1400
1400
Using CUPS PPDs on Windows clients enables them to control all print job settings just as a UNIX client can do.
1401
 
</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2640988"></a>Windows Terminal Servers (WTS) as CUPS Clients</h2></div></div></div><p>
 
1401
</p></div></div><div class="sect1" title="Windows Terminal Servers (WTS) as CUPS Clients"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2647081"></a>Windows Terminal Servers (WTS) as CUPS Clients</h2></div></div></div><p>
1402
1402
This setup may be of special interest to people experiencing major problems in WTS environments. WTS often
1403
1403
need a multitude of non-PostScript drivers installed to run their clients' variety of different printer
1404
1404
models. This often imposes the price of much increased instability.
1405
 
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2641003"></a>Printer Drivers Running in &#8220;<span class="quote">Kernel Mode</span>&#8221; Cause Many
 
1405
</p><div class="sect2" title="Printer Drivers Running in &#8220;Kernel Mode&#8221; Cause Many Problems"><div class="titlepage"><div><div><h3 class="title"><a name="id2647095"></a>Printer Drivers Running in <span class="quote">&#8220;<span class="quote">Kernel Mode</span>&#8221;</span> Cause Many
1406
1406
Problems</h3></div></div></div><p>
1407
 
Windows NT printer drivers, which run in &#8220;<span class="quote">kernel mode</span>&#8221;, introduce a high risk for the stability
 
1407
Windows NT printer drivers, which run in <span class="quote">&#8220;<span class="quote">kernel mode</span>&#8221;</span>, introduce a high risk for the stability
1408
1408
of the system if the driver is not really stable and well-tested. And there are a lot of bad drivers out
1409
1409
there! Especially notorious is the example of the PCL printer driver that had an additional sound module
1410
1410
running to notify users via soundcard of their finished jobs. Do I need to say that this one was also reliably
1411
 
causing &#8220;<span class="quote">blue screens of death</span>&#8221; on a regular basis?
 
1411
causing <span class="quote">&#8220;<span class="quote">blue screens of death</span>&#8221;</span> on a regular basis?
1412
1412
</p><p>
1413
1413
PostScript drivers are generally well-tested. They are not known to cause any problems, even though they also
1414
1414
run in kernel mode. This might be because until now there have been only two different PostScript drivers: the
1415
1415
one from Adobe and the one from Microsoft. Both are well-tested and are as stable as you can imagine on
1416
1416
Windows. The CUPS driver is derived from the Microsoft one.
1417
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2641041"></a>Workarounds Impose Heavy Limitations</h3></div></div></div><p>
 
1417
</p></div><div class="sect2" title="Workarounds Impose Heavy Limitations"><div class="titlepage"><div><div><h3 class="title"><a name="id2647134"></a>Workarounds Impose Heavy Limitations</h3></div></div></div><p>
1418
1418
In an attempt to work around problems, site administrators have resorted to restricting the
1419
1419
allowed drivers installed on their WTS to one generic PCL and one PostScript driver. This, however, restricts
1420
1420
the number of printer options available for clients to use. Often they can't get out more than simplex
1421
1421
prints from one standard paper tray, while their devices could do much better if driven by a different driver!
1422
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2641059"></a>CUPS: A &#8220;<span class="quote">Magical Stone</span>&#8221;?</h3></div></div></div><p>
1423
 
<a class="indexterm" name="id2641070"></a>
1424
 
<a class="indexterm" name="id2641077"></a>
 
1422
</p></div><div class="sect2" title="CUPS: A &#8220;Magical Stone&#8221;?"><div class="titlepage"><div><div><h3 class="title"><a name="id2647151"></a>CUPS: A <span class="quote">&#8220;<span class="quote">Magical Stone</span>&#8221;</span>?</h3></div></div></div><p>
 
1423
<a class="indexterm" name="id2647162"></a>
 
1424
<a class="indexterm" name="id2647169"></a>
1425
1425
Using a PostScript driver, enabled with a CUPS-PPD, seems to be a very elegant way to overcome all these
1426
1426
shortcomings. There are, depending on the version of Windows OS you use, up to three different PostScript
1427
1427
drivers now available: Adobe, Microsoft, and CUPS PostScript drivers. None of them is known to cause major
1428
1428
stability problems on WTS (even if used with many different PPDs). The clients will be able to (again) choose
1429
1429
paper trays, duplex printing, and other settings. However, there is a certain price for this too: a CUPS
1430
1430
server acting as a PostScript RIP for its clients requires more CPU and RAM than when just acting as a
1431
 
&#8220;<span class="quote">raw spooling</span>&#8221; device. Plus, this setup is not yet widely tested, although the first feedbacks
 
1431
<span class="quote">&#8220;<span class="quote">raw spooling</span>&#8221;</span> device. Plus, this setup is not yet widely tested, although the first feedbacks
1432
1432
look very promising.
1433
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2641102"></a>PostScript Drivers with No Major Problems, Even in Kernel
 
1433
</p></div><div class="sect2" title="PostScript Drivers with No Major Problems, Even in Kernel Mode"><div class="titlepage"><div><div><h3 class="title"><a name="id2647194"></a>PostScript Drivers with No Major Problems, Even in Kernel
1434
1434
Mode</h3></div></div></div><p>
1435
 
<a class="indexterm" name="id2641110"></a>
1436
 
<a class="indexterm" name="id2641117"></a>
1437
 
<a class="indexterm" name="id2641124"></a>
1438
 
<a class="indexterm" name="id2641131"></a>
1439
 
<a class="indexterm" name="id2641138"></a>
1440
 
<a class="indexterm" name="id2641145"></a>
 
1435
<a class="indexterm" name="id2647203"></a>
 
1436
<a class="indexterm" name="id2647210"></a>
 
1437
<a class="indexterm" name="id2647217"></a>
 
1438
<a class="indexterm" name="id2647223"></a>
 
1439
<a class="indexterm" name="id2647230"></a>
 
1440
<a class="indexterm" name="id2647237"></a>
1441
1441
More recent printer drivers on W200x and XP no longer run in kernel mode (unlike Windows NT). However, both
1442
1442
operating systems can still use the NT drivers, running in kernel mode (you can roughly tell which is which as
1443
 
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; ones). As was
 
1443
the drivers in subdirectory <span class="quote">&#8220;<span class="quote">2</span>&#8221;</span> of <span class="quote">&#8220;<span class="quote">W32X86</span>&#8221;</span> are <span class="quote">&#8220;<span class="quote">old</span>&#8221;</span> ones). As was
1444
1444
said before, the Adobe as well as the Microsoft PostScript drivers are not known to cause any stability
1445
1445
problems. The CUPS driver is derived from the Microsoft one. There is a simple reason for this: the MS DDK
1446
1446
(Device Development Kit) for Windows NT (which used to be available at no cost to licensees of Visual Studio)
1447
1447
includes the source code of the Microsoft driver, and licensees of Visual Studio are allowed to use and modify
1448
1448
it for their own driver development efforts. This is what the CUPS people have done. The license does not
1449
 
allow them to publish the whole of the source code.  However, they have released the &#8220;<span class="quote">diff</span>&#8221; under
1450
 
the GPL, and if you are the owner of an &#8220;<span class="quote">MS DDK for Windows NT,</span>&#8221; you can check the driver
 
1449
allow them to publish the whole of the source code.  However, they have released the <span class="quote">&#8220;<span class="quote">diff</span>&#8221;</span> under
 
1450
the GPL, and if you are the owner of an <span class="quote">&#8220;<span class="quote">MS DDK for Windows NT,</span>&#8221;</span> you can check the driver
1451
1451
yourself.
1452
 
</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2641189"></a>Configuring CUPS for Driver Download</h2></div></div></div><p>
 
1452
</p></div></div><div class="sect1" title="Configuring CUPS for Driver Download"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2647282"></a>Configuring CUPS for Driver Download</h2></div></div></div><p>
1453
1453
As we have said before, all previously known methods to prepare client printer drivers on the Samba server for
1454
1454
download and Point'n'Print convenience of Windows workstations are working with CUPS, too. These methods were
1455
1455
described in <a class="link" href="classicalprinting.html" title="Chapter�21.�Classical Printing Support">Classical Printing</a>. In reality, this is a pure Samba
1456
1456
business and relates only to the Samba-Windows client relationship.
1457
 
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2641212"></a><span class="emphasis"><em>cupsaddsmb</em></span>: The Unknown Utility</h3></div></div></div><p>
1458
 
<a class="indexterm" name="id2641222"></a>
 
1457
</p><div class="sect2" title="cupsaddsmb: The Unknown Utility"><div class="titlepage"><div><div><h3 class="title"><a name="id2647304"></a><span class="emphasis"><em>cupsaddsmb</em></span>: The Unknown Utility</h3></div></div></div><p>
 
1458
<a class="indexterm" name="id2647314"></a>
1459
1459
The <em class="parameter"><code>cupsaddsmb</code></em> utility (shipped with all current CUPS versions) is an alternative
1460
1460
method to transfer printer drivers into the Samba <em class="parameter"><code>[print$]</code></em> share. Remember, this
1461
1461
share is where clients expect drivers deposited and set up for download and installation. It makes the sharing
1467
1467
The CUPS printer driver is available from the CUPS download site. Its package name is
1468
1468
<code class="filename">cups-samba-[version].tar.gz</code>. It is preferred over the Adobe drivers because it has a
1469
1469
number of advantages:
1470
 
</p><div class="itemizedlist"><ul type="disc"><li><p>It supports a much more accurate page accounting.</p></li><li><p>It supports banner pages and page labels on all printers.</p></li><li><p>It supports the setting of a number of job IPP attributes
 
1470
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>It supports a much more accurate page accounting.</p></li><li class="listitem"><p>It supports banner pages and page labels on all printers.</p></li><li class="listitem"><p>It supports the setting of a number of job IPP attributes
1471
1471
        (such as job priority, page label, and job billing).</p></li></ul></div><p>
1472
1472
However, currently only Windows NT, 2000, and XP are supported by the
1473
1473
CUPS drivers. You will also need to get the respective part of the Adobe driver
1474
1474
if you need to support Windows 95, 98, and Me clients.
1475
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2641310"></a>Prepare Your <code class="filename">smb.conf</code> for <code class="literal">cupsaddsmb</code></h3></div></div></div><p>
 
1475
</p></div><div class="sect2" title="Prepare Your smb.conf for cupsaddsmb"><div class="titlepage"><div><div><h3 class="title"><a name="id2647402"></a>Prepare Your <code class="filename">smb.conf</code> for <code class="literal">cupsaddsmb</code></h3></div></div></div><p>
1476
1476
Prior to running <code class="literal">cupsaddsmb</code>, you need the settings in
1477
1477
<code class="filename">smb.conf</code> as shown in <a class="link" href="CUPS-printing.html#cupsadd-ex" title="Example�22.3.�smb.conf for cupsaddsmb Usage">the <code class="filename">smb.conf</code> for cupsaddsmb Usage</a>.
1478
 
</p><div class="example"><a name="cupsadd-ex"></a><p class="title"><b>Example�22.3.�smb.conf for cupsaddsmb Usage</b></p><div class="example-contents"><table class="simplelist" border="0" summary="Simple list"><tr><td> </td></tr><tr><td><em class="parameter"><code>[global]</code></em></td></tr><tr><td><a class="indexterm" name="id2641379"></a><em class="parameter"><code>load printers = yes</code></em></td></tr><tr><td><a class="indexterm" name="id2641391"></a><em class="parameter"><code>printing = cups</code></em></td></tr><tr><td><a class="indexterm" name="id2641403"></a><em class="parameter"><code>printcap name = cups</code></em></td></tr><tr><td> </td></tr><tr><td><em class="parameter"><code>[printers]</code></em></td></tr><tr><td><a class="indexterm" name="id2641423"></a><em class="parameter"><code>comment = All Printers</code></em></td></tr><tr><td><a class="indexterm" name="id2641435"></a><em class="parameter"><code>path = /var/spool/samba</code></em></td></tr><tr><td><a class="indexterm" name="id2641447"></a><em class="parameter"><code>browseable = no</code></em></td></tr><tr><td># setting depends on your requirements</td></tr><tr><td><a class="indexterm" name="id2641462"></a><em class="parameter"><code>guest ok = yes</code></em></td></tr><tr><td><a class="indexterm" name="id2641474"></a><em class="parameter"><code>writable = no</code></em></td></tr><tr><td><a class="indexterm" name="id2641486"></a><em class="parameter"><code>printable = yes</code></em></td></tr><tr><td><a class="indexterm" name="id2641497"></a><em class="parameter"><code>printer admin = root</code></em></td></tr><tr><td> </td></tr><tr><td><em class="parameter"><code>[print$]</code></em></td></tr><tr><td><a class="indexterm" name="id2641518"></a><em class="parameter"><code>comment = Printer Drivers</code></em></td></tr><tr><td><a class="indexterm" name="id2641530"></a><em class="parameter"><code>path = /etc/samba/drivers</code></em></td></tr><tr><td><a class="indexterm" name="id2641542"></a><em class="parameter"><code>browseable = yes</code></em></td></tr><tr><td><a class="indexterm" name="id2641554"></a><em class="parameter"><code>guest ok = no</code></em></td></tr><tr><td><a class="indexterm" name="id2641565"></a><em class="parameter"><code>read only = yes</code></em></td></tr><tr><td><a class="indexterm" name="id2641577"></a><em class="parameter"><code>write list = root, @smbprintadm</code></em></td></tr></table></div></div><br class="example-break"></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2641591"></a>CUPS &#8220;<span class="quote">PostScript Driver for Windows NT/200x/XP</span>&#8221;</h3></div></div></div><p>
1479
 
<a class="indexterm" name="id2641601"></a>
 
1478
</p><div class="example"><a name="cupsadd-ex"></a><p class="title"><b>Example�22.3.�smb.conf for cupsaddsmb Usage</b></p><div class="example-contents"><table border="0" summary="Simple list" class="simplelist"><tr><td> </td></tr><tr><td><em class="parameter"><code>[global]</code></em></td></tr><tr><td><a class="indexterm" name="id2647472"></a><em class="parameter"><code>load printers = yes</code></em></td></tr><tr><td><a class="indexterm" name="id2647483"></a><em class="parameter"><code>printing = cups</code></em></td></tr><tr><td><a class="indexterm" name="id2647495"></a><em class="parameter"><code>printcap name = cups</code></em></td></tr><tr><td> </td></tr><tr><td><em class="parameter"><code>[printers]</code></em></td></tr><tr><td><a class="indexterm" name="id2647516"></a><em class="parameter"><code>comment = All Printers</code></em></td></tr><tr><td><a class="indexterm" name="id2647528"></a><em class="parameter"><code>path = /var/spool/samba</code></em></td></tr><tr><td><a class="indexterm" name="id2647539"></a><em class="parameter"><code>browseable = no</code></em></td></tr><tr><td># setting depends on your requirements</td></tr><tr><td><a class="indexterm" name="id2647555"></a><em class="parameter"><code>guest ok = yes</code></em></td></tr><tr><td><a class="indexterm" name="id2647566"></a><em class="parameter"><code>writable = no</code></em></td></tr><tr><td><a class="indexterm" name="id2647578"></a><em class="parameter"><code>printable = yes</code></em></td></tr><tr><td><a class="indexterm" name="id2647590"></a><em class="parameter"><code>printer admin = root</code></em></td></tr><tr><td> </td></tr><tr><td><em class="parameter"><code>[print$]</code></em></td></tr><tr><td><a class="indexterm" name="id2647611"></a><em class="parameter"><code>comment = Printer Drivers</code></em></td></tr><tr><td><a class="indexterm" name="id2647623"></a><em class="parameter"><code>path = /etc/samba/drivers</code></em></td></tr><tr><td><a class="indexterm" name="id2647634"></a><em class="parameter"><code>browseable = yes</code></em></td></tr><tr><td><a class="indexterm" name="id2647646"></a><em class="parameter"><code>guest ok = no</code></em></td></tr><tr><td><a class="indexterm" name="id2647658"></a><em class="parameter"><code>read only = yes</code></em></td></tr><tr><td><a class="indexterm" name="id2647669"></a><em class="parameter"><code>write list = root, @smbprintadm</code></em></td></tr></table></div></div><br class="example-break"></div><div class="sect2" title="CUPS &#8220;PostScript Driver for Windows NT/200x/XP&#8221;"><div class="titlepage"><div><div><h3 class="title"><a name="id2647683"></a>CUPS <span class="quote">&#8220;<span class="quote">PostScript Driver for Windows NT/200x/XP</span>&#8221;</span></h3></div></div></div><p>
 
1479
<a class="indexterm" name="id2647694"></a>
1480
1480
CUPS users may get the exact same package from <a class="ulink" href="http://www.cups.org/software.html" target="_top">http://www.cups.org/software.html</a>.  It is a separate package
1481
1481
from the CUPS-based software files, tagged as CUPS 1.1.x Windows NT/200x/XP Printer Driver for Samba (tar.gz,
1482
1482
192k). The filename to download is <code class="filename">cups-samba-1.1.x.tar.gz</code>. Upon untar and unzipping, it
1489
1489
cups-samba.remove
1490
1490
cups-samba.ss
1491
1491
</pre><p>
1492
 
<a class="indexterm" name="id2641648"></a>
1493
 
<a class="indexterm" name="id2641657"></a>
 
1492
<a class="indexterm" name="id2647740"></a>
 
1493
<a class="indexterm" name="id2647749"></a>
1494
1494
These have been packaged with the ESP meta-packager software EPM. The <code class="filename">*.install</code> and
1495
1495
<code class="filename">*.remove</code> files are simple shell scripts, which untar the <code class="filename">*.ss</code> (the
1496
 
<code class="filename">*.ss</code> is nothing else but a tar archive, which can be untarred by &#8220;<span class="quote">tar</span>&#8221; too).
 
1496
<code class="filename">*.ss</code> is nothing else but a tar archive, which can be untarred by <span class="quote">&#8220;<span class="quote">tar</span>&#8221;</span> too).
1497
1497
Then it puts the content into <code class="filename">/usr/share/cups/drivers/</code>. This content includes three
1498
1498
files:
1499
1499
</p><pre class="screen">
1516
1516
<code class="filename">/usr/share/cups/drivers/</code> directory:
1517
1517
</p><pre class="screen">
1518
1518
<code class="prompt">root# </code><strong class="userinput"><code>cp /usr/share/drivers/cups.hlp /usr/share/cups/drivers/</code></strong>
1519
 
</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>
 
1519
</pre><div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>
1520
1520
Due to a bug, one recent CUPS release puts the <code class="filename">cups.hlp</code> driver file
1521
1521
into<code class="filename">/usr/share/drivers/</code> instead of <code class="filename">/usr/share/cups/drivers/</code>. To work
1522
1522
around this, copy/move the file (after running the <code class="literal">./cups-samba.install</code> script) manually to
1523
1523
the correct place.
1524
1524
</p></div><p>
1525
 
<a class="indexterm" name="id2641809"></a>
 
1525
<a class="indexterm" name="id2647902"></a>
1526
1526
This new CUPS PostScript driver is currently binary only, but free of charge. No complete source code is
1527
1527
provided (yet). The reason is that it has been developed with the help of the Microsoft DDK and compiled with
1528
1528
Microsoft Visual Studio 6. Driver developers are not allowed to distribute the whole of the source code as
1529
 
free software. However, CUPS developers released the &#8220;<span class="quote">diff</span>&#8221; in source code under the GPL, so
 
1529
free software. However, CUPS developers released the <span class="quote">&#8220;<span class="quote">diff</span>&#8221;</span> in source code under the GPL, so
1530
1530
anybody with a license for Visual Studio and a DDK will be able to compile for himself or herself.
1531
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2641830"></a>Recognizing Different Driver Files</h3></div></div></div><p>
 
1531
</p></div><div class="sect2" title="Recognizing Different Driver Files"><div class="titlepage"><div><div><h3 class="title"><a name="id2647923"></a>Recognizing Different Driver Files</h3></div></div></div><p>
1532
1532
The CUPS drivers do not support the older Windows 95/98/Me, but only the Windows NT/2000/XP client.
1533
 
</p><p>Windows NT, 2000, and XP are supported by:</p><div class="itemizedlist"><ul type="disc"><li><p>cups.hlp</p></li><li><p>cupsdrvr.dll</p></li><li><p>cupsui.dll</p></li></ul></div><p>
 
1533
</p><p>Windows NT, 2000, and XP are supported by:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>cups.hlp</p></li><li class="listitem"><p>cupsdrvr.dll</p></li><li class="listitem"><p>cupsui.dll</p></li></ul></div><p>
1534
1534
Adobe drivers are available for the older Windows 95/98/Me as well as
1535
1535
for Windows NT/2000/XP clients. The set of files is different from the
1536
1536
different platforms.
1537
 
</p><p>Windows 95, 98, and ME are supported by:</p><div class="itemizedlist"><ul type="disc"><li><p>ADFONTS.MFM</p></li><li><p>ADOBEPS4.DRV</p></li><li><p>ADOBEPS4.HLP</p></li><li><p>DEFPRTR2.PPD</p></li><li><p>ICONLIB.DLL</p></li><li><p>PSMON.DLL</p></li></ul></div><p>Windows NT, 2000, and XP are supported by:</p><div class="itemizedlist"><ul type="disc"><li><p>ADOBEPS5.DLL</p></li><li><p>ADOBEPSU.DLL</p></li><li><p>ADOBEPSU.HLP</p></li></ul></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
1538
 
<a class="indexterm" name="id2641928"></a>
 
1537
</p><p>Windows 95, 98, and ME are supported by:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>ADFONTS.MFM</p></li><li class="listitem"><p>ADOBEPS4.DRV</p></li><li class="listitem"><p>ADOBEPS4.HLP</p></li><li class="listitem"><p>DEFPRTR2.PPD</p></li><li class="listitem"><p>ICONLIB.DLL</p></li><li class="listitem"><p>PSMON.DLL</p></li></ul></div><p>Windows NT, 2000, and XP are supported by:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>ADOBEPS5.DLL</p></li><li class="listitem"><p>ADOBEPSU.DLL</p></li><li class="listitem"><p>ADOBEPSU.HLP</p></li></ul></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
 
1538
<a class="indexterm" name="id2648020"></a>
1539
1539
If both the Adobe driver files and the CUPS driver files for the support of Windows NT/200x/XP are presently
1540
1540
installed on the server, the Adobe files will be ignored and the CUPS files will be used. If you prefer
1541
1541
 for whatever reason  to use Adobe-only drivers, move away the three CUPS driver files.
1542
1542
The Windows 9x/Me clients use the Adobe drivers in any case.
1543
 
</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2641949"></a>Acquiring the Adobe Driver Files</h3></div></div></div><p>
 
1543
</p></div></div><div class="sect2" title="Acquiring the Adobe Driver Files"><div class="titlepage"><div><div><h3 class="title"><a name="id2648041"></a>Acquiring the Adobe Driver Files</h3></div></div></div><p>
1544
1544
Acquiring the Adobe driver files seems to be unexpectedly difficult for many users. They are not available on
1545
1545
the Adobe Web site as single files, and the self-extracting and/or self-installing Windows-.exe is not easy to
1546
1546
locate either. You probably need to use the included native installer and run the installation process on one
1547
1547
client once. This will install the drivers (and one generic PostScript printer) locally on the client. When
1548
1548
they are installed, share the generic PostScript printer. After this, the client's <em class="parameter"><code>[print$]</code></em> share holds the Adobe files, which you can get with smbclient from the CUPS host.
1549
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2641974"></a>ESP Print Pro PostScript Driver for Windows NT/200x/XP</h3></div></div></div><p>
1550
 
<a class="indexterm" name="id2641983"></a>
 
1549
</p></div><div class="sect2" title="ESP Print Pro PostScript Driver for Windows NT/200x/XP"><div class="titlepage"><div><div><h3 class="title"><a name="id2648067"></a>ESP Print Pro PostScript Driver for Windows NT/200x/XP</h3></div></div></div><p>
 
1550
<a class="indexterm" name="id2648075"></a>
1551
1551
Users of the ESP Print Pro software are able to install the ESP print drivers package as an alternative to the
1552
1552
Adobe PostScript drivers.  To do so, retrieve the driver files from the normal download area of the ESP Print
1553
1553
Pro software at <a class="ulink" href="http://www.easysw.com/software.html" target="_top">Easy Software</a> web site.
1554
 
You need to locate the link labeled &#8220;<span class="quote">SAMBA</span>&#8221; among the <span class="guilabel">Download Printer Drivers for ESP
 
1554
You need to locate the link labeled <span class="quote">&#8220;<span class="quote">SAMBA</span>&#8221;</span> among the <span class="guilabel">Download Printer Drivers for ESP
1555
1555
Print Pro 4.x</span> area and download the package. Once installed, you can prepare any driver by simply
1556
1556
highlighting the printer in the Printer Manager GUI and selecting <span class="guilabel">Export Driver...</span> from
1557
1557
the menu. Of course, you need to have prepared Samba beforehand to handle the driver files; that is, set up
1558
1558
the <em class="parameter"><code>[print$]</code></em> share, and so on. The ESP Print Pro package includes the CUPS driver
1559
1559
files as well as a (licensed) set of Adobe drivers for the Windows 95/98/Me client family.
1560
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2642037"></a>Caveats to Be Considered</h3></div></div></div><p>
1561
 
<a class="indexterm" name="id2642045"></a>
1562
 
<a class="indexterm" name="id2642051"></a>
1563
 
<a class="indexterm" name="id2642058"></a>
1564
 
<a class="indexterm" name="id2642065"></a>
 
1560
</p></div><div class="sect2" title="Caveats to Be Considered"><div class="titlepage"><div><div><h3 class="title"><a name="id2648129"></a>Caveats to Be Considered</h3></div></div></div><p>
 
1561
<a class="indexterm" name="id2648137"></a>
 
1562
<a class="indexterm" name="id2648144"></a>
 
1563
<a class="indexterm" name="id2648151"></a>
 
1564
<a class="indexterm" name="id2648157"></a>
1565
1565
Once you have run the install script (and possibly manually moved the <code class="filename">cups.hlp</code> file to
1566
1566
<code class="filename">/usr/share/cups/drivers/</code>), the driver is ready to be put into Samba's <em class="parameter"><code>[print$]</code></em> share (which often maps to <code class="filename">/etc/samba/drivers/</code> and contains a
1567
1567
subdirectory tree with <span class="emphasis"><em>WIN40</em></span> and <span class="emphasis"><em>W32X86</em></span> branches). You do this by
1568
1568
running <code class="literal">cupsaddsmb</code> (see also <code class="literal">man cupsaddsmb</code> for CUPS since release
1569
1569
1.1.16).
1570
 
</p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>
1571
 
<a class="indexterm" name="id2642124"></a>
1572
 
<a class="indexterm" name="id2642131"></a>
 
1570
</p><div class="tip" title="Tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>
 
1571
<a class="indexterm" name="id2648216"></a>
 
1572
<a class="indexterm" name="id2648223"></a>
1573
1573
You may need to put root into the smbpasswd file by running <code class="literal">smbpasswd</code>; this is especially
1574
1574
important if you should run this whole procedure for the first time and are not working in an environment
1575
1575
where everything is configured for <span class="emphasis"><em>single sign-on</em></span> to a Windows Domain Controller.
1576
1576
</p></div><p>
1577
1577
Once the driver files are in the <em class="parameter"><code>[print$]</code></em> share and are initialized, they are ready
1578
1578
to be downloaded and installed by the Windows NT/200x/XP clients.
1579
 
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
 
1579
</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
1580
1580
Win 9x/Me clients will not work with the CUPS PostScript driver. For these you still need to use the
1581
1581
<code class="filename">ADOBE*.*</code> drivers, as previously stated.
1582
 
</p></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
 
1582
</p></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
1583
1583
It is not harmful if you still have the <code class="filename">ADOBE*.*</code> driver files from previous installations
1584
1584
in the <code class="filename">/usr/share/cups/drivers/</code> directory. The new <code class="literal">cupsaddsmb</code> (from
1585
1585
1.1.16) will automatically prefer its own drivers if it finds both.
1586
 
</p></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
1587
 
<a class="indexterm" name="id2642206"></a>
1588
 
<a class="indexterm" name="id2642213"></a>
 
1586
</p></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
 
1587
<a class="indexterm" name="id2648299"></a>
 
1588
<a class="indexterm" name="id2648306"></a>
1589
1589
Should your Windows clients have had the old <code class="filename">ADOBE*.*</code> files for the Adobe PostScript
1590
1590
driver installed, the download and installation of the new CUPS PostScript driver for Windows NT/200x/XP will
1591
1591
fail at first. You need to wipe the old driver from the clients first. It is not enough to
1592
 
&#8220;<span class="quote">delete</span>&#8221; the printer, because the driver files will still be kept by the clients and re-used if
 
1592
<span class="quote">&#8220;<span class="quote">delete</span>&#8221;</span> the printer, because the driver files will still be kept by the clients and re-used if
1593
1593
you try to re-install the printer. To really get rid of the Adobe driver files on the clients, open the
1594
1594
<span class="guilabel">Printers</span> folder (possibly via <span class="guilabel">Start -&gt; Settings -&gt; Control Panel -&gt;
1595
1595
Printers</span>), right-click on the folder background, and select <span class="guimenuitem">Server
1596
1596
Properties</span>. When the new dialog opens, select the <span class="guilabel">Drivers</span> tab. On the list
1597
1597
select the driver you want to delete and click the <span class="guilabel">Delete</span> button. This will only work if
1598
 
there is not one single printer left that uses that particular driver. You need to &#8220;<span class="quote">delete</span>&#8221; all
 
1598
there is not one single printer left that uses that particular driver. You need to <span class="quote">&#8220;<span class="quote">delete</span>&#8221;</span> all
1599
1599
printers using this driver in the <span class="guilabel">Printers</span> folder first. You will need Administrator
1600
1600
privileges to do this.
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="id2642289"></a>
1603
 
<a class="indexterm" name="id2642298"></a>
 
1601
</p></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
 
1602
<a class="indexterm" name="id2648381"></a>
 
1603
<a class="indexterm" name="id2648390"></a>
1604
1604
Once you have successfully downloaded the CUPS PostScript driver to a client, you can easily switch all
1605
1605
printers to this one by proceeding as described in <a class="link" href="classicalprinting.html" title="Chapter�21.�Classical Printing Support">Classical Printing
1606
1606
Support</a>. Either change a driver for an existing printer by running the <span class="guilabel">Printer
1607
1607
Properties</span> dialog, or use <code class="literal">rpcclient</code> with the <code class="literal">setdriver</code>
1608
1608
subcommand.
1609
 
</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2642336"></a>Windows CUPS PostScript Driver Versus Adobe Driver</h3></div></div></div><p>
 
1609
</p></div></div><div class="sect2" title="Windows CUPS PostScript Driver Versus Adobe Driver"><div class="titlepage"><div><div><h3 class="title"><a name="id2648429"></a>Windows CUPS PostScript Driver Versus Adobe Driver</h3></div></div></div><p>
1610
1610
Are you interested in a comparison between the CUPS and the Adobe PostScript drivers? For our purposes, these
1611
1611
are the most important items that weigh in favor of CUPS:
1612
 
</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
1613
 
        get the ADOBE*.* driver files?</span>&#8221;</p></li><li><p>
1614
 
        <a class="indexterm" name="id2642367"></a>
 
1612
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>No hassle with the Adobe EULA.</p></li><li class="listitem"><p>No hassle with the question, <span class="quote">&#8220;<span class="quote">Where do I
 
1613
        get the ADOBE*.* driver files?</span>&#8221;</span></p></li><li class="listitem"><p>
 
1614
        <a class="indexterm" name="id2648459"></a>
1615
1615
        The Adobe drivers (on request of the printer PPD associated with them) often put a PJL header in front of the
1616
1616
        main PostScript part of the print file. Thus, the print file starts with <em class="parameter"><code>&lt;1B
1617
1617
        &gt;%-12345X</code></em> or <em class="parameter"><code>&lt;escape&gt;%-12345X</code></em> instead of
1618
1618
        <em class="parameter"><code>%!PS</code></em>. This leads to the CUPS daemon autotyping the incoming file as a print-ready file,
1619
1619
        not initiating a pass through the <em class="parameter"><code>pstops</code></em> filter (to speak more technically, it is not
1620
 
        regarded as the generic MIME-type <a class="indexterm" name="id2642405"></a>
 
1620
        regarded as the generic MIME-type <a class="indexterm" name="id2648498"></a>
1621
1621
        <em class="parameter"><code>application/postscript</code></em>, but as the more special MIME type
1622
 
        <a class="indexterm" name="id2642419"></a>
 
1622
        <a class="indexterm" name="id2648511"></a>
1623
1623
        <em class="parameter"><code>application/cups.vnd-postscript</code></em>), which therefore also leads to the page accounting in
1624
1624
        <em class="parameter"><code>/var/log/cups/page_log</code></em> not receiving the exact number of pages; instead the dummy page
1625
 
        number of &#8220;<span class="quote">1</span>&#8221; is logged in a standard setup).
1626
 
        </p></li><li><p>The Adobe driver has more options to misconfigure the
1627
 
<a class="indexterm" name="id2642450"></a>
 
1625
        number of <span class="quote">&#8220;<span class="quote">1</span>&#8221;</span> is logged in a standard setup).
 
1626
        </p></li><li class="listitem"><p>The Adobe driver has more options to misconfigure the
 
1627
<a class="indexterm" name="id2648542"></a>
1628
1628
        PostScript generated by it (like setting it inadvertently to
1629
1629
        <span class="guilabel">Optimize for Speed</span> instead of
1630
1630
        <span class="guilabel">Optimize for Portability</span>, which
1631
 
        could lead to CUPS being unable to process it).</p></li><li><p>The CUPS PostScript driver output sent by Windows
1632
 
<a class="indexterm" name="id2642477"></a>
 
1631
        could lead to CUPS being unable to process it).</p></li><li class="listitem"><p>The CUPS PostScript driver output sent by Windows
 
1632
<a class="indexterm" name="id2648569"></a>
1633
1633
        clients to the CUPS server is guaranteed to autotype 
1634
1634
        as the generic MIME type <em class="parameter"><code>application/postscript</code></em>,
1635
1635
        thus passing through the CUPS <em class="parameter"><code>pstops</code></em> filter and logging the
1636
1636
        correct number of pages in the <code class="filename">page_log</code> for
1637
 
        accounting and quota purposes.</p></li><li><p>
1638
 
        <a class="indexterm" name="id2642510"></a>
 
1637
        accounting and quota purposes.</p></li><li class="listitem"><p>
 
1638
        <a class="indexterm" name="id2648602"></a>
1639
1639
        The CUPS PostScript driver supports the sending of additional standard (IPP) print options by Windows
1640
1640
        NT/200x/XP clients. Such additional print options are naming the CUPS standard <span class="emphasis"><em>banner
1641
1641
        pages</em></span> (or the custom ones, should they be installed at the time of driver download), using the CUPS
1642
1642
        page-label option, setting a job priority, and setting the scheduled time of printing (with the option to
1643
1643
        support additional useful IPP job attributes in the future).
1644
 
        </p></li><li><p>The CUPS PostScript driver supports the inclusion of
 
1644
        </p></li><li class="listitem"><p>The CUPS PostScript driver supports the inclusion of
1645
1645
        the new <em class="parameter"><code>*cupsJobTicket</code></em> comments at the
1646
1646
        beginning of the PostScript file (which could be used in the future
1647
1647
        for all sorts of beneficial extensions on the CUPS side, but which will
1648
1648
        not disturb any other applications because they will regard it as a comment
1649
 
        and simply ignore it).</p></li><li><p>The CUPS PostScript driver will be the heart of the
 
1649
        and simply ignore it).</p></li><li class="listitem"><p>The CUPS PostScript driver will be the heart of the
1650
1650
        fully fledged CUPS IPP client for Windows NT/200x/XP to be released soon
1651
 
        (probably alongside the first beta release for CUPS 1.2).</p></li></ul></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2642554"></a>Run cupsaddsmb (Quiet Mode)</h3></div></div></div><p>
1652
 
<a class="indexterm" name="id2642562"></a>
1653
 
<a class="indexterm" name="id2642569"></a>
 
1651
        (probably alongside the first beta release for CUPS 1.2).</p></li></ul></div></div><div class="sect2" title="Run cupsaddsmb (Quiet Mode)"><div class="titlepage"><div><div><h3 class="title"><a name="id2648647"></a>Run cupsaddsmb (Quiet Mode)</h3></div></div></div><p>
 
1652
<a class="indexterm" name="id2648655"></a>
 
1653
<a class="indexterm" name="id2648661"></a>
1654
1654
The <code class="literal">cupsaddsmb</code> command copies the needed files into your <em class="parameter"><code>[print$]</code></em>
1655
1655
share. Additionally, the PPD associated with this printer is copied from <code class="filename">/etc/cups/ppd/</code>
1656
1656
to <em class="parameter"><code>[print$]</code></em>. There the files wait for convenient Windows client installations via
1658
1658
Samba. If you have a small network, you are probably using user-level security (<a class="link" href="smb.conf.5.html#SECURITY" target="_top">security = user</a>).
1659
1659
</p><p>
1660
1660
Here is an example of a successfully run <code class="literal">cupsaddsmb</code> command: 
1661
 
<a class="indexterm" name="id2642627"></a>
1662
 
<a class="indexterm" name="id2642634"></a>
 
1661
<a class="indexterm" name="id2648719"></a>
 
1662
<a class="indexterm" name="id2648726"></a>
1663
1663
</p><pre class="screen">
1664
1664
<code class="prompt">root# </code><strong class="userinput"><code>cupsaddsmb -U root infotec_IS2027</code></strong>
1665
1665
Password for root required to access localhost via Samba: <strong class="userinput"><code>['secret']</code></strong>
1666
1666
</pre><p>
1667
 
<a class="indexterm" name="id2642666"></a>
 
1667
<a class="indexterm" name="id2648758"></a>
1668
1668
To share <span class="emphasis"><em>all</em></span> printers and drivers, use the
1669
1669
<code class="option">-a</code> parameter instead of a printer name. Since
1670
 
<code class="literal">cupsaddsmb</code> &#8220;<span class="quote">exports</span>&#8221; the printer drivers to Samba, it should be
 
1670
<code class="literal">cupsaddsmb</code> <span class="quote">&#8220;<span class="quote">exports</span>&#8221;</span> the printer drivers to Samba, it should be
1671
1671
obvious that it only works for queues with a CUPS driver associated.
1672
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2642694"></a>Run cupsaddsmb with Verbose Output</h3></div></div></div><p>
1673
 
<a class="indexterm" name="id2642703"></a>
 
1672
</p></div><div class="sect2" title="Run cupsaddsmb with Verbose Output"><div class="titlepage"><div><div><h3 class="title"><a name="id2648787"></a>Run cupsaddsmb with Verbose Output</h3></div></div></div><p>
 
1673
<a class="indexterm" name="id2648795"></a>
1674
1674
Probably you want to see what's going on. Use the
1675
1675
<code class="option">-v</code> parameter to get a more verbose output. The
1676
 
output below was edited for better readability: all &#8220;<span class="quote">\</span>&#8221; at the end of
 
1676
output below was edited for better readability: all <span class="quote">&#8220;<span class="quote">\</span>&#8221;</span> at the end of
1677
1677
a line indicate that I inserted an artificial line break plus some
1678
1678
indentation here:
1679
 
<a class="indexterm" name="id2642720"></a>
1680
 
<a class="indexterm" name="id2642730"></a>
 
1679
<a class="indexterm" name="id2648813"></a>
 
1680
<a class="indexterm" name="id2648822"></a>
1681
1681
</p><pre class="screen">
1682
1682
<code class="prompt">root# </code><strong class="userinput"><code>cupsaddsmb -U root -v infotec_2105</code></strong>
1683
1683
Password for root required to access localhost via GANDALF:
1739
1739
   -c 'setdriver infotec_2105 infotec_2105'
1740
1740
  cmd = setdriver infotec_2105 infotec_2105
1741
1741
  Successfully set infotec_2105 to driver infotec_2105.
1742
 
</pre><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>
 
1742
</pre><div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>
1743
1743
You will see the root password for the Samba account printed on screen. 
1744
1744
</p></div><p>
1745
1745
If you look closely, you'll discover your root password was transferred unencrypted over the wire, so beware!
1746
1746
Also, if you look further, you may discover error messages like NT_STATUS_OBJECT_NAME_COLLISION in the output.
1747
1747
This will occur when the directories WIN40 and W32X86 already existed in the <em class="parameter"><code>[print$]</code></em>
1748
1748
driver download share (from a previous driver installation). These are harmless warning messages.
1749
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2642886"></a>Understanding cupsaddsmb</h3></div></div></div><p>
1750
 
<a class="indexterm" name="id2642894"></a>
 
1749
</p></div><div class="sect2" title="Understanding cupsaddsmb"><div class="titlepage"><div><div><h3 class="title"><a name="id2648978"></a>Understanding cupsaddsmb</h3></div></div></div><p>
 
1750
<a class="indexterm" name="id2648986"></a>
1751
1751
What has happened? What did <code class="literal">cupsaddsmb</code> do? There are five stages of the procedure:
1752
 
</p><div class="orderedlist"><ol type="1"><li><p>
1753
 
        <a class="indexterm" name="id2642919"></a>
1754
 
        Call the CUPS server via IPP and request the driver files and the PPD file for the named printer.</p></li><li><p>Store the files temporarily in the local TEMPDIR (as defined in <code class="filename">cupsd.conf</code>).</p></li><li><p>Connect via smbclient to the Samba server's <em class="parameter"><code>[print$]</code></em> share and put the files into the
1755
 
         share's WIN40 (for Windows 9x/Me) and W32X86 (for Windows NT/200x/XP) subdirectories.</p></li><li><p>
1756
 
        <a class="indexterm" name="id2642956"></a>
 
1752
</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
 
1753
        <a class="indexterm" name="id2649011"></a>
 
1754
        Call the CUPS server via IPP and request the driver files and the PPD file for the named printer.</p></li><li class="listitem"><p>Store the files temporarily in the local TEMPDIR (as defined in <code class="filename">cupsd.conf</code>).</p></li><li class="listitem"><p>Connect via smbclient to the Samba server's <em class="parameter"><code>[print$]</code></em> share and put the files into the
 
1755
         share's WIN40 (for Windows 9x/Me) and W32X86 (for Windows NT/200x/XP) subdirectories.</p></li><li class="listitem"><p>
 
1756
        <a class="indexterm" name="id2649048"></a>
1757
1757
        Connect via rpcclient to the Samba server and execute the <code class="literal">adddriver</code> command with the correct parameters.
1758
 
        </p></li><li><p>
1759
 
        <a class="indexterm" name="id2642977"></a>
1760
 
        Connect via rpcclient to the Samba server a second time and execute the <code class="literal">setdriver</code> command.</p></li></ol></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
 
1758
        </p></li><li class="listitem"><p>
 
1759
        <a class="indexterm" name="id2649069"></a>
 
1760
        Connect via rpcclient to the Samba server a second time and execute the <code class="literal">setdriver</code> command.</p></li></ol></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
1761
1761
You can run the <code class="literal">cupsaddsmb</code> utility with parameters to specify one remote host as Samba host
1762
1762
and a second remote host as CUPS host. Especially if you want to get a deeper understanding, it is a good idea
1763
1763
to try it and see more clearly what is going on (though in real life most people will have their CUPS and
1765
1765
</p><pre class="screen">
1766
1766
<code class="prompt">root# </code><strong class="userinput"><code>cupsaddsmb -H sambaserver -h cupsserver -v printer</code></strong>
1767
1767
</pre><p>
1768
 
</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2643030"></a>How to Recognize If cupsaddsmb Completed Successfully</h3></div></div></div><p>
 
1768
</p></div></div><div class="sect2" title="How to Recognize If cupsaddsmb Completed Successfully"><div class="titlepage"><div><div><h3 class="title"><a name="id2649123"></a>How to Recognize If cupsaddsmb Completed Successfully</h3></div></div></div><p>
1769
1769
You <span class="emphasis"><em>must</em></span> always check if the utility completed
1770
1770
successfully in all fields. You need at minimum these three messages
1771
1771
among the output:
1772
 
</p><div class="orderedlist"><ol type="1"><li><p><span class="emphasis"><em>Printer Driver infotec_2105 successfully
 
1772
</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p><span class="emphasis"><em>Printer Driver infotec_2105 successfully
1773
1773
        installed.</em></span> # (for the W32X86 == Windows NT/200x/XP
1774
 
        architecture).</p></li><li><p><span class="emphasis"><em>Printer Driver infotec_2105 successfully
 
1774
        architecture).</p></li><li class="listitem"><p><span class="emphasis"><em>Printer Driver infotec_2105 successfully
1775
1775
        installed.</em></span> # (for the WIN40 == Windows 9x/Me
1776
 
        architecture).</p></li><li><p><span class="emphasis"><em>Successfully set [printerXPZ] to driver
 
1776
        architecture).</p></li><li class="listitem"><p><span class="emphasis"><em>Successfully set [printerXPZ] to driver
1777
1777
        [printerXYZ].</em></span></p></li></ol></div><p>
1778
1778
These messages are probably not easily recognized in the general
1779
1779
output. If you run <code class="literal">cupsaddsmb</code> with the <code class="option">-a</code>
1788
1788
result was WERR_ACCESS_DENIED
1789
1789
</pre><p>
1790
1790
it means that you might have set <a class="link" href="smb.conf.5.html#USECLIENTDRIVER" target="_top">use client driver = yes</a> for this printer. 
1791
 
Setting it to &#8220;<span class="quote">no</span>&#8221; will solve the problem. Refer to the <code class="filename">smb.conf</code> man page for explanation of 
 
1791
Setting it to <span class="quote">&#8220;<span class="quote">no</span>&#8221;</span> will solve the problem. Refer to the <code class="filename">smb.conf</code> man page for explanation of 
1792
1792
the <em class="parameter"><code>use client driver</code></em>.
1793
 
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
 
1793
</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
1794
1794
It is impossible to see any diagnostic output if you do not run <code class="literal">cupsaddsmb</code> in verbose mode.
1795
1795
Therefore, we strongly recommend against use of the default quiet mode. It will hide any problems from you that
1796
1796
might occur.
1797
 
</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2643152"></a>cupsaddsmb with a Samba PDC</h3></div></div></div><p>
1798
 
<a class="indexterm" name="id2643160"></a>
1799
 
<a class="indexterm" name="id2643167"></a>
 
1797
</p></div></div><div class="sect2" title="cupsaddsmb with a Samba PDC"><div class="titlepage"><div><div><h3 class="title"><a name="id2649245"></a>cupsaddsmb with a Samba PDC</h3></div></div></div><p>
 
1798
<a class="indexterm" name="id2649253"></a>
 
1799
<a class="indexterm" name="id2649260"></a>
1800
1800
Can't get the standard <code class="literal">cupsaddsmb</code> command to run on a Samba PDC?  Are you asked for the
1801
1801
password credential again and again, and the command just will not take off at all? Try one of these
1802
1802
variations:
1805
1805
<code class="prompt">root# </code><strong class="userinput"><code>cupsaddsmb -H SAURON -U MIDEARTH\\root -v printername</code></strong>
1806
1806
<code class="prompt">root# </code><strong class="userinput"><code>cupsaddsmb -H SAURON -U MIDEARTH\\root -h cups-server -v printername</code></strong>
1807
1807
</pre><p>
1808
 
(Note the two backslashes: the first one is required to &#8220;<span class="quote">escape</span>&#8221; the second one).
1809
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2643233"></a>cupsaddsmb Flowchart</h3></div></div></div><p>
1810
 
<a class="indexterm" name="id2643241"></a>
1811
 
<a class="indexterm" name="id2643248"></a>
 
1808
(Note the two backslashes: the first one is required to <span class="quote">&#8220;<span class="quote">escape</span>&#8221;</span> the second one).
 
1809
</p></div><div class="sect2" title="cupsaddsmb Flowchart"><div class="titlepage"><div><div><h3 class="title"><a name="id2649326"></a>cupsaddsmb Flowchart</h3></div></div></div><p>
 
1810
<a class="indexterm" name="id2649334"></a>
 
1811
<a class="indexterm" name="id2649341"></a>
1812
1812
<a class="link" href="CUPS-printing.html#small14" title="Figure�22.16.�cupsaddsmb Flowchart.">The cupsaddsmb Flowchart</a> shows a chart about the procedures, command flows, and
1813
1813
data flows of the <code class="literal">cupaddsmb</code> command. Note again: cupsaddsmb is
1814
1814
not intended to, and does not work with, raw print queues!
1815
 
</p><div class="figure"><a name="small14"></a><p class="title"><b>Figure�22.16.�cupsaddsmb Flowchart.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/14small.png" alt="cupsaddsmb Flowchart."></div></div></div><br class="figure-break"></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2643314"></a>Installing the PostScript Driver on a Client</h3></div></div></div><p>
1816
 
<a class="indexterm" name="id2643323"></a>
1817
 
<a class="indexterm" name="id2643330"></a>
 
1815
</p><div class="figure"><a name="small14"></a><p class="title"><b>Figure�22.16.�cupsaddsmb Flowchart.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/14small.png" alt="cupsaddsmb Flowchart."></div></div></div><br class="figure-break"></div><div class="sect2" title="Installing the PostScript Driver on a Client"><div class="titlepage"><div><div><h3 class="title"><a name="id2649407"></a>Installing the PostScript Driver on a Client</h3></div></div></div><p>
 
1816
<a class="indexterm" name="id2649415"></a>
 
1817
<a class="indexterm" name="id2649422"></a>
1818
1818
After <code class="literal">cupsaddsmb</code> is completed, your driver is prepared for the clients to use. Here are the
1819
1819
steps you must perform to download and install it via Point'n'Print. From a Windows client, browse to the
1820
1820
CUPS/Samba server:
1821
 
</p><div class="itemizedlist"><ul type="disc"><li><p>
1822
 
        <a class="indexterm" name="id2643352"></a>
1823
 
        Open the <span class="guilabel">Printers</span> share of Samba in Network Neighborhood.</p></li><li><p>Right-click on the printer in question.</p></li><li><p>From the opening context menu select
 
1821
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
 
1822
        <a class="indexterm" name="id2649445"></a>
 
1823
        Open the <span class="guilabel">Printers</span> share of Samba in Network Neighborhood.</p></li><li class="listitem"><p>Right-click on the printer in question.</p></li><li class="listitem"><p>From the opening context menu select
1824
1824
        <span class="guimenuitem">Install...</span> or 
1825
1825
        <span class="guimenuitem">Connect...</span> (depending on the Windows version you use).</p></li></ul></div><p>
1826
1826
After a few seconds, there should be a new printer in your client's <span class="emphasis"><em>local</em></span>
1830
1830
the new printer appears in a
1831
1831
<code class="filename">\\SambaServer\PrinterName</code> entry in the drop-down list of available printers.
1832
1832
</p><p>
1833
 
<a class="indexterm" name="id2643422"></a>
1834
 
<a class="indexterm" name="id2643428"></a>
1835
 
<a class="indexterm" name="id2643435"></a>
 
1833
<a class="indexterm" name="id2649514"></a>
 
1834
<a class="indexterm" name="id2649521"></a>
 
1835
<a class="indexterm" name="id2649528"></a>
1836
1836
<code class="literal">cupsaddsmb</code> will only reliably work with CUPS version 1.1.15 or higher and with Samba
1837
1837
version 2.2.4, or later. If it does not work, or if the automatic printer driver download to the clients does
1838
1838
not succeed, you can still manually install the CUPS printer PPD on top of the Adobe PostScript driver on
1840
1840
</p><pre class="screen">
1841
1841
<code class="prompt">C:\&gt; </code><strong class="userinput"><code>net use lpt1: \\sambaserver\printershare /user:ntadmin</code></strong>
1842
1842
</pre><p>
1843
 
should you desire to use the CUPS networked PostScript RIP functions. (Note that user &#8220;<span class="quote">ntadmin</span>&#8221;
 
1843
should you desire to use the CUPS networked PostScript RIP functions. (Note that user <span class="quote">&#8220;<span class="quote">ntadmin</span>&#8221;</span>
1844
1844
needs to be a valid Samba user with the required privileges to access the printershare.) This sets up the
1845
1845
printer connection in the traditional LanMan way (not using MS-RPC).
1846
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="cups-avoidps1"></a>Avoiding Critical PostScript Driver Settings on the Client</h3></div></div></div><p>
 
1846
</p></div><div class="sect2" title="Avoiding Critical PostScript Driver Settings on the Client"><div class="titlepage"><div><div><h3 class="title"><a name="cups-avoidps1"></a>Avoiding Critical PostScript Driver Settings on the Client</h3></div></div></div><p>
1847
1847
Printing works, but there are still problems. Most jobs print well, some do not print at all. Some jobs have
1848
1848
problems with fonts, which do not look very good. Some jobs print fast and some are dead-slow. Many of these
1849
1849
problems can be greatly reduced or even completely eliminated if you follow a few guidelines. Remember, if
1850
1850
your print device is not PostScript-enabled, you are treating your Ghostscript installation on your CUPS host
1851
1851
with the output your client driver settings produce. Treat it well:
1852
 
</p><div class="itemizedlist"><ul type="disc"><li><p>
 
1852
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
1853
1853
        Avoid the PostScript Output Option: Optimize for Speed setting. Use the Optimize for Portability instead
1854
 
        (Adobe PostScript driver).</p></li><li><p>
 
1854
        (Adobe PostScript driver).</p></li><li class="listitem"><p>
1855
1855
        Don't use the Page Independence: NO setting. Instead, use Page Independence: YES (CUPS PostScript Driver).
1856
 
        </p></li><li><p>
 
1856
        </p></li><li class="listitem"><p>
1857
1857
        Recommended is the True Type Font Downloading Option: Native True Type over Automatic and Outline; 
1858
 
        you should by all means avoid Bitmap (Adobe PostScript Driver).</p></li><li><p>
 
1858
        you should by all means avoid Bitmap (Adobe PostScript Driver).</p></li><li class="listitem"><p>
1859
1859
        Choose True Type Font: Download as Softfont into Printer over the default Replace by Device
1860
 
        Font (for exotic fonts, you may need to change it back to get a printout at all; Adobe).</p></li><li><p>
 
1860
        Font (for exotic fonts, you may need to change it back to get a printout at all; Adobe).</p></li><li class="listitem"><p>
1861
1861
        Sometimes you can choose PostScript Language Level: in case of problems try 2
1862
1862
        instead of 3 (the latest ESP Ghostscript package handles Level 3 PostScript very well; Adobe).
1863
 
        </p></li><li><p>
1864
 
        Say Yes to PostScript 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="id2643549"></a>Installing PostScript Driver Files Manually Using rpcclient</h2></div></div></div><p>
 
1863
        </p></li><li class="listitem"><p>
 
1864
        Say Yes to PostScript Error Handler (Adobe).</p></li></ul></div></div></div><div class="sect1" title="Installing PostScript Driver Files Manually Using rpcclient"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2649642"></a>Installing PostScript Driver Files Manually Using rpcclient</h2></div></div></div><p>
1865
1865
Of course, you can run all the commands that are embedded into the
1866
1866
cupsaddsmb convenience utility yourself, one by one, and upload
1867
1867
and prepare the driver files for future client downloads.
1868
 
</p><div class="orderedlist"><ol type="1"><li><p>Prepare Samba (a CUPS print queue with the name of the
1869
 
        printer should be there. We are providing the driver now).</p></li><li><p>Copy all files to <em class="parameter"><code>[print$]</code></em>.</p></li><li><p>
1870
 
        <a class="indexterm" name="id2643588"></a>
 
1868
</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>Prepare Samba (a CUPS print queue with the name of the
 
1869
        printer should be there. We are providing the driver now).</p></li><li class="listitem"><p>Copy all files to <em class="parameter"><code>[print$]</code></em>.</p></li><li class="listitem"><p>
 
1870
        <a class="indexterm" name="id2649681"></a>
1871
1871
        Run <code class="literal">rpcclient adddriver</code>
1872
 
        (for each client architecture you want to support).</p></li><li><p>
1873
 
        <a class="indexterm" name="id2643609"></a>
 
1872
        (for each client architecture you want to support).</p></li><li class="listitem"><p>
 
1873
        <a class="indexterm" name="id2649701"></a>
1874
1874
        Run <code class="literal">rpcclient setdriver.</code></p></li></ol></div><p>
1875
 
<a class="indexterm" name="id2643628"></a>
1876
 
<a class="indexterm" name="id2643637"></a>
1877
 
<a class="indexterm" name="id2643646"></a>
1878
 
<a class="indexterm" name="id2643655"></a>
1879
 
<a class="indexterm" name="id2643665"></a>
 
1875
<a class="indexterm" name="id2649720"></a>
 
1876
<a class="indexterm" name="id2649729"></a>
 
1877
<a class="indexterm" name="id2649739"></a>
 
1878
<a class="indexterm" name="id2649748"></a>
 
1879
<a class="indexterm" name="id2649757"></a>
1880
1880
We are going to do this now. First, read the man page on <em class="parameter"><code>rpcclient</code></em> to get a first idea.
1881
1881
Look at all the printing-related subcommands: <code class="literal">enumprinters</code>, <code class="literal">enumdrivers</code>,
1882
1882
<code class="literal">enumports</code>, <code class="literal">adddriver</code>, and <code class="literal">setdriver</code> are among the
1883
1883
most interesting ones. <em class="parameter"><code>rpcclient</code></em> implements an important part of the MS-RPC protocol.
1884
1884
You can use it to query (and command) a Windows NT (or 200x/XP) PC, too. MS-RPC is used by Windows clients,
1885
1885
among other things, to benefit from the Point'n'Print features. Samba can now mimic this as well.
1886
 
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2643723"></a>A Check of the rpcclient man Page</h3></div></div></div><p>
 
1886
</p><div class="sect2" title="A Check of the rpcclient man Page"><div class="titlepage"><div><div><h3 class="title"><a name="id2649816"></a>A Check of the rpcclient man Page</h3></div></div></div><p>
1887
1887
First let's check the <em class="parameter"><code>rpcclient</code></em> man page. Here are two relevant passages:
1888
1888
</p><p>
1889
 
<a class="indexterm" name="id2643742"></a>
1890
 
<a class="indexterm" name="id2643748"></a>
1891
 
<a class="indexterm" name="id2643755"></a>
 
1889
<a class="indexterm" name="id2649834"></a>
 
1890
<a class="indexterm" name="id2649841"></a>
 
1891
<a class="indexterm" name="id2649848"></a>
1892
1892
<code class="literal">adddriver &lt;arch&gt; &lt;config&gt;</code> Execute an <code class="literal">AddPrinterDriver()</code> RPC
1893
1893
to install the printer driver information on the server. The driver files should already exist in the
1894
1894
directory returned by <code class="literal">getdriverdir</code>. Possible values for <em class="parameter"><code>arch</code></em> are the
1904
1904
Default Data Type:\
1905
1905
Comma Separated list of Files
1906
1906
</pre><p>
1907
 
Any empty fields should be entered as the string &#8220;<span class="quote">NULL</span>&#8221;. 
 
1907
Any empty fields should be entered as the string <span class="quote">&#8220;<span class="quote">NULL</span>&#8221;</span>. 
1908
1908
</p><p>
1909
1909
Samba does not need to support the concept of print monitors, since these only apply to local printers whose
1910
 
drivers can use a bidirectional link for communication. This field should be &#8220;<span class="quote">NULL</span>&#8221;.  On a remote
 
1910
drivers can use a bidirectional link for communication. This field should be <span class="quote">&#8220;<span class="quote">NULL</span>&#8221;</span>.  On a remote
1911
1911
NT print server, the print monitor for a driver must already be installed before adding the driver or else the
1912
1912
RPC will fail.
1913
1913
</p><p>
1914
 
<a class="indexterm" name="id2643833"></a>
1915
 
<a class="indexterm" name="id2643840"></a>
 
1914
<a class="indexterm" name="id2649926"></a>
 
1915
<a class="indexterm" name="id2649933"></a>
1916
1916
<code class="literal">setdriver &lt;printername&gt; &lt;drivername&gt;</code> Execute a <code class="literal">SetPrinter()</code>
1917
1917
command to update the printer driver associated with an installed printer. The printer driver must already be
1918
1918
correctly installed on the print server.
1919
1919
</p><p>
1920
 
<a class="indexterm" name="id2643866"></a>
1921
 
<a class="indexterm" name="id2643872"></a>
 
1920
<a class="indexterm" name="id2649958"></a>
 
1921
<a class="indexterm" name="id2649965"></a>
1922
1922
See also the <code class="literal">enumprinters</code> and <code class="literal">enumdrivers</code> commands to
1923
1923
obtain a list of installed printers and drivers.
1924
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2643895"></a>Understanding the rpcclient man Page</h3></div></div></div><p>
1925
 
<a class="indexterm" name="id2643903"></a>
 
1924
</p></div><div class="sect2" title="Understanding the rpcclient man Page"><div class="titlepage"><div><div><h3 class="title"><a name="id2649987"></a>Understanding the rpcclient man Page</h3></div></div></div><p>
 
1925
<a class="indexterm" name="id2649996"></a>
1926
1926
The <span class="emphasis"><em>exact</em></span> format isn't made too clear by the man page, since you have to deal with some
1927
1927
parameters containing spaces. Here is a better description for it. We have line-broken the command and
1928
 
indicated the breaks with &#8220;<span class="quote">\</span>&#8221;. Usually you would type the command in one line without the line
 
1928
indicated the breaks with <span class="quote">&#8220;<span class="quote">\</span>&#8221;</span>. Usually you would type the command in one line without the line
1929
1929
breaks:
1930
1930
</p><pre class="screen">
1931
1931
adddriver "Architecture" \
1935
1935
What the man pages denote as a simple <em class="parameter"><code>&lt;config&gt;</code></em> keyword in reality consists of
1936
1936
eight colon-separated fields. The last field may take multiple (in some very insane cases, even 20 different
1937
1937
additional) files. This might sound confusing at first.  What the man pages call the
1938
 
&#8220;<span class="quote">LongPrinterName</span>&#8221; in reality should be called the &#8220;<span class="quote">Driver Name</span>&#8221;. You can name it
 
1938
<span class="quote">&#8220;<span class="quote">LongPrinterName</span>&#8221;</span> in reality should be called the <span class="quote">&#8220;<span class="quote">Driver Name</span>&#8221;</span>. You can name it
1939
1939
anything you want, as long as you use this name later in the <code class="literal">rpcclient ... setdriver</code>
1940
1940
command. For practical reasons, many name the driver the same as the printer.
1941
1941
</p><p>
1942
 
It isn't simple at all. I hear you asking: &#8220;<span class="quote">How do I know which files are Driver File</span>&#8221;,
1943
 
&#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 Monitor
1944
 
File in each case?</span>&#8221; For an answer, you may want to have a look at how a Windows NT box with a shared
 
1942
It isn't simple at all. I hear you asking: <span class="quote">&#8220;<span class="quote">How do I know which files are Driver File</span>&#8221;</span>,
 
1943
<span class="quote">&#8220;<span class="quote">Data File</span>&#8221;</span>, <span class="quote">&#8220;<span class="quote">Config File</span>&#8221;</span>, <span class="quote">&#8220;<span class="quote">Help File</span>&#8221;</span> and <span class="quote">&#8220;<span class="quote">Language Monitor
 
1944
File in each case?</span>&#8221;</span> For an answer, you may want to have a look at how a Windows NT box with a shared
1945
1945
printer presents the files to us. Remember that this whole procedure has to be developed by the Samba Team by
1946
1946
listening to the traffic caused by Windows computers on the wire. We may as well turn to a Windows box now and
1947
1947
access it from a UNIX workstation. We will query it with <code class="literal">rpcclient</code> to see what it tells us
1948
1948
and try to understand the man page more clearly.
1949
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2644000"></a>Producing an Example by Querying a Windows Box</h3></div></div></div><p>
1950
 
<a class="indexterm" name="id2644008"></a>
1951
 
<a class="indexterm" name="id2644017"></a>
 
1949
</p></div><div class="sect2" title="Producing an Example by Querying a Windows Box"><div class="titlepage"><div><div><h3 class="title"><a name="id2650092"></a>Producing an Example by Querying a Windows Box</h3></div></div></div><p>
 
1950
<a class="indexterm" name="id2650101"></a>
 
1951
<a class="indexterm" name="id2650110"></a>
1952
1952
We could run <code class="literal">rpcclient</code> with a <code class="literal">getdriver</code> or a
1953
1953
<code class="literal">getprinter</code> subcommand (in level 3 verbosity) against it. Just sit down at a UNIX or Linux
1954
1954
workstation with the Samba utilities installed, then type the following command:
1956
1956
<code class="prompt">root# </code><strong class="userinput"><code>rpcclient -U'user%secret' NT-SERVER -c 'getdriver printername 3'</code></strong>
1957
1957
</pre><p>
1958
1958
From the result it should become clear which is which. Here is an example from my installation:
1959
 
<a class="indexterm" name="id2644068"></a>
 
1959
<a class="indexterm" name="id2650161"></a>
1960
1960
</p><pre class="screen">
1961
1961
<code class="prompt">root# </code><strong class="userinput"><code>rpcclient -U'Danka%xxxx' W200xSERVER \
1962
1962
    -c'getdriver "DANKA InfoStream Virtual Printer" 3'</code></strong>
1986
1986
Some printer drivers list additional files under the label <em class="parameter"><code>Dependentfiles</code></em>, and these
1987
1987
would go into the last field <em class="parameter"><code>ListOfFiles,Comma-separated</code></em>. For the CUPS PostScript
1988
1988
drivers, we do not need any (nor would we for the Adobe PostScript driver); therefore, the field will get a
1989
 
&#8220;<span class="quote">NULL</span>&#8221; entry.
1990
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2644132"></a>Requirements for adddriver and setdriver to Succeed</h3></div></div></div><p>
1991
 
<a class="indexterm" name="id2644140"></a>
1992
 
<a class="indexterm" name="id2644150"></a>
1993
 
<a class="indexterm" name="id2644156"></a>
 
1989
<span class="quote">&#8220;<span class="quote">NULL</span>&#8221;</span> entry.
 
1990
</p></div><div class="sect2" title="Requirements for adddriver and setdriver to Succeed"><div class="titlepage"><div><div><h3 class="title"><a name="id2650224"></a>Requirements for adddriver and setdriver to Succeed</h3></div></div></div><p>
 
1991
<a class="indexterm" name="id2650233"></a>
 
1992
<a class="indexterm" name="id2650242"></a>
 
1993
<a class="indexterm" name="id2650249"></a>
1994
1994
From the man page (and from the quoted output of <code class="literal">cupsaddsmb</code> above) it becomes clear that
1995
1995
you need to have certain conditions in order to make the manual uploading and initializing of the driver files
1996
1996
succeed. The two <code class="literal">rpcclient</code> subcommands (<code class="literal">adddriver</code> and
1997
1997
<code class="literal">setdriver</code>) need to encounter the following preconditions to complete successfully:
1998
 
</p><div class="itemizedlist"><ul type="disc"><li><p>You are connected as <a class="link" href="smb.conf.5.html#PRINTERADMIN" target="_top">printer admin</a> or root (this is
1999
 
        <span class="emphasis"><em>not</em></span> the &#8220;<span class="quote">Printer Operators</span>&#8221; group in NT, but the <span class="emphasis"><em>printer
 
1998
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>You are connected as <a class="link" href="smb.conf.5.html#PRINTERADMIN" target="_top">printer admin</a> or root (this is
 
1999
        <span class="emphasis"><em>not</em></span> the <span class="quote">&#8220;<span class="quote">Printer Operators</span>&#8221;</span> group in NT, but the <span class="emphasis"><em>printer
2000
2000
        admin</em></span> group as defined in the <em class="parameter"><code>[global]</code></em> section of <code class="filename">smb.conf</code>).
2001
 
        </p></li><li><p>Copy all required driver files to <code class="filename">\\SAMBA\print$\w32x86</code> and
2002
 
        <code class="filename">\\SAMBA\print$\win40</code> as appropriate. They will end up in the &#8220;<span class="quote">0</span>&#8221; respective
2003
 
        &#8220;<span class="quote">2</span>&#8221; subdirectories later. For now, <span class="emphasis"><em>do not</em></span> put them there; they'll be
 
2001
        </p></li><li class="listitem"><p>Copy all required driver files to <code class="filename">\\SAMBA\print$\w32x86</code> and
 
2002
        <code class="filename">\\SAMBA\print$\win40</code> as appropriate. They will end up in the <span class="quote">&#8220;<span class="quote">0</span>&#8221;</span> respective
 
2003
        <span class="quote">&#8220;<span class="quote">2</span>&#8221;</span> subdirectories later. For now, <span class="emphasis"><em>do not</em></span> put them there; they'll be
2004
2004
        automatically used by the <code class="literal">adddriver</code> subcommand. (If you use <code class="literal">smbclient</code> to
2005
 
        put the driver files into the share, note that you need to escape the &#8220;<span class="quote">$</span>&#8221;: <code class="literal">smbclient
2006
 
        //sambaserver/print\$ -U root.</code>)</p></li><li><p>The user you're connecting as must be able to write to
 
2005
        put the driver files into the share, note that you need to escape the <span class="quote">&#8220;<span class="quote">$</span>&#8221;</span>: <code class="literal">smbclient
 
2006
        //sambaserver/print\$ -U root.</code>)</p></li><li class="listitem"><p>The user you're connecting as must be able to write to
2007
2007
        the <em class="parameter"><code>[print$]</code></em> share and create
2008
 
        subdirectories.</p></li><li><p>The printer you are going to set up for the Windows
2009
 
        clients needs to be installed in CUPS already.</p></li><li><p>
2010
 
        <a class="indexterm" name="id2644310"></a>
2011
 
        <a class="indexterm" name="id2644319"></a>
 
2008
        subdirectories.</p></li><li class="listitem"><p>The printer you are going to set up for the Windows
 
2009
        clients needs to be installed in CUPS already.</p></li><li class="listitem"><p>
 
2010
        <a class="indexterm" name="id2650402"></a>
 
2011
        <a class="indexterm" name="id2650411"></a>
2012
2012
        The CUPS printer must be known to Samba; otherwise the <code class="literal">setdriver</code> subcommand fails with an
2013
2013
        NT_STATUS_UNSUCCESSFUL error. To check if the printer is known by Samba, you may use the
2014
2014
        <code class="literal">enumprinters</code> subcommand to <code class="literal">rpcclient</code>. A long-standing bug prevented a
2015
2015
        proper update of the printer list until every smbd process had received a SIGHUP or was restarted. Remember
2016
2016
        this in case you've created the CUPS printer just recently and encounter problems: try restarting Samba.
2017
 
        </p></li></ul></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2644357"></a>Manual Driver Installation in 15 Steps</h3></div></div></div><p>
 
2017
        </p></li></ul></div></div><div class="sect2" title="Manual Driver Installation in 15 Steps"><div class="titlepage"><div><div><h3 class="title"><a name="id2650449"></a>Manual Driver Installation in 15 Steps</h3></div></div></div><p>
2018
2018
We are going to install a printer driver now by manually executing all
2019
2019
required commands. Because this may seem a rather complicated process at
2020
2020
first, we go through the procedure step by step, explaining every
2021
2021
single action item as it comes up.
2022
 
</p><div class="procedure"><a name="id2644370"></a><p class="title"><b>Procedure�22.2.�Manual Driver Installation</b></p><ol type="1"><li><p class="title"><b>Install the printer on CUPS.</b></p><pre class="screen">
 
2022
</p><div class="procedure" title="Procedure�22.2.�Manual Driver Installation"><a name="id2650463"></a><p class="title"><b>Procedure�22.2.�Manual Driver Installation</b></p><ol class="procedure" type="1"><li class="step" title="Install the printer on CUPS."><p class="title"><b>Install the printer on CUPS.</b></p><pre class="screen">
2023
2023
        <code class="prompt">root# </code><strong class="userinput"><code>lpadmin -p mysmbtstprn -v socket://10.160.51.131:9100 -E \
2024
2024
                                -P canonIR85.ppd</code></strong>
2025
2025
        </pre><p>
2027
2027
        to the CUPS system. The printer is accessed via a socket
2028
2028
        (a.k.a. JetDirect or Direct TCP/IP) connection. You need to be root
2029
2029
        for this step.
2030
 
        </p></li><li><p class="title"><b>(Optional.) Check if the printer is recognized by Samba.</b></p><p>
2031
 
        <a class="indexterm" name="id2644427"></a>
 
2030
        </p></li><li class="step" title="(Optional.) Check if the printer is recognized by Samba."><p class="title"><b>(Optional.) Check if the printer is recognized by Samba.</b></p><p>
 
2031
        <a class="indexterm" name="id2650519"></a>
2032
2032
</p><pre class="screen">
2033
2033
<code class="prompt">root# </code><strong class="userinput"><code>rpcclient -Uroot%xxxx -c 'enumprinters' localhost \
2034
2034
  | grep -C2 mysmbtstprn</code></strong>
2042
2042
</p><pre class="screen">
2043
2043
<code class="prompt">root# </code><strong class="userinput"><code>kill -HUP `pidof smbd`</code></strong>
2044
2044
</pre><p>
2045
 
        Check again. Troubleshoot and repeat until successful. Note the &#8220;<span class="quote">empty</span>&#8221; field between the two
2046
 
        commas in the &#8220;<span class="quote">description</span>&#8221; line. The driver name would appear here if there was one already. You
 
2045
        Check again. Troubleshoot and repeat until successful. Note the <span class="quote">&#8220;<span class="quote">empty</span>&#8221;</span> field between the two
 
2046
        commas in the <span class="quote">&#8220;<span class="quote">description</span>&#8221;</span> line. The driver name would appear here if there was one already. You
2047
2047
        need to know root's Samba password (as set by the <code class="literal">smbpasswd</code> command) for this step and most
2048
 
        of the following steps. Alternatively, you can authenticate as one of the users from the &#8220;<span class="quote">write
2049
 
        list</span>&#8221; as defined in <code class="filename">smb.conf</code> for <em class="parameter"><code>[print$]</code></em>.
2050
 
        </p></li><li><p class="title"><b>(Optional.) Check if Samba knows a driver for the printer.</b></p><p>
2051
 
        <a class="indexterm" name="id2644525"></a>
2052
 
        <a class="indexterm" name="id2644534"></a>
 
2048
        of the following steps. Alternatively, you can authenticate as one of the users from the <span class="quote">&#8220;<span class="quote">write
 
2049
        list</span>&#8221;</span> as defined in <code class="filename">smb.conf</code> for <em class="parameter"><code>[print$]</code></em>.
 
2050
        </p></li><li class="step" title="(Optional.) Check if Samba knows a driver for the printer."><p class="title"><b>(Optional.) Check if Samba knows a driver for the printer.</b></p><p>
 
2051
        <a class="indexterm" name="id2650617"></a>
 
2052
        <a class="indexterm" name="id2650626"></a>
2053
2053
</p><pre class="screen">
2054
2054
<code class="prompt">root# </code><strong class="userinput"><code>rpcclient -Uroot%xxxx -c 'getprinter mysmbtstprn 2'\
2055
2055
 localhost | grep driver </code></strong>
2075
2075
None of the three commands shown above should show a driver.
2076
2076
This step was done for the purpose of demonstrating this condition. An
2077
2077
attempt to connect to the printer at this stage will prompt a
2078
 
message along the lines of, &#8220;<span class="quote">The server does not have the required printer
2079
 
driver installed.</span>&#8221;
2080
 
</p></li><li><p class="title"><b>Put all required driver files into Samba's
 
2078
message along the lines of, <span class="quote">&#8220;<span class="quote">The server does not have the required printer
 
2079
driver installed.</span>&#8221;</span>
 
2080
</p></li><li class="step" title="Put all required driver files into Samba's [print$]."><p class="title"><b>Put all required driver files into Samba's
2081
2081
[print$].</b></p><pre class="screen">
2082
2082
<code class="prompt">root# </code><strong class="userinput"><code>smbclient //localhost/print\$ -U 'root%xxxx' \
2083
2083
        -c 'cd W32X86; \
2087
2087
        put /usr/share/cups/drivers/cups.hlp cups.hlp'</code></strong>
2088
2088
</pre><p>
2089
2089
(This command should be entered in one long single line. Line breaks and the line ends indicated by
2090
 
&#8220;<span class="quote">\</span>&#8221; have been inserted for readability reasons.) This step is <span class="emphasis"><em>required</em></span> for
 
2090
<span class="quote">&#8220;<span class="quote">\</span>&#8221;</span> have been inserted for readability reasons.) This step is <span class="emphasis"><em>required</em></span> for
2091
2091
the next one to succeed. It makes the driver files physically present in the <em class="parameter"><code>[print$]</code></em>
2092
2092
share. However, clients would still not be able to install them, because Samba does not yet treat them as
2093
 
driver files. A client asking for the driver would still be presented with a &#8220;<span class="quote">not installed here</span>&#8221;
 
2093
driver files. A client asking for the driver would still be presented with a <span class="quote">&#8220;<span class="quote">not installed here</span>&#8221;</span>
2094
2094
message.
2095
 
</p></li><li><p class="title"><b>Verify where the driver files are now.</b></p><pre class="screen">
 
2095
</p></li><li class="step" title="Verify where the driver files are now."><p class="title"><b>Verify where the driver files are now.</b></p><pre class="screen">
2096
2096
<code class="prompt">root# </code><strong class="userinput"><code>ls -l /etc/samba/drivers/W32X86/</code></strong>
2097
2097
total 669
2098
2098
drwxr-sr-x    2 root     ntadmin       532 May 25 23:08 2
2102
2102
-rwxr--r--    1 root     ntadmin    215848 May 25 23:21 cupsui.dll
2103
2103
-rwxr--r--    1 root     ntadmin    169458 May 25 23:21 mysmbtstprn.PPD
2104
2104
</pre><p>
2105
 
The driver files now are in the W32X86 architecture &#8220;<span class="quote">root</span>&#8221; of
 
2105
The driver files now are in the W32X86 architecture <span class="quote">&#8220;<span class="quote">root</span>&#8221;</span> of
2106
2106
<em class="parameter"><code>[print$]</code></em>.
2107
 
</p></li><li><p class="title"><b>Tell Samba that these are driver files (<code class="literal">adddriver</code>).</b></p><p>
2108
 
<a class="indexterm" name="id2644722"></a>
 
2107
</p></li><li class="step" title="Tell Samba that these are driver files (adddriver)."><p class="title"><b>Tell Samba that these are driver files (<code class="literal">adddriver</code>).</b></p><p>
 
2108
<a class="indexterm" name="id2650815"></a>
2109
2109
</p><pre class="screen">
2110
2110
<code class="prompt">root# </code><strong class="userinput"><code>rpcclient -Uroot%xxxx -c 'adddriver "Windows NT x86" \
2111
2111
        "mydrivername:cupsdrvr.dll:mysmbtstprn.PPD: \
2114
2114
Printer Driver mydrivername successfully installed.
2115
2115
</pre><p>
2116
2116
You cannot repeat this step if it fails. It could fail even as a result of a simple typo. It will most likely
2117
 
have moved a part of the driver files into the &#8220;<span class="quote">2</span>&#8221; subdirectory. If this step fails, you need to
 
2117
have moved a part of the driver files into the <span class="quote">&#8220;<span class="quote">2</span>&#8221;</span> subdirectory. If this step fails, you need to
2118
2118
go back to the fourth step and repeat it before you can try this one again. In this step, you need to choose a
2119
2119
name for your driver. It is normally a good idea to use the same name as is used for the printer name;
2120
2120
however, in big installations you may use this driver for a number of printers that obviously have different
2121
2121
names, so the name of the driver is not fixed.
2122
 
</p></li><li><p class="title"><b>Verify where the driver files are now.</b></p><pre class="screen">
 
2122
</p></li><li class="step" title="Verify where the driver files are now."><p class="title"><b>Verify where the driver files are now.</b></p><pre class="screen">
2123
2123
<code class="prompt">root# </code><strong class="userinput"><code>ls -l /etc/samba/drivers/W32X86/</code></strong>
2124
2124
total 1
2125
2125
drwxr-sr-x    2 root     ntadmin       532 May 25 23:22 2
2135
2135
</pre><p>
2136
2136
Notice how step 6 also moved the driver files to the appropriate
2137
2137
subdirectory. Compare this with the situation after step 5.
2138
 
</p></li><li><p class="title"><b>(Optional.) Verify if Samba now recognizes the driver.</b></p><p>
2139
 
<a class="indexterm" name="id2644830"></a>
 
2138
</p></li><li class="step" title="(Optional.) Verify if Samba now recognizes the driver."><p class="title"><b>(Optional.) Verify if Samba now recognizes the driver.</b></p><p>
 
2139
<a class="indexterm" name="id2650922"></a>
2140
2140
</p><pre class="screen">
2141
2141
<code class="prompt">root# </code><strong class="userinput"><code>rpcclient -Uroot%xxxx -c 'enumdrivers 3' \
2142
2142
        localhost | grep -B2 -A5 mydrivername</code></strong>
2151
2151
</pre><p>
2152
2152
Remember, this command greps for the name you chose for the
2153
2153
driver in step 6. This command must succeed before you can proceed.
2154
 
</p></li><li><p class="title"><b>Tell Samba which printer should use these driver files (<code class="literal">setdriver</code>).</b></p><p>
2155
 
<a class="indexterm" name="id2644885"></a>
 
2154
</p></li><li class="step" title="Tell Samba which printer should use these driver files (setdriver)."><p class="title"><b>Tell Samba which printer should use these driver files (<code class="literal">setdriver</code>).</b></p><p>
 
2155
<a class="indexterm" name="id2650977"></a>
2156
2156
</p><pre class="screen">
2157
2157
<code class="prompt">root# </code><strong class="userinput"><code>rpcclient -Uroot%xxxx -c 'setdriver mysmbtstprn mydrivername' \
2158
2158
        localhost</code></strong>
2162
2162
queues that use the same driver. You do not need to repeat all the previous steps for the setdriver command to
2163
2163
succeed. The only preconditions are that <code class="literal">enumdrivers</code> must find the driver and
2164
2164
<code class="literal">enumprinters</code> must find the printer.
2165
 
</p></li><li><p class="title"><b>(Optional) Verify if Samba has recognized this association.</b></p><p>
2166
 
<a class="indexterm" name="id2644944"></a>
2167
 
<a class="indexterm" name="id2644953"></a>
2168
 
<a class="indexterm" name="id2644963"></a>
 
2165
</p></li><li class="step" title="(Optional) Verify if Samba has recognized this association."><p class="title"><b>(Optional) Verify if Samba has recognized this association.</b></p><p>
 
2166
<a class="indexterm" name="id2651037"></a>
 
2167
<a class="indexterm" name="id2651046"></a>
 
2168
<a class="indexterm" name="id2651055"></a>
2169
2169
</p><pre class="screen">
2170
2170
<code class="prompt">root# </code><strong class="userinput"><code>rpcclient -Uroot%xxxx -c 'getprinter mysmbtstprn 2' localhost \
2171
2171
  | grep driver</code></strong>
2205
2205
     comment:[mysmbtstprn]
2206
2206
 
2207
2207
</pre><p>
2208
 
<a class="indexterm" name="id2645040"></a>
 
2208
<a class="indexterm" name="id2651133"></a>
2209
2209
Compare these results with the ones from steps 2 and 3. Every one of these commands show the driver is installed. Even
2210
2210
the <code class="literal">enumprinters</code> command now lists the driver
2211
 
on the &#8220;<span class="quote">description</span>&#8221; line.
2212
 
</p></li><li><p class="title"><b>(Optional.) Tickle the driver into a correct
 
2211
on the <span class="quote">&#8220;<span class="quote">description</span>&#8221;</span> line.
 
2212
</p></li><li class="step" title="(Optional.) Tickle the driver into a correct device mode."><p class="title"><b>(Optional.) Tickle the driver into a correct
2213
2213
device mode.</b></p><p>
2214
 
<a class="indexterm" name="id2645075"></a>
 
2214
<a class="indexterm" name="id2651168"></a>
2215
2215
You certainly know how to install the driver on the client. In case
2216
2216
you are not particularly familiar with Windows, here is a short
2217
2217
recipe: Browse the Network Neighborhood, go to the Samba server, and look
2226
2226
It is important that you execute this step as a Samba printer admin
2227
2227
(as defined in <code class="filename">smb.conf</code>). Here is another method
2228
2228
to do this on Windows XP. It uses a command line, which you may type
2229
 
into the &#8220;<span class="quote">DOS box</span>&#8221; (type root's smbpassword when prompted):
 
2229
into the <span class="quote">&#8220;<span class="quote">DOS box</span>&#8221;</span> (type root's smbpassword when prompted):
2230
2230
</p><pre class="screen">
2231
2231
<code class="prompt">C:\&gt; </code><strong class="userinput"><code>runas /netonly /user:root "rundll32 printui.dll,PrintUIEntry \
2232
2232
        /in /n \\sambaserver\mysmbtstprn"</code></strong>
2233
2233
</pre><p>
2234
2234
Change any printer setting once (like changing <span class="emphasis"><em><span class="guilabel">portrait</span> to
2235
2235
<span class="guilabel">landscape</span></em></span>), click on <span class="guibutton">Apply</span>, and change the setting back.
2236
 
</p></li><li><p class="title"><b>Install the printer on a client (Point'n'Print).</b></p><p>
2237
 
<a class="indexterm" name="id2645194"></a>
 
2236
</p></li><li class="step" title="Install the printer on a client (Point'n'Print)."><p class="title"><b>Install the printer on a client (Point'n'Print).</b></p><p>
 
2237
<a class="indexterm" name="id2651286"></a>
2238
2238
</p><pre class="screen">
2239
2239
<code class="prompt">C:\&gt; </code><strong class="userinput"><code>rundll32 printui.dll,PrintUIEntry /in /n "\\sambaserver\mysmbtstprn"</code></strong>
2240
2240
</pre><p>
2241
2241
If it does not work, it could be a permissions problem with the <em class="parameter"><code>[print$]</code></em> share.
2242
 
</p></li><li><p class="title"><b>(Optional) Print a test page.</b></p><a class="indexterm" name="id2645235"></a><pre class="screen">
 
2242
</p></li><li class="step" title="(Optional) Print a test page."><p class="title"><b>(Optional) Print a test page.</b></p><a class="indexterm" name="id2651328"></a><pre class="screen">
2243
2243
<code class="prompt">C:\&gt; </code><strong class="userinput"><code>rundll32 printui.dll,PrintUIEntry /p /n "\\sambaserver\mysmbtstprn"</code></strong>
2244
2244
</pre><p>
2245
2245
Then hit [TAB] five times, [ENTER] twice, [TAB] once, and [ENTER] again, and march to the printer.
2246
 
</p></li><li><p class="title"><b>(Recommended.) Study the test page.</b></p><p>
 
2246
</p></li><li class="step" title="(Recommended.) Study the test page."><p class="title"><b>(Recommended.) Study the test page.</b></p><p>
2247
2247
Hmmm. Just kidding! By now you know everything about printer installations and you do not need to read a word.
2248
2248
Just put it in a frame and bolt it to the wall with the heading "MY FIRST RPCCLIENT-INSTALLED PRINTER"
2249
2249
 why not just throw it away!
2250
 
</p></li><li><p class="title"><b>(Obligatory.) Enjoy. Jump. Celebrate your success.</b></p><pre class="screen">
 
2250
</p></li><li class="step" title="(Obligatory.) Enjoy. Jump. Celebrate your success."><p class="title"><b>(Obligatory.) Enjoy. Jump. Celebrate your success.</b></p><pre class="screen">
2251
2251
<code class="prompt">root# </code><strong class="userinput"><code>echo "Cheeeeerioooooo! Success..." &gt;&gt; /var/log/samba/log.smbd</code></strong>
2252
 
</pre></li></ol></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2645315"></a>Troubleshooting Revisited</h3></div></div></div><p>
2253
 
<a class="indexterm" name="id2645323"></a>
 
2252
</pre></li></ol></div></div><div class="sect2" title="Troubleshooting Revisited"><div class="titlepage"><div><div><h3 class="title"><a name="id2651408"></a>Troubleshooting Revisited</h3></div></div></div><p>
 
2253
<a class="indexterm" name="id2651416"></a>
2254
2254
The setdriver command will fail if in Samba's mind the queue is not
2255
2255
already there. A successful installation displys the promising message that the:
2256
2256
</p><pre class="screen">
2261
2261
<code class="computeroutput">
2262
2262
result was NT_STATUS_UNSUCCESSFUL
2263
2263
</code></p><p>
2264
 
<a class="indexterm" name="id2645355"></a>
2265
 
<a class="indexterm" name="id2645362"></a>
 
2264
<a class="indexterm" name="id2651448"></a>
 
2265
<a class="indexterm" name="id2651454"></a>
2266
2266
It is not good enough that you can see the queue in CUPS, using the <code class="literal">lpstat -p ir85wm</code>
2267
2267
command. A bug in most recent versions of Samba prevents the proper update of the queue list. The recognition
2268
2268
of newly installed CUPS printers fails unless you restart Samba or send a HUP to all smbd processes. To verify
2269
2269
if this is the reason why Samba does not execute the <code class="literal">setdriver</code> command successfully, check
2270
 
if Samba &#8220;<span class="quote">sees</span>&#8221; the printer:
2271
 
<a class="indexterm" name="id2645391"></a>
 
2270
if Samba <span class="quote">&#8220;<span class="quote">sees</span>&#8221;</span> the printer:
 
2271
<a class="indexterm" name="id2651484"></a>
2272
2272
</p><pre class="screen">
2273
2273
<code class="prompt">root# </code><strong class="userinput"><code>rpcclient transmeta -N -U'root%xxxx' -c 'enumprinters 0'|grep ir85wm</code></strong>
2274
2274
        printername:[ir85wm]
2275
2275
</pre><p>
2276
2276
An alternate command could be this: 
2277
 
<a class="indexterm" name="id2645421"></a>
 
2277
<a class="indexterm" name="id2651514"></a>
2278
2278
</p><pre class="screen">
2279
2279
<code class="prompt">root# </code><strong class="userinput"><code>rpcclient transmeta -N -U'root%secret' -c 'getprinter ir85wm' </code></strong>
2280
2280
        cmd = getprinter ir85wm
2284
2284
        comment:[CUPS PostScript-Treiber for Windows NT/200x/XP]
2285
2285
</pre><p>
2286
2286
By the way, you can use these commands, plus a few more, of course, to install drivers on remote Windows NT print servers too!
2287
 
</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2645458"></a>The Printing <code class="filename">*.tdb</code> Files</h2></div></div></div><p>
2288
 
<a class="indexterm" name="id2645472"></a>
2289
 
<a class="indexterm" name="id2645479"></a>
2290
 
<a class="indexterm" name="id2645488"></a>
2291
 
<a class="indexterm" name="id2645497"></a>
2292
 
<a class="indexterm" name="id2645506"></a>
2293
 
<a class="indexterm" name="id2645515"></a>
2294
 
<a class="indexterm" name="id2645524"></a>
2295
 
<a class="indexterm" name="id2645533"></a>
2296
 
<a class="indexterm" name="id2645542"></a>
2297
 
<a class="indexterm" name="id2645551"></a>
2298
 
<a class="indexterm" name="id2645560"></a>
2299
 
<a class="indexterm" name="id2645569"></a>
2300
 
<a class="indexterm" name="id2645578"></a>
 
2287
</p></div></div><div class="sect1" title="The Printing *.tdb Files"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2651551"></a>The Printing <code class="filename">*.tdb</code> Files</h2></div></div></div><p>
 
2288
<a class="indexterm" name="id2651565"></a>
 
2289
<a class="indexterm" name="id2651571"></a>
 
2290
<a class="indexterm" name="id2651580"></a>
 
2291
<a class="indexterm" name="id2651589"></a>
 
2292
<a class="indexterm" name="id2651598"></a>
 
2293
<a class="indexterm" name="id2651608"></a>
 
2294
<a class="indexterm" name="id2651617"></a>
 
2295
<a class="indexterm" name="id2651626"></a>
 
2296
<a class="indexterm" name="id2651634"></a>
 
2297
<a class="indexterm" name="id2651643"></a>
 
2298
<a class="indexterm" name="id2651652"></a>
 
2299
<a class="indexterm" name="id2651662"></a>
 
2300
<a class="indexterm" name="id2651671"></a>
2301
2301
Some mystery is associated with the series of files with a tdb suffix appearing in every Samba installation.
2302
2302
They are <code class="filename">connections.tdb</code>, <code class="filename">printing.tdb</code>,
2303
2303
<code class="filename">share_info.tdb</code>, <code class="filename">ntdrivers.tdb</code>, <code class="filename">unexpected.tdb</code>,
2304
2304
<code class="filename">brlock.tdb</code>, <code class="filename">locking.tdb</code>, <code class="filename">ntforms.tdb</code>,
2305
2305
<code class="filename">messages.tdb</code> , <code class="filename">ntprinters.tdb</code>, <code class="filename">sessionid.tdb</code>,
2306
2306
and <code class="filename">secrets.tdb</code>. What is their purpose?
2307
 
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2645661"></a>Trivial Database Files</h3></div></div></div><p>
2308
 
<a class="indexterm" name="id2645669"></a>
 
2307
</p><div class="sect2" title="Trivial Database Files"><div class="titlepage"><div><div><h3 class="title"><a name="id2651754"></a>Trivial Database Files</h3></div></div></div><p>
 
2308
<a class="indexterm" name="id2651762"></a>
2309
2309
A Windows NT (print) server keeps track of all information needed to serve its duty toward its clients by
2310
2310
storing entries in the Windows registry. Client queries are answered by reading from the registry,
2311
2311
Administrator or user configuration settings that are saved by writing into the registry. Samba and UNIX
2314
2314
<code class="filename">/var/lib/samba/</code> or <code class="filename">/var/lock/samba/</code>. The printing-related files are
2315
2315
<code class="filename">ntprinters.tdb</code>, <code class="filename">printing.tdb</code>,<code class="filename">ntforms.tdb</code>, and
2316
2316
<code class="filename">ntdrivers.tdb</code>.
2317
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2645729"></a>Binary Format</h3></div></div></div><p>
2318
 
<code class="filename">*.tdb</code> files are not human readable. They are written in a binary format. &#8220;<span class="quote">Why not
2319
 
ASCII?</span>&#8221;, you may ask. &#8220;<span class="quote">After all, ASCII configuration files are a good and proven tradition on
2320
 
UNIX.</span>&#8221; The reason for this design decision by the Samba Team is mainly performance. Samba needs to be
 
2317
</p></div><div class="sect2" title="Binary Format"><div class="titlepage"><div><div><h3 class="title"><a name="id2651821"></a>Binary Format</h3></div></div></div><p>
 
2318
<code class="filename">*.tdb</code> files are not human readable. They are written in a binary format. <span class="quote">&#8220;<span class="quote">Why not
 
2319
ASCII?</span>&#8221;</span>, you may ask. <span class="quote">&#8220;<span class="quote">After all, ASCII configuration files are a good and proven tradition on
 
2320
UNIX.</span>&#8221;</span> The reason for this design decision by the Samba Team is mainly performance. Samba needs to be
2321
2321
fast; it runs a separate <code class="literal">smbd</code> process for each client connection, in some environments many
2322
2322
thousands of them. Some of these <code class="literal">smbds</code> might need to write-access the same
2323
2323
<code class="filename">*.tdb</code> file <span class="emphasis"><em>at the same time</em></span>. The file format of Samba's
2324
2324
<code class="filename">*.tdb</code> files allows for this provision. Many smbd processes may write to the same
2325
2325
<code class="filename">*.tdb</code> file at the same time. This wouldn't be possible with pure ASCII files.
2326
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2645795"></a>Losing <code class="filename">*.tdb</code> Files</h3></div></div></div><p>
 
2326
</p></div><div class="sect2" title="Losing *.tdb Files"><div class="titlepage"><div><div><h3 class="title"><a name="id2651887"></a>Losing <code class="filename">*.tdb</code> Files</h3></div></div></div><p>
2327
2327
It is very important that all <code class="filename">*.tdb</code> files remain consistent over all write and read
2328
2328
accesses. However, it may happen that these files <span class="emphasis"><em>do</em></span> get corrupted. (A <code class="literal">kill -9
2329
2329
`pidof smbd'</code> while a write access is in progress could do the damage, as could a power interruption,
2330
2330
etc.). In cases of trouble, a deletion of the old printing-related <code class="filename">*.tdb</code> files may be the
2331
2331
only option. After that, you need to re-create all print-related setups unless you have made a backup of the
2332
2332
<code class="filename">*.tdb</code> files in time.
2333
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2645846"></a>Using <code class="literal">tdbbackup</code></h3></div></div></div><p>
2334
 
<a class="indexterm" name="id2645858"></a>
2335
 
<a class="indexterm" name="id2645869"></a>
 
2333
</p></div><div class="sect2" title="Using tdbbackup"><div class="titlepage"><div><div><h3 class="title"><a name="id2651938"></a>Using <code class="literal">tdbbackup</code></h3></div></div></div><p>
 
2334
<a class="indexterm" name="id2651950"></a>
 
2335
<a class="indexterm" name="id2651962"></a>
2336
2336
Samba ships with a little utility that helps the root user of your system to backup your
2337
2337
<code class="filename">*.tdb</code> files. If you run it with no argument, it prints a usage message:
2338
2338
</p><pre class="screen">
2359
2359
 -rw-------    1 root     root        40960 May  2 03:44 printing.tdb
2360
2360
 -rw-------    1 root     root        40960 May  2 03:44 printing.tdb.bak
2361
2361
 
2362
 
</pre></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2645965"></a>CUPS Print Drivers from Linuxprinting.org</h2></div></div></div><p>
2363
 
<a class="indexterm" name="id2645974"></a>
 
2362
</pre></div></div><div class="sect1" title="CUPS Print Drivers from Linuxprinting.org"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2652058"></a>CUPS Print Drivers from Linuxprinting.org</h2></div></div></div><p>
 
2363
<a class="indexterm" name="id2652066"></a>
2364
2364
CUPS ships with good support for HP LaserJet-type printers. You can install the generic driver as follows:
2365
 
<a class="indexterm" name="id2645983"></a>
 
2365
<a class="indexterm" name="id2652075"></a>
2366
2366
</p><pre class="screen">
2367
2367
<code class="prompt">root# </code><strong class="userinput"><code>lpadmin -p laserjet4plus -v parallel:/dev/lp0 -E -m laserjet.ppd</code></strong>
2368
2368
</pre><p>
2371
2371
<code class="filename">/usr/share/cups/model</code>. Alternatively, you may use <code class="option">-P /path/to/your.ppd</code>.
2372
2372
</p><p>
2373
2373
The generic <code class="filename">laserjet.ppd,</code> however, does not support every special option for every
2374
 
LaserJet-compatible model. It constitutes a sort of &#8220;<span class="quote">least common denominator</span>&#8221; of all the models.
 
2374
LaserJet-compatible model. It constitutes a sort of <span class="quote">&#8220;<span class="quote">least common denominator</span>&#8221;</span> of all the models.
2375
2375
If for some reason you must pay for the commercially available ESP Print Pro drivers, your first move should
2376
2376
be to consult the database on the <a class="ulink" href="http://www.linuxprinting.org/printer_list.cgi" target="_top">Linuxprinting</a> Web site.  Linuxprinting.org has
2377
2377
excellent recommendations about which driver is best used for each printer. Its database is kept current by
2378
2378
the tireless work of Till Kamppeter from Mandrakesoft, who is also the principal author of the
2379
2379
<code class="literal">foomatic-rip</code> utility.
2380
 
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
2381
 
<a class="indexterm" name="id2646072"></a>
2382
 
<a class="indexterm" name="id2646079"></a>
2383
 
<a class="indexterm" name="id2646086"></a>
 
2380
</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
 
2381
<a class="indexterm" name="id2652164"></a>
 
2382
<a class="indexterm" name="id2652171"></a>
 
2383
<a class="indexterm" name="id2652178"></a>
2384
2384
The former <code class="literal">cupsomatic</code> concept is now being replaced by the new successor, a much more
2385
2385
powerful <code class="literal">foomatic-rip</code>.  <code class="literal">cupsomatic</code> is no longer maintained. Here is the
2386
2386
new URL to the <a class="ulink" href="http://www.linuxprinting.org/driver_list.cgi" target="_top">Foomatic-3.0</a>
2389
2389
<code class="literal">cupsomatic</code>. The new-style PPDs are 100% compliant with the Adobe PPD specification. They
2390
2390
are also intended to be used by Samba and the cupsaddsmb utility, to provide the driver files for the Windows
2391
2391
clients!
2392
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2646141"></a>foomatic-rip and Foomatic Explained</h3></div></div></div><p>
2393
 
<a class="indexterm" name="id2646149"></a>
2394
 
<a class="indexterm" name="id2646156"></a>
 
2392
</p></div><div class="sect2" title="foomatic-rip and Foomatic Explained"><div class="titlepage"><div><div><h3 class="title"><a name="id2652233"></a>foomatic-rip and Foomatic Explained</h3></div></div></div><p>
 
2393
<a class="indexterm" name="id2652241"></a>
 
2394
<a class="indexterm" name="id2652248"></a>
2395
2395
Nowadays, most Linux distributions rely on the utilities from the <a class="ulink" href="http://www.linuxprinting.org/" target="_top">Linuxprinting.org</a> to create their printing-related software
2396
2396
(which, by the way, works on all UNIXes and on Mac OS X and Darwin, too).  The utilities from this sire have a
2397
2397
very end-user-friendly interface that allows for an easy update of drivers and PPDs for all supported models,
2402
2402
Linuxprinting.org keeps all the important facts about printer drivers, supported models, and which options are
2403
2403
available for the various driver/printer combinations in its <a class="ulink" href="http://www.linuxprinting.org/foomatic.html" target="_top">Foomatic</a> database. Currently there are <a class="ulink" href="http://www.linuxprinting.org/driver_list.cgi" target="_top">245 drivers</a> in the database. Many drivers support
2404
2404
various models, and many models may be driven by different drivers  its your choice!
2405
 
</p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2646210"></a>690 &#8220;<span class="quote">Perfect</span>&#8221; Printers</h4></div></div></div><p>
2406
 
<a class="indexterm" name="id2646222"></a>
 
2405
</p><div class="sect3" title="690 &#8220;Perfect&#8221; Printers"><div class="titlepage"><div><div><h4 class="title"><a name="id2652303"></a>690 <span class="quote">&#8220;<span class="quote">Perfect</span>&#8221;</span> Printers</h4></div></div></div><p>
 
2406
<a class="indexterm" name="id2652314"></a>
2407
2407
At present, there are 690 devices dubbed as working perfectly: 181 are <span class="emphasis"><em>mostly</em></span> perfect, 96
2408
2408
are <span class="emphasis"><em>partially</em></span> perfect, and 46 are paperweights. Keeping in mind that most of these are
2409
2409
non-PostScript models (PostScript printers are automatically supported by CUPS to perfection by using their
2411
2411
if it does not also scan and copy and fax under GNU/Linux  then this is a truly astonishing
2412
2412
achievement! Three years ago the number was not more than 500, and Linux or UNIX printing at the time wasn't
2413
2413
anywhere near the quality it is today.
2414
 
</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2646251"></a>How the Printing HOWTO Started It All</h4></div></div></div><p>
 
2414
</p></div><div class="sect3" title="How the Printing HOWTO Started It All"><div class="titlepage"><div><div><h4 class="title"><a name="id2652344"></a>How the Printing HOWTO Started It All</h4></div></div></div><p>
2415
2415
A few years ago <a class="ulink" href="http://www2.picante.com/" target="_top">Grant Taylor</a> started it all. The
2416
2416
roots of today's Linuxprinting.org are in the first <a class="ulink" href="http://www.linuxprinting.org/foomatic2.9/howto/" target="_top">Linux Printing HOWTO</a> that he authored. As a
2417
2417
side-project to this document, which served many Linux users and admins to guide their first steps in this
2418
 
complicated and delicate setup (to a scientist, printing is &#8220;<span class="quote">applying a structured deposition of
2419
 
distinct patterns of ink or toner particles on paper substrates</span>&#8221;), he started to build in a little
 
2418
complicated and delicate setup (to a scientist, printing is <span class="quote">&#8220;<span class="quote">applying a structured deposition of
 
2419
distinct patterns of ink or toner particles on paper substrates</span>&#8221;</span>), he started to build in a little
2420
2420
Postgres database with information about the hardware and driver zoo that made up Linux printing of the time.
2421
2421
This database became the core component of today's Foomatic collection of tools and data. In the meantime, it
2422
2422
has moved to an XML representation of the data.
2423
 
</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2646289"></a>Foomatic's Strange Name</h4></div></div></div><p>
2424
 
<a class="indexterm" name="id2646297"></a>
2425
 
&#8220;<span class="quote">Why the funny name?</span>&#8221; you ask. When it really took off, around spring 2000, CUPS was far less
 
2423
</p></div><div class="sect3" title="Foomatic's Strange Name"><div class="titlepage"><div><div><h4 class="title"><a name="id2652382"></a>Foomatic's Strange Name</h4></div></div></div><p>
 
2424
<a class="indexterm" name="id2652390"></a>
 
2425
<span class="quote">&#8220;<span class="quote">Why the funny name?</span>&#8221;</span> you ask. When it really took off, around spring 2000, CUPS was far less
2426
2426
popular than today, and most systems used LPD, LPRng, or even PDQ to print. CUPS shipped with a few generic
2427
2427
drivers (good for a few hundred different printer models). These didn't support many device-specific options.
2428
2428
CUPS also shipped with its own built-in rasterization filter (<em class="parameter"><code>pstoraster</code></em>, derived from
2431
2431
extensible.
2432
2432
</p><p>
2433
2433
Taylor already had in his database a respectable compilation of facts about many more printers and the
2434
 
Ghostscript &#8220;<span class="quote">drivers</span>&#8221; they run with. His idea, to generate PPDs from the database information and
 
2434
Ghostscript <span class="quote">&#8220;<span class="quote">drivers</span>&#8221;</span> they run with. His idea, to generate PPDs from the database information and
2435
2435
use them to make standard Ghostscript filters work within CUPS, proved to work very well. It also killed
2436
2436
several birds with one stone:
2437
 
</p><div class="itemizedlist"><ul type="disc"><li><p>It made all current and future Ghostscript filter
2438
 
        developments available for CUPS.</p></li><li><p>It made available a lot of additional printer models
 
2437
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>It made all current and future Ghostscript filter
 
2438
        developments available for CUPS.</p></li><li class="listitem"><p>It made available a lot of additional printer models
2439
2439
        to CUPS users (because often the traditional Ghostscript way of
2440
 
        printing was the only one available).</p></li><li><p>It gave all the advanced CUPS options (Web interface,
 
2440
        printing was the only one available).</p></li><li class="listitem"><p>It gave all the advanced CUPS options (Web interface,
2441
2441
        GUI driver configurations) to users wanting (or needing) to use
2442
 
        Ghostscript filters.</p></li></ul></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2646364"></a>cupsomatic, pdqomatic, lpdomatic, directomatic</h4></div></div></div><p>
2443
 
<a class="indexterm" name="id2646372"></a>
2444
 
<a class="indexterm" name="id2646379"></a>
2445
 
<a class="indexterm" name="id2646386"></a>
 
2442
        Ghostscript filters.</p></li></ul></div></div><div class="sect3" title="cupsomatic, pdqomatic, lpdomatic, directomatic"><div class="titlepage"><div><div><h4 class="title"><a name="id2652456"></a>cupsomatic, pdqomatic, lpdomatic, directomatic</h4></div></div></div><p>
 
2443
<a class="indexterm" name="id2652465"></a>
 
2444
<a class="indexterm" name="id2652472"></a>
 
2445
<a class="indexterm" name="id2652478"></a>
2446
2446
CUPS worked through a quickly hacked-up filter script named <a class="ulink" href="http://www.linuxprinting.org/download.cgi?filename=cupsomatic&amp;show=0" target="_top">cupsomatic</a>.  cupsomatic
2447
2447
ran the printfile through Ghostscript, constructing automatically the rather complicated command line needed.
2448
2448
It just needed to be copied into the CUPS system to make it work. To configure the way cupsomatic controls the
2459
2459
they had seen his <a class="ulink" href="http://www.fltk.org/" target="_top">FLTK</a>-based <a class="ulink" href="http://cups.sourceforge.net/xpp/" target="_top">XPP</a> (a GUI front-end to the CUPS lp-command). He added a huge
2460
2460
amount of new information and new printers. He also developed the support for other spoolers, like <a class="ulink" href="http://ppr.sourceforge.net/" target="_top">PPR</a> (via ppromatic), <a class="ulink" href="http://sourceforge.net/projects/lpr/" target="_top">GNUlpr</a>, and <a class="ulink" href="http://www.lprng.org/" target="_top">LPRng</a> (both via an extended lpdomatic) and spooler-less printing (<a class="ulink" href="http://www.linuxprinting.org/download.cgi?filename=directomatic&amp;show=0" target="_top">directomatic</a>).
2461
2461
</p><p>
2462
 
So, to answer your question, &#8220;<span class="quote">Foomatic</span>&#8221; is the general name for all the overlapping code and data
2463
 
behind the &#8220;<span class="quote">*omatic</span>&#8221; scripts.  Foomatic, up to versions 2.0.x, required (ugly) Perl data
2464
 
structures attached to Linuxprinting.org PPDs for CUPS. It had a different &#8220;<span class="quote">*omatic</span>&#8221; script for
 
2462
So, to answer your question, <span class="quote">&#8220;<span class="quote">Foomatic</span>&#8221;</span> is the general name for all the overlapping code and data
 
2463
behind the <span class="quote">&#8220;<span class="quote">*omatic</span>&#8221;</span> scripts.  Foomatic, up to versions 2.0.x, required (ugly) Perl data
 
2464
structures attached to Linuxprinting.org PPDs for CUPS. It had a different <span class="quote">&#8220;<span class="quote">*omatic</span>&#8221;</span> script for
2465
2465
every spooler, as well as different printer configuration files.
2466
 
</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2646520"></a>The <span class="emphasis"><em>Grand Unification</em></span> Achieved</h4></div></div></div><p>
2467
 
<a class="indexterm" name="id2646531"></a>
2468
 
This has all changed in Foomatic versions 2.9 (beta) and released as &#8220;<span class="quote">stable</span>&#8221; 3.0. It has now
 
2466
</p></div><div class="sect3" title="The Grand Unification Achieved"><div class="titlepage"><div><div><h4 class="title"><a name="id2652612"></a>The <span class="emphasis"><em>Grand Unification</em></span> Achieved</h4></div></div></div><p>
 
2467
<a class="indexterm" name="id2652624"></a>
 
2468
This has all changed in Foomatic versions 2.9 (beta) and released as <span class="quote">&#8220;<span class="quote">stable</span>&#8221;</span> 3.0. It has now
2469
2469
achieved the convergence of all *omatic scripts and is called the <a class="ulink" href="http://www.linuxprinting.org/foomatic2.9/download.cgi?filename=foomatic-rip&amp;show=0" target="_top">foomatic-rip</a>.
2470
2470
This single script is the unification of the previously different spooler-specific *omatic scripts.
2471
2471
foomatic-rip is used by all the different spoolers alike, and because it can read PPDs (both the original
2473
2473
have the power of PPDs at their disposal. Users only need to plug foomatic-rip into their system. For users
2474
2474
there is improved media type and source support  paper sizes and trays are easier to configure.
2475
2475
</p><p>
2476
 
<a class="indexterm" name="id2646567"></a>
2477
 
<a class="indexterm" name="id2646573"></a>
2478
 
<a class="indexterm" name="id2646580"></a>
 
2476
<a class="indexterm" name="id2652659"></a>
 
2477
<a class="indexterm" name="id2652665"></a>
 
2478
<a class="indexterm" name="id2652672"></a>
2479
2479
Also, the new generation of Linuxprinting.org PPDs no longer contains Perl data structures. If you are a
2480
2480
distro maintainer and have used the previous version of Foomatic, you may want to give the new one a spin, but
2481
2481
remember to generate a new-version set of PPDs via the new <a class="ulink" href="http://www.linuxprinting.org/download/foomatic/foomatic-db-engine-3.0.0beta1.tar.gz" target="_top">foomatic-db-engine!</a>.
2482
2482
Individual users just need to generate a single new PPD specific to their model by <a class="ulink" href="http://www.linuxprinting.org/kpfeifle/LinuxKongress2002/Tutorial/II.Foomatic-User/II.tutorial-handout-foomatic-user.html" target="_top">following
2483
2483
the steps</a> outlined in the Foomatic tutorial or in this chapter. This new development is truly amazing.
2484
2484
</p><p>
2485
 
<a class="indexterm" name="id2646613"></a>
2486
 
<a class="indexterm" name="id2646620"></a>
2487
 
<a class="indexterm" name="id2646627"></a>
 
2485
<a class="indexterm" name="id2652705"></a>
 
2486
<a class="indexterm" name="id2652712"></a>
 
2487
<a class="indexterm" name="id2652719"></a>
2488
2488
foomatic-rip is a very clever wrapper around the need to run Ghostscript with a different syntax, options,
2489
2489
device selections, and/or filters for each different printer or spooler. At the same time, it can read the PPD
2490
2490
associated with a print queue and modify the print job according to the user selections. Together with this
2492
2492
Foomatic concept may surprise users. It will support custom paper sizes for many printers and will support
2493
2493
printing on media drawn from different paper trays within the same job (in both cases, even where there is no
2494
2494
support for this from Windows-based vendor printer drivers).
2495
 
</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2646648"></a>Driver Development Outside</h4></div></div></div><p>
2496
 
<a class="indexterm" name="id2646656"></a>
 
2495
</p></div><div class="sect3" title="Driver Development Outside"><div class="titlepage"><div><div><h4 class="title"><a name="id2652740"></a>Driver Development Outside</h4></div></div></div><p>
 
2496
<a class="indexterm" name="id2652748"></a>
2497
2497
Most driver development itself does not happen within Linuxprinting.org. Drivers are written by independent
2498
2498
maintainers.  Linuxprinting.org just pools all the information and stores it in its database. In addition, it
2499
2499
also provides the Foomatic glue to integrate the many drivers into any modern (or legacy) printing system
2500
2500
known to the world.
2501
2501
</p><p>
2502
2502
Speaking of the different driver development groups, most of the work is currently done in three projects:
2503
 
</p><div class="itemizedlist"><ul type="disc"><li><p>
2504
 
<a class="indexterm" name="id2646680"></a>
 
2503
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
 
2504
<a class="indexterm" name="id2652773"></a>
2505
2505
        <a class="ulink" href="http://www-124.ibm.com/developerworks/oss/linux/projects/omni/" target="_top">Omni</a>
2506
2506
         a free software project by IBM that tries to convert its printer
2507
2507
        driver knowledge from good-ol' OS/2 times into a modern, modular,
2508
2508
        universal driver architecture for Linux/UNIX (still beta). This
2509
 
        currently supports 437 models.</p></li><li><p>
2510
 
<a class="indexterm" name="id2646705"></a>
 
2509
        currently supports 437 models.</p></li><li class="listitem"><p>
 
2510
<a class="indexterm" name="id2652797"></a>
2511
2511
        <a class="ulink" href="http://hpinkjet.sf.net/" target="_top">HPIJS</a> 
2512
2512
        a free software project by HP to provide the support for its own
2513
2513
        range of models (very mature, printing in most cases is perfect and
2514
2514
        provides true photo quality). This currently supports 369
2515
 
        models.</p></li><li><p>
2516
 
<a class="indexterm" name="id2646728"></a>
 
2515
        models.</p></li><li class="listitem"><p>
 
2516
<a class="indexterm" name="id2652820"></a>
2517
2517
        <a class="ulink" href="http://gimp-print.sourceforge.net/" target="_top">Gutenprint</a>  a free software
2518
2518
        effort, started by Michael Sweet (also lead developer for CUPS), now
2519
2519
        directed by Robert Krawitz, which has achieved an amazing level of
2520
2520
        photo print quality (many Epson users swear that its quality is
2521
2521
        better than the vendor drivers provided by Epson for the Microsoft
2522
 
        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="id2646752"></a>Forums, Downloads, Tutorials, Howtos (Also for Mac OS X and Commercial UNIX)</h4></div></div></div><p>
 
2522
        platforms). This currently supports 522 models.</p></li></ul></div></div><div class="sect3" title="Forums, Downloads, Tutorials, Howtos (Also for Mac OS X and Commercial UNIX)"><div class="titlepage"><div><div><h4 class="title"><a name="id2652845"></a>Forums, Downloads, Tutorials, Howtos (Also for Mac OS X and Commercial UNIX)</h4></div></div></div><p>
2523
2523
Linuxprinting.org today is the one-stop shop to download printer drivers. Look for printer information and
2524
2524
<a class="ulink" href="http://www.linuxprinting.org//kpfeifle/LinuxKongress2002/Tutorial/" target="_top">tutorials</a> or solve
2525
2525
printing problems in its popular <a class="ulink" href="http://www.linuxprinting.org/newsportal/" target="_top">forums</a>. This
2528
2528
<a class="ulink" href="http://www.linuxprinting.org/newsportal/thread.php3?name=linuxprinting.macosx.general" target="_top">Mac OS X
2529
2529
forum</a> has turned out to be one of the most frequented forums after only a few weeks.
2530
2530
</p><p>
2531
 
<a class="indexterm" name="id2646797"></a>
2532
 
<a class="indexterm" name="id2646804"></a>
2533
 
<a class="indexterm" name="id2646811"></a>
 
2531
<a class="indexterm" name="id2652890"></a>
 
2532
<a class="indexterm" name="id2652896"></a>
 
2533
<a class="indexterm" name="id2652903"></a>
2534
2534
Linuxprinting.org and the Foomatic driver wrappers around Ghostscript are now a standard tool-chain for
2535
2535
printing on all the important distros. Most of them also have CUPS underneath. While in recent years most
2536
2536
printer data had been added by Kamppeter, many additional contributions came from engineers with SuSE, Red
2537
2537
Hat, Conectiva, Debian, and others. Vendor-neutrality is an important goal of the Foomatic project. Mandrake
2538
2538
and Conectiva have merged and are now called Mandriva.
2539
 
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
 
2539
</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
2540
2540
Till Kamppeter from Mandrakesoft is doing an excellent job in his spare time to maintain Linuxprinting.org and
2541
2541
Foomatic. So if you use it often, please send him a note showing your appreciation.
2542
 
</p></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2646836"></a>Foomatic Database-Generated PPDs</h4></div></div></div><p>
2543
 
<a class="indexterm" name="id2646844"></a>
2544
 
<a class="indexterm" name="id2646851"></a>
2545
 
<a class="indexterm" name="id2646858"></a>
2546
 
<a class="indexterm" name="id2646864"></a>
2547
 
<a class="indexterm" name="id2646871"></a>
2548
 
<a class="indexterm" name="id2646878"></a>
2549
 
<a class="indexterm" name="id2646885"></a>
2550
 
<a class="indexterm" name="id2646892"></a>
2551
 
<a class="indexterm" name="id2646899"></a>
 
2542
</p></div></div><div class="sect3" title="Foomatic Database-Generated PPDs"><div class="titlepage"><div><div><h4 class="title"><a name="id2652928"></a>Foomatic Database-Generated PPDs</h4></div></div></div><p>
 
2543
<a class="indexterm" name="id2652936"></a>
 
2544
<a class="indexterm" name="id2652943"></a>
 
2545
<a class="indexterm" name="id2652950"></a>
 
2546
<a class="indexterm" name="id2652957"></a>
 
2547
<a class="indexterm" name="id2652964"></a>
 
2548
<a class="indexterm" name="id2652970"></a>
 
2549
<a class="indexterm" name="id2652977"></a>
 
2550
<a class="indexterm" name="id2652984"></a>
 
2551
<a class="indexterm" name="id2652991"></a>
2552
2552
The Foomatic database is an amazing piece of ingenuity in itself. Not only does it keep the printer and driver
2553
2553
information, but it is organized in a way that it can generate PPD files on the fly from its internal
2554
2554
XML-based datasets. While these PPDs are modeled to the Adobe specification of PPDs, the
2563
2563
This usage of PPDs to describe the options of non-PostScript printers was the invention of the CUPS
2564
2564
developers. The rest is easy.  GUI tools (like KDE's marvelous <a class="ulink" href="http://printing.kde.org/overview/kprinter.phtml" target="_top">kprinter</a> or the GNOME <a class="ulink" href="http://gtklp.sourceforge.net/" target="_top">gtklp</a> xpp and the CUPS Web interface) read the PPD as well and use
2565
2565
this information to present the available settings to the user as an intuitive menu selection.
2566
 
</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2646962"></a>foomatic-rip and Foomatic PPD Download and Installation</h3></div></div></div><p>
 
2566
</p></div></div><div class="sect2" title="foomatic-rip and Foomatic PPD Download and Installation"><div class="titlepage"><div><div><h3 class="title"><a name="id2653055"></a>foomatic-rip and Foomatic PPD Download and Installation</h3></div></div></div><p>
2567
2567
Here are the steps to install a foomatic-rip-driven LaserJet 4 Plus-compatible
2568
2568
printer in CUPS (note that recent distributions of SuSE, UnitedLinux and
2569
2569
Mandrake may ship with a complete package of Foomatic-PPDs plus the
2570
2570
<code class="literal">foomatic-rip</code> utility. Going directly to
2571
2571
Linuxprinting.org ensures that you get the latest driver/PPD files).
2572
 
</p><div class="itemizedlist"><ul type="disc"><li><p>Open your browser at the Linuxprinting.org printer list <a class="ulink" href="http://www.linuxprinting.org/printer_list.cgi" target="_top">page.</a>
2573
 
        </p></li><li><p>Check the complete list of printers in the 
 
2572
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Open your browser at the Linuxprinting.org printer list <a class="ulink" href="http://www.linuxprinting.org/printer_list.cgi" target="_top">page.</a>
 
2573
        </p></li><li class="listitem"><p>Check the complete list of printers in the 
2574
2574
        <a class="ulink" href="http://www.linuxprinting.org/printer_list.cgi?make=Anyone" target="_top">database.</a>.
2575
 
        </p></li><li><p>Select your model and click on the link.
2576
 
        </p></li><li><p>You'll arrive at a page listing all drivers working with this
 
2575
        </p></li><li class="listitem"><p>Select your model and click on the link.
 
2576
        </p></li><li class="listitem"><p>You'll arrive at a page listing all drivers working with this
2577
2577
        model (for all printers, there will always be <span class="emphasis"><em>one</em></span>
2578
2578
        recommended driver. Try this one first).
2579
 
        </p></li><li><p>In our case (HP LaserJet 4 Plus), we'll arrive at the default driver for the
 
2579
        </p></li><li class="listitem"><p>In our case (HP LaserJet 4 Plus), we'll arrive at the default driver for the
2580
2580
        <a class="ulink" href="http://www.linuxprinting.org/show_printer.cgi?recnum=HP-LaserJet_4_Plus" target="_top">HP-LaserJet 4 Plus.</a>
2581
 
        </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
 
2581
        </p></li><li class="listitem"><p>The recommended driver is ljet4.</p></li><li class="listitem"><p>Several links are provided here. You should visit them all if you
2582
2582
        are not familiar with the Linuxprinting.org database.
2583
 
        </p></li><li><p>There is a link to the database page for the
 
2583
        </p></li><li class="listitem"><p>There is a link to the database page for the
2584
2584
        <a class="ulink" href="http://www.linuxprinting.org/show_driver.cgi?driver=ljet4" target="_top">ljet4</a>.
2585
2585
        On the driver's page, you'll find important and detailed information
2586
2586
        about how to use that driver within the various available
2587
 
        spoolers.</p></li><li><p>Another link may lead you to the home page of the
2588
 
        author of the driver.</p></li><li><p>Important links are the ones that provide hints with
 
2587
        spoolers.</p></li><li class="listitem"><p>Another link may lead you to the home page of the
 
2588
        author of the driver.</p></li><li class="listitem"><p>Important links are the ones that provide hints with
2589
2589
        setup instructions for <a class="ulink" href="http://www.linuxprinting.org/cups-doc.html" target="_top">CUPS</a>;
2590
2590
        <a class="ulink" href="http://www.linuxprinting.org/pdq-doc.html" target="_top">PDQ</a>;
2591
2591
        <a class="ulink" href="http://www.linuxprinting.org/lpd-doc.html" target="_top">LPD, LPRng, and GNUlpr</a>);
2592
2592
        as well as <a class="ulink" href="http://www.linuxprinting.org/ppr-doc.html" target="_top">PPR</a>
2593
 
        or &#8220;<span class="quote">spoolerless</span>&#8221; <a class="ulink" href="http://www.linuxprinting.org/direct-doc.html" target="_top">printing</a>.
2594
 
        </p></li><li><p>You can view the PPD in your browser through this link:
 
2593
        or <span class="quote">&#8220;<span class="quote">spoolerless</span>&#8221;</span> <a class="ulink" href="http://www.linuxprinting.org/direct-doc.html" target="_top">printing</a>.
 
2594
        </p></li><li class="listitem"><p>You can view the PPD in your browser through this link:
2595
2595
        <a class="ulink" href="http://www.linuxprinting.org/ppd-o-matic.cgi?driver=ljet4&amp;printer=HP-LaserJet_4_Plus&amp;show=1" target="_top">http://www.linuxprinting.org/ppd-o-matic.cgi?driver=ljet4&amp;printer=HP-LaserJet_4_Plus&amp;show=1</a>
2596
 
        </p></li><li><p>Most importantly, you can also generate and download
 
2596
        </p></li><li class="listitem"><p>Most importantly, you can also generate and download
2597
2597
        the <a class="ulink" href="http://www.linuxprinting.org/ppd-o-matic.cgi?driver=ljet4&amp;printer=HP-LaserJet_4_Plus&amp;show=0" target="_top">PPD</a>.
2598
 
        </p></li><li><p>The PPD contains all the information needed to use our
 
2598
        </p></li><li class="listitem"><p>The PPD contains all the information needed to use our
2599
2599
        model and the driver; once installed, this works transparently
2600
2600
        for the user. Later you'll only need to choose resolution, paper size,
2601
2601
        and so on, from the Web-based menu, or from the print dialog GUI, or from
2602
 
        the command line.</p></li><li><p>If you ended up on the drivers
 
2602
        the command line.</p></li><li class="listitem"><p>If you ended up on the drivers
2603
2603
        <a class="ulink" href="http://www.linuxprinting.org/show_driver.cgi?driver=ljet4" target="_top">page</a>,
2604
 
        you can choose to use the &#8220;<span class="quote">PPD-O-Matic</span>&#8221; online PPD generator
2605
 
        program.</p></li><li><p>Select the exact model and check either <span class="guilabel">Download</span> or
2606
 
        <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
 
2604
        you can choose to use the <span class="quote">&#8220;<span class="quote">PPD-O-Matic</span>&#8221;</span> online PPD generator
 
2605
        program.</p></li><li class="listitem"><p>Select the exact model and check either <span class="guilabel">Download</span> or
 
2606
        <span class="guilabel">Display PPD file</span> and click <span class="guilabel">Generate PPD file</span>.</p></li><li class="listitem"><p>If you save the PPD file from the browser view, please
2607
2607
        do not use cut and paste (since it could possibly damage line endings
2608
2608
        and tabs, which makes the PPD likely to fail its duty), but use <span class="guimenuitem">Save
2609
2609
        as...</span> in your browser's menu. (It is best to use the <span class="guilabel">Download</span> option
2610
 
        directly from the Web page.)</p></li><li><p>Another interesting part on each driver page is
 
2610
        directly from the Web page.)</p></li><li class="listitem"><p>Another interesting part on each driver page is
2611
2611
        the <span class="guimenuitem">Show execution details</span> button. If you
2612
2612
        select your printer model and click on that button,
2613
2613
        a complete Ghostscript command line will be displayed, enumerating all options
2614
2614
        available for that combination of driver and printer model. This is a great way to
2615
 
        &#8220;<span class="quote">learn Ghostscript by doing</span>&#8221;. It is also an excellent cheat sheet
 
2615
        <span class="quote">&#8220;<span class="quote">learn Ghostscript by doing</span>&#8221;</span>. It is also an excellent cheat sheet
2616
2616
        for all experienced users who need to reconstruct a good command line
2617
2617
        for that darned printing script, but can't remember the exact
2618
 
        syntax. </p></li><li><p>Sometime during your visit to Linuxprinting.org, save
 
2618
        syntax. </p></li><li class="listitem"><p>Sometime during your visit to Linuxprinting.org, save
2619
2619
        the PPD to a suitable place on your hard disk, say
2620
2620
        <code class="filename">/path/to/my-printer.ppd</code> (if you prefer to install
2621
2621
        your printers with the help of the CUPS Web interface, save the PPD to
2622
2622
        the <code class="filename">/usr/share/cups/model/</code> path and restart
2623
 
        cupsd).</p></li><li><p>Then install the printer with a suitable command line,
 
2623
        cupsd).</p></li><li class="listitem"><p>Then install the printer with a suitable command line,
2624
2624
        like this: 
2625
2625
        </p><pre class="screen">
2626
2626
        <code class="prompt">root# </code><strong class="userinput"><code>lpadmin -p laserjet4plus -v parallel:/dev/lp0 -E \
2627
2627
                -P path/to/my-printer.ppd</code></strong>
2628
 
        </pre></li><li><p>For all the new-style &#8220;<span class="quote">Foomatic-PPDs</span>&#8221;
 
2628
        </pre></li><li class="listitem"><p>For all the new-style <span class="quote">&#8220;<span class="quote">Foomatic-PPDs</span>&#8221;</span>
2629
2629
        from Linuxprinting.org, you also need a special CUPS filter named
2630
2630
        foomatic-rip. 
2631
 
        </p></li><li><p>The foomatic-rip Perl script itself also makes some
 
2631
        </p></li><li class="listitem"><p>The foomatic-rip Perl script itself also makes some
2632
2632
        interesting <a class="ulink" href="http://www.linuxprinting.org/foomatic2.9/download.cgi?filename=foomatic-rip&amp;show=1" target="_top">reading</a>
2633
2633
        because it is well documented by Kamppeter's in-line comments (even
2634
2634
        non-Perl hackers will learn quite a bit about printing by reading
2635
 
        it).</p></li><li><p>Save foomatic-rip either directly in
 
2635
        it).</p></li><li class="listitem"><p>Save foomatic-rip either directly in
2636
2636
        <code class="filename">/usr/lib/cups/filter/foomatic-rip</code> or somewhere in
2637
2637
        your $PATH (and remember to make it world-executable). Again,
2638
2638
        do not save by copy and paste but use the appropriate link or the
2639
 
        <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:
 
2639
        <span class="guimenuitem">Save as...</span>  menu item in your browser.</p></li><li class="listitem"><p>If you save foomatic-rip in your $PATH, create a symlink:
2640
2640
        </p><pre class="screen">
2641
2641
        <code class="prompt">root# </code><strong class="userinput"><code>cd /usr/lib/cups/filter/ ; ln -s `which foomatic-rip'</code></strong>
2642
2642
        </pre><p>
2648
2648
specially encoded Foomatic comments embedded in the job file. These in turn are used to construct
2649
2649
(transparently for you, the user) the complicated Ghostscript command line telling the printer driver exactly
2650
2650
how the resulting raster data should look and which printer commands to embed into the data stream. You need:
2651
 
</p><div class="itemizedlist"><ul type="disc"><li><p>A &#8220;<span class="quote">foomatic+something</span>&#8221; PPD  but this is not enough
 
2651
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>A <span class="quote">&#8220;<span class="quote">foomatic+something</span>&#8221;</span> PPD  but this is not enough
2652
2652
        to print with CUPS (it is only <span class="emphasis"><em>one</em></span> important
2653
 
        component).</p></li><li><p>The <em class="parameter"><code>foomatic-rip</code></em> filter script (Perl) in
2654
 
        <code class="filename">/usr/lib/cups/filters/</code>.</p></li><li><p>Perl to make foomatic-rip run.</p></li><li><p>Ghostscript (because it is doing the main work,
 
2653
        component).</p></li><li class="listitem"><p>The <em class="parameter"><code>foomatic-rip</code></em> filter script (Perl) in
 
2654
        <code class="filename">/usr/lib/cups/filters/</code>.</p></li><li class="listitem"><p>Perl to make foomatic-rip run.</p></li><li class="listitem"><p>Ghostscript (because it is doing the main work,
2655
2655
        controlled by the PPD/foomatic-rip combo) to produce the raster data
2656
 
        fit for your printer model's consumption.</p></li><li><p>Ghostscript <span class="emphasis"><em>must</em></span> (depending on
 
2656
        fit for your printer model's consumption.</p></li><li class="listitem"><p>Ghostscript <span class="emphasis"><em>must</em></span> (depending on
2657
2657
        the driver/model) contain support for a certain device representing
2658
 
        the selected driver for your model (as shown by <code class="literal">gs -h</code>).</p></li><li><p>foomatic-rip needs a new version of PPDs (PPD versions
2659
 
        produced for cupsomatic do not work with 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="id2647435"></a>Page Accounting with CUPS</h2></div></div></div><p>
2660
 
<a class="indexterm" name="id2647443"></a>
 
2658
        the selected driver for your model (as shown by <code class="literal">gs -h</code>).</p></li><li class="listitem"><p>foomatic-rip needs a new version of PPDs (PPD versions
 
2659
        produced for cupsomatic do not work with foomatic-rip).</p></li></ul></div></div></div><div class="sect1" title="Page Accounting with CUPS"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2653528"></a>Page Accounting with CUPS</h2></div></div></div><p>
 
2660
<a class="indexterm" name="id2653536"></a>
2661
2661
Often there are questions regarding print quotas where Samba users (that is, Windows clients) should not be
2662
2662
able to print beyond a certain number of pages or data volume per day, week, or month. This feature is
2663
2663
dependent on the real print subsystem you're using.  Samba's part is always to receive the job files from the
2665
2665
</p><p>
2666
2666
Of course one could hack things with one's own scripts. But then there is CUPS. CUPS supports quotas that can
2667
2667
be based on the size of jobs or on the number of pages or both, and can span any time period you want.
2668
 
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2647471"></a>Setting Up Quotas</h3></div></div></div><p>
2669
 
<a class="indexterm" name="id2647479"></a>
 
2668
</p><div class="sect2" title="Setting Up Quotas"><div class="titlepage"><div><div><h3 class="title"><a name="id2653563"></a>Setting Up Quotas</h3></div></div></div><p>
 
2669
<a class="indexterm" name="id2653571"></a>
2670
2670
This is an example command of how root would set a print quota in CUPS, assuming an existing printer named
2671
 
&#8220;<span class="quote">quotaprinter</span>&#8221;:
2672
 
<a class="indexterm" name="id2647493"></a>
 
2671
<span class="quote">&#8220;<span class="quote">quotaprinter</span>&#8221;</span>:
 
2672
<a class="indexterm" name="id2653586"></a>
2673
2673
</p><pre class="screen">
2674
2674
<code class="prompt">root# </code><strong class="userinput"><code>lpadmin -p quotaprinter -o job-quota-period=604800 \
2675
2675
        -o job-k-limit=1024 -o job-page-limit=100</code></strong>
2676
2676
</pre><p>
2677
2677
This would limit every single user to print no more than 100 pages or 1024 KB of
2678
2678
data (whichever comes first) within the last 604,800 seconds ( = 1 week).
2679
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2647525"></a>Correct and Incorrect Accounting</h3></div></div></div><p>
 
2679
</p></div><div class="sect2" title="Correct and Incorrect Accounting"><div class="titlepage"><div><div><h3 class="title"><a name="id2653617"></a>Correct and Incorrect Accounting</h3></div></div></div><p>
2680
2680
For CUPS to count correctly, the printfile needs to pass the CUPS pstops filter; otherwise it uses a dummy
2681
 
count of &#8220;<span class="quote">one</span>&#8221;. Some print files do not pass it (e.g., image files), but then those are mostly
 
2681
count of <span class="quote">&#8220;<span class="quote">one</span>&#8221;</span>. Some print files do not pass it (e.g., image files), but then those are mostly
2682
2682
one-page jobs anyway. This also means that proprietary drivers for the target printer running on the client
2683
 
computers and CUPS/Samba, which then spool these files as &#8220;<span class="quote">raw</span>&#8221; (i.e., leaving them untouched,
 
2683
computers and CUPS/Samba, which then spool these files as <span class="quote">&#8220;<span class="quote">raw</span>&#8221;</span> (i.e., leaving them untouched,
2684
2684
not filtering them), will be counted as one-pagers too!
2685
2685
</p><p>
2686
2686
You need to send PostScript from the clients (i.e., run a PostScript driver there) to have the chance to get
2687
2687
accounting done. If the printer is a non-PostScript model, you need to let CUPS do the job to convert the file
2688
2688
to a print-ready format for the target printer. This is currently working for about a thousand different
2689
2689
printer models.  Linuxprinting.org has a driver <a class="ulink" href="http://www.linuxprinting.org/printer_list.cgi" target="_top">list</a>.
2690
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2647565"></a>Adobe and CUPS PostScript Drivers for Windows Clients</h3></div></div></div><p>
2691
 
<a class="indexterm" name="id2647574"></a>
2692
 
<a class="indexterm" name="id2647581"></a>
2693
 
<a class="indexterm" name="id2647588"></a>
2694
 
<a class="indexterm" name="id2647594"></a>
2695
 
<a class="indexterm" name="id2647601"></a>
 
2690
</p></div><div class="sect2" title="Adobe and CUPS PostScript Drivers for Windows Clients"><div class="titlepage"><div><div><h3 class="title"><a name="id2653658"></a>Adobe and CUPS PostScript Drivers for Windows Clients</h3></div></div></div><p>
 
2691
<a class="indexterm" name="id2653666"></a>
 
2692
<a class="indexterm" name="id2653673"></a>
 
2693
<a class="indexterm" name="id2653680"></a>
 
2694
<a class="indexterm" name="id2653687"></a>
 
2695
<a class="indexterm" name="id2653693"></a>
2696
2696
Before CUPS 1.1.16, your only option was to use the Adobe PostScript driver on the Windows clients. The output
2697
2697
of this driver was not always passed through the <code class="literal">pstops</code> filter on the CUPS/Samba side, and
2698
2698
therefore was not counted correctly (the reason is that it often, depending on the PPD being used, wrote a
2703
2703
clients (which is tagged in the download area of <code class="filename">http://www.cups.org/</code> as the
2704
2704
<code class="filename">cups-samba-1.1.16.tar.gz</code> package). It does <span class="emphasis"><em>not</em></span> work for Windows
2705
2705
9x/Me clients, but it guarantees:
2706
 
</p><div class="itemizedlist"><ul type="disc"><li><p> <a class="indexterm" name="id2647662"></a> To not write a PJL-header.</p></li><li><p>To still read and support all PJL-options named in the
2707
 
        driver PPD with its own means.</p></li><li><p>That the file will pass through the <code class="literal">pstops</code> filter
2708
 
        on the CUPS/Samba server.</p></li><li><p>To page-count correctly the print file.</p></li></ul></div><p>
 
2706
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p> <a class="indexterm" name="id2653754"></a> To not write a PJL-header.</p></li><li class="listitem"><p>To still read and support all PJL-options named in the
 
2707
        driver PPD with its own means.</p></li><li class="listitem"><p>That the file will pass through the <code class="literal">pstops</code> filter
 
2708
        on the CUPS/Samba server.</p></li><li class="listitem"><p>To page-count correctly the print file.</p></li></ul></div><p>
2709
2709
You can read more about the setup of this combination in the man page for <code class="literal">cupsaddsmb</code> (which
2710
2710
is only present with CUPS installed, and only current from CUPS 1.1.16).
2711
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2647706"></a>The page_log File Syntax</h3></div></div></div><p>
2712
 
<a class="indexterm" name="id2647714"></a>
 
2711
</p></div><div class="sect2" title="The page_log File Syntax"><div class="titlepage"><div><div><h3 class="title"><a name="id2653798"></a>The page_log File Syntax</h3></div></div></div><p>
 
2712
<a class="indexterm" name="id2653806"></a>
2713
2713
These are the items CUPS logs in the <code class="filename">page_log</code> for every page of a job:
2714
 
</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>Page number</p></li><li><p>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>
 
2714
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Printer name</p></li><li class="listitem"><p>User name</p></li><li class="listitem"><p>Job ID</p></li><li class="listitem"><p>Time of printing</p></li><li class="listitem"><p>Page number</p></li><li class="listitem"><p>Number of copies</p></li><li class="listitem"><p>A billing information string (optional)</p></li><li class="listitem"><p>The host that sent the job (included since version 1.1.19)</p></li></ul></div><p>
2715
2715
Here is an extract of my CUPS server's <code class="filename">page_log</code> file to illustrate the
2716
2716
format and included items:
2717
2717
</p><pre class="screen">
2727
2727
 The next job had ID <em class="parameter"><code>402</code></em>, was sent by user <em class="parameter"><code>boss</code></em>
2728
2728
from IP address <code class="constant">10.160.51.33</code>, printed from one page 440 copies, and
2729
2729
is set to be billed to <em class="parameter"><code>finance-dep</code></em>.
2730
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2647851"></a>Possible Shortcomings</h3></div></div></div><p>
 
2730
</p></div><div class="sect2" title="Possible Shortcomings"><div class="titlepage"><div><div><h3 class="title"><a name="id2653943"></a>Possible Shortcomings</h3></div></div></div><p>
2731
2731
What flaws or shortcomings are there with this quota system?
2732
 
</p><div class="itemizedlist"><ul type="disc"><li><p>The ones named above (wrongly logged job in case of
2733
 
        printer hardware failure, and so on).</p></li><li><p>In reality, CUPS counts the job pages that are being
 
2732
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>The ones named above (wrongly logged job in case of
 
2733
        printer hardware failure, and so on).</p></li><li class="listitem"><p>In reality, CUPS counts the job pages that are being
2734
2734
        processed in <span class="emphasis"><em>software</em></span> (that is, going through the
2735
2735
        RIP) rather than the physical sheets successfully leaving the
2736
2736
        printing device. Thus, if there is a jam while printing the fifth sheet out
2737
2737
        of 1,000 and the job is aborted by the printer, the page count will
2738
 
        still show the figure of 1,000 for that job.</p></li><li><p>All quotas are the same for all users (no flexibility
 
2738
        still show the figure of 1,000 for that job.</p></li><li class="listitem"><p>All quotas are the same for all users (no flexibility
2739
2739
        to give the boss a higher quota than the clerk) and no support for
2740
 
        groups.</p></li><li><p>No means to read out the current balance or the
2741
 
        &#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
2742
 
        still be able to send and print a 1,000 sheet job.</p></li><li><p>A user being denied a job because of a filled-up quota
 
2740
        groups.</p></li><li class="listitem"><p>No means to read out the current balance or the
 
2741
        <span class="quote">&#8220;<span class="quote">used-up</span>&#8221;</span> number of current quota.</p></li><li class="listitem"><p>A user having used up 99 sheets of a 100 quota will
 
2742
        still be able to send and print a 1,000 sheet job.</p></li><li class="listitem"><p>A user being denied a job because of a filled-up quota
2743
2743
        does not get a meaningful error message from CUPS other than
2744
 
        &#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="id2647917"></a>Future Developments</h3></div></div></div><p>
 
2744
        <span class="quote">&#8220;<span class="quote">client-error-not-possible</span>&#8221;</span>.</p></li></ul></div></div><div class="sect2" title="Future Developments"><div class="titlepage"><div><div><h3 class="title"><a name="id2654009"></a>Future Developments</h3></div></div></div><p>
2745
2745
This is the best system currently available, and there are huge
2746
2746
improvements under development for CUPS 1.2:
2747
 
</p><div class="itemizedlist"><ul type="disc"><li><p>Page counting will go into the backends (these talk
 
2747
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Page counting will go into the backends (these talk
2748
2748
        directly to the printer and will increase the count in sync with the
2749
2749
        actual printing process; thus, a jam at the fifth sheet will lead to a
2750
 
        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
2751
 
        about their accounts in advance.</p></li><li><p>Probably there will be support for some other tools
2752
 
        around this topic.</p></li></ul></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2647957"></a>Other Accounting Tools</h3></div></div></div><p>
 
2750
        stop in the counting).</p></li><li class="listitem"><p>Quotas will be handled more flexibly.</p></li><li class="listitem"><p>Probably there will be support for users to inquire
 
2751
        about their accounts in advance.</p></li><li class="listitem"><p>Probably there will be support for some other tools
 
2752
        around this topic.</p></li></ul></div></div><div class="sect2" title="Other Accounting Tools"><div class="titlepage"><div><div><h3 class="title"><a name="id2654049"></a>Other Accounting Tools</h3></div></div></div><p>
2753
2753
Other accounting tools that can be used includes: PrintAnalyzer, pyKota, printbill, LogReport.
2754
2754
For more information regarding these tools you can try a Google search.
2755
 
</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2647971"></a>Additional Material</h2></div></div></div><p>
 
2755
</p></div></div><div class="sect1" title="Additional Material"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2654063"></a>Additional Material</h2></div></div></div><p>
2756
2756
A printer queue with <span class="emphasis"><em>no</em></span> PPD associated to it is a
2757
 
&#8220;<span class="quote">raw</span>&#8221; printer, and all files will go directly there as received by the
 
2757
<span class="quote">&#8220;<span class="quote">raw</span>&#8221;</span> printer, and all files will go directly there as received by the
2758
2758
spooler. The exceptions are file types <em class="parameter"><code>application/octet-stream</code></em>
2759
 
that need the pass-through feature enabled. &#8220;<span class="quote">Raw</span>&#8221; queues do not do any
 
2759
that need the pass-through feature enabled. <span class="quote">&#8220;<span class="quote">Raw</span>&#8221;</span> queues do not do any
2760
2760
filtering at all; they hand the file directly to the CUPS backend.
2761
2761
This backend is responsible for sending the data to the device
2762
 
(as in the &#8220;<span class="quote">device URI</span>&#8221; notation: <code class="filename">lpd://, socket://,
 
2762
(as in the <span class="quote">&#8220;<span class="quote">device URI</span>&#8221;</span> notation: <code class="filename">lpd://, socket://,
2763
2763
smb://, ipp://, http://, parallel:/, serial:/, usb:/</code>, and so on).
2764
2764
</p><p>
2765
2765
cupsomatic/Foomatic are <span class="emphasis"><em>not</em></span> native CUPS drivers
2796
2796
 
2797
2797
This would prevent all PostScript files from being filtered (rather,
2798
2798
they will through the virtual <span class="emphasis"><em>nullfilter</em></span>
2799
 
denoted with &#8220;<span class="quote">-</span>&#8221;). This could only be useful for PostScript printers. If you
 
2799
denoted with <span class="quote">&#8220;<span class="quote">-</span>&#8221;</span>). This could only be useful for PostScript printers. If you
2800
2800
want to print PostScript code on non-PostScript printers (provided they support ASCII
2801
2801
text printing), an entry as follows could be useful:
2802
2802
 
2831
2831
allowed to have direct access (such as when the operators often need
2832
2832
to load the proper paper type before running the 10,000 page job
2833
2833
requested by marketing for the mailing, and so on).
2834
 
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2648188"></a>Autodeletion or Preservation of CUPS Spool Files</h2></div></div></div><p>
2835
 
<a class="indexterm" name="id2648196"></a>
2836
 
<a class="indexterm" name="id2648203"></a>
2837
 
<a class="indexterm" name="id2648210"></a>
 
2834
</p></div><div class="sect1" title="Autodeletion or Preservation of CUPS Spool Files"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2654280"></a>Autodeletion or Preservation of CUPS Spool Files</h2></div></div></div><p>
 
2835
<a class="indexterm" name="id2654289"></a>
 
2836
<a class="indexterm" name="id2654296"></a>
 
2837
<a class="indexterm" name="id2654303"></a>
2838
2838
Samba print files pass through two spool directories. One is the incoming directory managed by Samba (set in
2839
2839
the <a class="link" href="smb.conf.5.html#PATH" target="_top">path = /var/spool/samba</a> directive in the <em class="parameter"><code>[printers]</code></em> section of <code class="filename">smb.conf</code>). The other is the spool directory of your UNIX print subsystem. For
2840
2840
CUPS it is normally <code class="filename">/var/spool/cups/</code>, as set by the <code class="filename">cupsd.conf</code>
2841
2841
directive <code class="filename">RequestRoot /var/spool/cups</code>.
2842
 
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2648264"></a>CUPS Configuration Settings Explained</h3></div></div></div><p>
 
2842
</p><div class="sect2" title="CUPS Configuration Settings Explained"><div class="titlepage"><div><div><h3 class="title"><a name="id2654356"></a>CUPS Configuration Settings Explained</h3></div></div></div><p>
2843
2843
Some important parameter settings in the CUPS configuration file
2844
2844
<code class="filename">cupsd.conf</code> are:
2845
2845
</p><div class="variablelist"><dl><dt><span class="term">PreserveJobHistory Yes</span></dt><dd><p>
2846
2846
        This keeps some details of jobs in cupsd's mind (well, it keeps the
2847
2847
        c12345, c12346, and so on, files in the CUPS spool directory, which does a
2848
2848
        similar job as the old-fashioned BSD-LPD control files). This is set
2849
 
        to &#8220;<span class="quote">Yes</span>&#8221; as a default.
 
2849
        to <span class="quote">&#8220;<span class="quote">Yes</span>&#8221;</span> as a default.
2850
2850
        </p></dd><dt><span class="term">PreserveJobFiles Yes</span></dt><dd><p>
2851
2851
        This keeps the job files themselves in cupsd's mind
2852
2852
        (it keeps the d12345, d12346, etc., files in the CUPS spool
2853
 
        directory). This is set to &#8220;<span class="quote">No</span>&#8221; as the CUPS
 
2853
        directory). This is set to <span class="quote">&#8220;<span class="quote">No</span>&#8221;</span> as the CUPS
2854
2854
        default.
2855
 
        </p></dd><dt><span class="term">&#8220;<span class="quote">MaxJobs 500</span>&#8221;</span></dt><dd><p>
 
2855
        </p></dd><dt><span class="term"><span class="quote">&#8220;<span class="quote">MaxJobs 500</span>&#8221;</span></span></dt><dd><p>
2856
2856
        This directive controls the maximum number of jobs
2857
2857
        that are kept in memory. Once the number of jobs reaches the limit,
2858
2858
        the oldest completed job is automatically purged from the system to
2863
2863
        </p></dd></dl></div><p>
2864
2864
(There are also additional settings for <em class="parameter"><code>MaxJobsPerUser</code></em> and
2865
2865
<em class="parameter"><code>MaxJobsPerPrinter</code></em>.)
2866
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2648349"></a>Preconditions</h3></div></div></div><p>
 
2866
</p></div><div class="sect2" title="Preconditions"><div class="titlepage"><div><div><h3 class="title"><a name="id2654441"></a>Preconditions</h3></div></div></div><p>
2867
2867
For everything to work as it should, you need to have three things:
2868
 
</p><div class="itemizedlist"><ul type="disc"><li><p>A Samba smbd that is compiled against <code class="filename">libcups</code> (check
2869
 
        on Linux by running <strong class="userinput"><code>ldd `which smbd'</code></strong>).</p></li><li><p>A Samba-<code class="filename">smb.conf</code> setting of
2870
 
                        <a class="link" href="smb.conf.5.html#PRINTING" target="_top">printing = cups</a>.</p></li><li><p>Another Samba <code class="filename">smb.conf</code> setting of
2871
 
                        <a class="link" href="smb.conf.5.html#PRINTCAP" target="_top">printcap = cups</a>.</p></li></ul></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
 
2868
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>A Samba smbd that is compiled against <code class="filename">libcups</code> (check
 
2869
        on Linux by running <strong class="userinput"><code>ldd `which smbd'</code></strong>).</p></li><li class="listitem"><p>A Samba-<code class="filename">smb.conf</code> setting of
 
2870
                        <a class="link" href="smb.conf.5.html#PRINTING" target="_top">printing = cups</a>.</p></li><li class="listitem"><p>Another Samba <code class="filename">smb.conf</code> setting of
 
2871
                        <a class="link" href="smb.conf.5.html#PRINTCAP" target="_top">printcap = cups</a>.</p></li></ul></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
2872
2872
In this case, all other manually set printing-related commands (like
2873
2873
<a class="link" href="smb.conf.5.html#PRINTCOMMAND" target="_top">print command</a>, 
2874
2874
<a class="link" href="smb.conf.5.html#LPQCOMMAND" target="_top">lpq command</a>, 
2876
2876
<a class="link" href="smb.conf.5.html#LPPAUSECOMMAND" target="_top">lppause command</a>, and
2877
2877
<a class="link" href="smb.conf.5.html#LPRESUMECOMMAND" target="_top">lpresume command</a>) are ignored, and they should normally have no
2878
2878
influence whatsoever on your printing.
2879
 
</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2648488"></a>Manual Configuration</h3></div></div></div><p>
 
2879
</p></div></div><div class="sect2" title="Manual Configuration"><div class="titlepage"><div><div><h3 class="title"><a name="id2654580"></a>Manual Configuration</h3></div></div></div><p>
2880
2880
If you want to do things manually, replace the <a class="link" href="smb.conf.5.html#PRINTING" target="_top">printing = cups</a>
2881
2881
by <a class="link" href="smb.conf.5.html#PRINTING" target="_top">printing = bsd</a>. Then your manually set commands may work
2882
2882
(I haven't tested this), and a <a class="link" href="smb.conf.5.html#PRINTCOMMAND" target="_top">print command = lp -d %P %s; rm %s</a>
2883
2883
may do what you need.
2884
 
</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2648535"></a>Printing from CUPS to Windows-Attached Printers</h2></div></div></div><p>
2885
 
<a class="indexterm" name="id2648544"></a>
2886
 
<a class="indexterm" name="id2648550"></a>
 
2884
</p></div></div><div class="sect1" title="Printing from CUPS to Windows-Attached Printers"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2654628"></a>Printing from CUPS to Windows-Attached Printers</h2></div></div></div><p>
 
2885
<a class="indexterm" name="id2654636"></a>
 
2886
<a class="indexterm" name="id2654642"></a>
2887
2887
From time to time the question arises, how can you print <span class="emphasis"><em>to</em></span> a Windows-attached printer
2888
2888
<span class="emphasis"><em>from</em></span> Samba? Normally the local connection from Windows host to printer would be done by
2889
2889
USB or parallel cable, but this does not matter to Samba. From here only an SMB connection needs to be opened
2918
2918
</p><pre class="screen">
2919
2919
<code class="prompt">root# </code><strong class="userinput"><code>ln -s `which smbspool` /usr/lib/cups/backend/smb</code></strong>
2920
2920
</pre><p>
2921
 
<a class="indexterm" name="id2648680"></a>
2922
 
<a class="indexterm" name="id2648687"></a>
 
2921
<a class="indexterm" name="id2654773"></a>
 
2922
<a class="indexterm" name="id2654779"></a>
2923
2923
<code class="literal">smbspool</code> was written by Mike Sweet from the CUPS folks. It is included and ships with
2924
2924
Samba. It may also be used with print subsystems other than CUPS, to spool jobs to Windows printer shares. To
2925
2925
set up printer <em class="replaceable"><code>winprinter</code></em> on CUPS, you need to have a driver for it. Essentially
2934
2934
<code class="prompt">root# </code><strong class="userinput"><code>lpadmin -p winprinter -v smb://WINDOWSNETBIOSNAME/printersharename \
2935
2935
  -P /path/to/PPD</code></strong>
2936
2936
</pre><p>
2937
 
<a class="indexterm" name="id2648747"></a>
2938
 
<a class="indexterm" name="id2648754"></a>
2939
 
<a class="indexterm" name="id2648761"></a>
 
2937
<a class="indexterm" name="id2654840"></a>
 
2938
<a class="indexterm" name="id2654847"></a>
 
2939
<a class="indexterm" name="id2654853"></a>
2940
2940
The PPD must be able to direct CUPS to generate the print data for the target model. For PostScript printers,
2941
2941
just use the PPD that would be used with the Windows NT PostScript driver. But what can you do if the printer
2942
2942
is only accessible with a password? Or if the printer's host is part of another workgroup? This is provided
2943
2943
for: You can include the required parameters as part of the <code class="filename">smb://</code> device-URI like this:
2944
 
</p><div class="itemizedlist"><ul type="disc"><li><p><code class="filename">smb://WORKGROUP/WINDOWSNETBIOSNAME/printersharename</code></p></li><li><p><code class="filename">smb://username:password@WORKGROUP/WINDOWSNETBIOSNAME/printersharename</code></p></li><li><p><code class="filename">smb://username:password@WINDOWSNETBIOSNAME/printersharename</code></p></li></ul></div><p>
 
2944
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><code class="filename">smb://WORKGROUP/WINDOWSNETBIOSNAME/printersharename</code></p></li><li class="listitem"><p><code class="filename">smb://username:password@WORKGROUP/WINDOWSNETBIOSNAME/printersharename</code></p></li><li class="listitem"><p><code class="filename">smb://username:password@WINDOWSNETBIOSNAME/printersharename</code></p></li></ul></div><p>
2945
2945
Note that the device URI will be visible in the process list of the Samba server (e.g., when someone uses the
2946
2946
<code class="literal">ps -aux</code> command on Linux), even if the username and passwords are sanitized before they get
2947
2947
written into the log files. This is an inherently insecure option; however, it is the only one. Don't use it
2949
2949
Printing will only work if you have a working NetBIOS name resolution up and running. Note that this is a
2950
2950
feature of CUPS and you do not necessarily need to have smbd running.
2951
2951
 
2952
 
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2648832"></a>More CUPS Filtering Chains</h2></div></div></div><p>
 
2952
</p></div><div class="sect1" title="More CUPS Filtering Chains"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2654924"></a>More CUPS Filtering Chains</h2></div></div></div><p>
2953
2953
The diagrams in <a class="link" href="CUPS-printing.html#cups1" title="Figure�22.17.�Filtering Chain 1.">Filtering Chain 1</a> and <a class="link" href="CUPS-printing.html#cups2" title="Figure�22.18.�Filtering Chain with cupsomatic">Filtering Chain with
2954
2954
cupsomatic</a> show how CUPS handles print jobs.
2955
 
</p><div class="figure"><a name="cups1"></a><p class="title"><b>Figure�22.17.�Filtering Chain 1.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/cups1.png" alt="Filtering Chain 1."></div></div></div><br class="figure-break"><div class="figure"><a name="cups2"></a><p class="title"><b>Figure�22.18.�Filtering Chain with cupsomatic</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/cups2.png" width="243" alt="Filtering Chain with cupsomatic"></div></div></div><br class="figure-break"></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2648943"></a>Common Errors</h2></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2648949"></a>Windows 9x/Me Client Can't Install Driver</h3></div></div></div><p>For Windows 9x/Me, clients require the printer names to be eight
2956
 
        characters (or &#8220;<span class="quote">8 plus 3 chars suffix</span>&#8221;) max; otherwise, the driver files
2957
 
        will not get transferred when you want to download them from Samba.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="root-ask-loop"></a>&#8220;<span class="quote">cupsaddsmb</span>&#8221; Keeps Asking for Root Password in Never-ending Loop</h3></div></div></div><p>Have you set <a class="link" href="smb.conf.5.html#SECURITY" target="_top">security = user</a>? Have
 
2955
</p><div class="figure"><a name="cups1"></a><p class="title"><b>Figure�22.17.�Filtering Chain 1.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/cups1.png" alt="Filtering Chain 1."></div></div></div><br class="figure-break"><div class="figure"><a name="cups2"></a><p class="title"><b>Figure�22.18.�Filtering Chain with cupsomatic</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/cups2.png" width="243" alt="Filtering Chain with cupsomatic"></div></div></div><br class="figure-break"></div><div class="sect1" title="Common Errors"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2655035"></a>Common Errors</h2></div></div></div><div class="sect2" title="Windows 9x/Me Client Can't Install Driver"><div class="titlepage"><div><div><h3 class="title"><a name="id2655041"></a>Windows 9x/Me Client Can't Install Driver</h3></div></div></div><p>For Windows 9x/Me, clients require the printer names to be eight
 
2956
        characters (or <span class="quote">&#8220;<span class="quote">8 plus 3 chars suffix</span>&#8221;</span>) max; otherwise, the driver files
 
2957
        will not get transferred when you want to download them from Samba.</p></div><div class="sect2" title="&#8220;cupsaddsmb&#8221; Keeps Asking for Root Password in Never-ending Loop"><div class="titlepage"><div><div><h3 class="title"><a name="root-ask-loop"></a><span class="quote">&#8220;<span class="quote">cupsaddsmb</span>&#8221;</span> Keeps Asking for Root Password in Never-ending Loop</h3></div></div></div><p>Have you set <a class="link" href="smb.conf.5.html#SECURITY" target="_top">security = user</a>? Have
2958
2958
        you used <code class="literal">smbpasswd</code> to give root a Samba account?
2959
2959
        You can do two things: open another terminal and execute
2960
2960
        <code class="literal">smbpasswd -a root</code> to create the account and
2961
2961
        continue entering the password into the first terminal. Or, break
2962
2962
        out of the loop by pressing Enter twice (without trying to type a
2963
2963
        password).</p><p>
2964
 
        If the error is &#8220;<span class="quote">Tree connect failed: NT_STATUS_BAD_NETWORK_NAME</span>&#8221;, 
 
2964
        If the error is <span class="quote">&#8220;<span class="quote">Tree connect failed: NT_STATUS_BAD_NETWORK_NAME</span>&#8221;</span>, 
2965
2965
        you may have forgotten to create the <code class="filename">/etc/samba/drivers</code> directory.
2966
 
        </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2649025"></a>&#8220;<span class="quote">cupsaddsmb</span>&#8221; or &#8220;<span class="quote">rpcclient addriver</span>&#8221; Emit Error</h3></div></div></div><p>
 
2966
        </p></div><div class="sect2" title="&#8220;cupsaddsmb&#8221; or &#8220;rpcclient addriver&#8221; Emit Error"><div class="titlepage"><div><div><h3 class="title"><a name="id2655118"></a><span class="quote">&#8220;<span class="quote">cupsaddsmb</span>&#8221;</span> or <span class="quote">&#8220;<span class="quote">rpcclient addriver</span>&#8221;</span> Emit Error</h3></div></div></div><p>
2967
2967
        If <code class="literal">cupsaddsmb</code>, or <code class="literal">rpcclient addriver</code> emit the error message
2968
 
        WERR_BAD_PASSWORD, refer to <a class="link" href="CUPS-printing.html#root-ask-loop" title="cupsaddsmb Keeps Asking for Root Password in Never-ending Loop">the previous common error</a>.
2969
 
        </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2649063"></a>&#8220;<span class="quote">cupsaddsmb</span>&#8221; Errors</h3></div></div></div><p>
2970
 
        The use of &#8220;<span class="quote">cupsaddsmb</span>&#8221; gives &#8220;<span class="quote">No PPD file for printer...</span>&#8221; 
 
2968
        WERR_BAD_PASSWORD, refer to <a class="link" href="CUPS-printing.html#root-ask-loop" title="&#8220;cupsaddsmb&#8221; Keeps Asking for Root Password in Never-ending Loop">the previous common error</a>.
 
2969
        </p></div><div class="sect2" title="&#8220;cupsaddsmb&#8221; Errors"><div class="titlepage"><div><div><h3 class="title"><a name="id2655156"></a><span class="quote">&#8220;<span class="quote">cupsaddsmb</span>&#8221;</span> Errors</h3></div></div></div><p>
 
2970
        The use of <span class="quote">&#8220;<span class="quote">cupsaddsmb</span>&#8221;</span> gives <span class="quote">&#8220;<span class="quote">No PPD file for printer...</span>&#8221;</span> 
2971
2971
        message while PPD file is present.  What might the problem be?
2972
2972
        </p><p>
2973
2973
        Have you enabled printer sharing on CUPS? This means, do you have a <code class="literal">&lt;Location
2974
2974
        /printers&gt;....&lt;/Location&gt;</code> section in CUPS server's <code class="filename">cupsd.conf</code> that
2975
 
        does not deny access to the host you run &#8220;<span class="quote">cupsaddsmb</span>&#8221; from?  It <span class="emphasis"><em>could</em></span> be an
 
2975
        does not deny access to the host you run <span class="quote">&#8220;<span class="quote">cupsaddsmb</span>&#8221;</span> from?  It <span class="emphasis"><em>could</em></span> be an
2976
2976
        issue if you use cupsaddsmb remotely, or if you use it with a <code class="option">-h</code> parameter:
2977
2977
        <strong class="userinput"><code>cupsaddsmb -H sambaserver -h cupsserver -v printername</code></strong>.
2978
2978
        </p><p>Is your <em class="parameter"><code>TempDir</code></em> directive in
2979
2979
        <code class="filename">cupsd.conf</code> set to a valid value, and is it writable?
2980
 
        </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2649137"></a>Client Can't Connect to Samba Printer</h3></div></div></div><p>Use <code class="literal">smbstatus</code> to check which user
 
2980
        </p></div><div class="sect2" title="Client Can't Connect to Samba Printer"><div class="titlepage"><div><div><h3 class="title"><a name="id2655230"></a>Client Can't Connect to Samba Printer</h3></div></div></div><p>Use <code class="literal">smbstatus</code> to check which user
2981
2981
        you are from Samba's point of view. Do you have the privileges to
2982
2982
        write into the <em class="parameter"><code>[print$]</code></em>
2983
 
        share?</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2649162"></a>New Account Reconnection from Windows 200x/XP Troubles</h3></div></div></div><p>
 
2983
        share?</p></div><div class="sect2" title="New Account Reconnection from Windows 200x/XP Troubles"><div class="titlepage"><div><div><h3 class="title"><a name="id2655254"></a>New Account Reconnection from Windows 200x/XP Troubles</h3></div></div></div><p>
2984
2984
Once you are connected as the wrong user (for example, as <code class="constant">nobody</code>, which often occurs if
2985
2985
you have <a class="link" href="smb.conf.5.html#MAPTOGUEST" target="_top">map to guest = bad user</a>), Windows Explorer will not accept an
2986
2986
attempt to connect again as a different user. There will not be any bytes transferred on the wire to Samba,
2988
2988
<code class="literal">smbstatus</code> to check for active connections. Kill the PIDs. You still can't re-connect, and
2989
2989
you get the dreaded <code class="computeroutput">You can't connect with a second account from the same
2990
2990
machine</code> message as soon as you try. And you do not see a single byte arriving at Samba (see
2991
 
logs; use &#8220;<span class="quote">ethereal</span>&#8221;) indicating a renewed connection attempt. Shut all Explorer Windows.  This
 
2991
logs; use <span class="quote">&#8220;<span class="quote">ethereal</span>&#8221;</span>) indicating a renewed connection attempt. Shut all Explorer Windows.  This
2992
2992
makes Windows forget what it has cached in its memory as established connections. Then reconnect as the right
2993
2993
user. The best method is to use a DOS terminal window and <span class="emphasis"><em>first</em></span> do <strong class="userinput"><code>net use z:
2994
2994
\\GANDALF\print$ /user:root</code></strong>. Check with <code class="literal">smbstatus</code> that you are
2995
2995
connected under a different account. Now open the <span class="guilabel">Printers</span> folder (on the Samba server in
2996
2996
the <span class="guilabel">Network Neighborhood</span>), right-click on the printer in question, and select
2997
2997
<span class="guibutton">Connect....</span>.
2998
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2649253"></a>Avoid Being Connected to the Samba Server as the Wrong User</h3></div></div></div><p>
2999
 
<a class="indexterm" name="id2649262"></a>
 
2998
</p></div><div class="sect2" title="Avoid Being Connected to the Samba Server as the Wrong User"><div class="titlepage"><div><div><h3 class="title"><a name="id2655345"></a>Avoid Being Connected to the Samba Server as the Wrong User</h3></div></div></div><p>
 
2999
<a class="indexterm" name="id2655354"></a>
3000
3000
You see per <code class="literal">smbstatus</code> that you are connected as user nobody, but you want to be root or
3001
3001
printer admin. This is probably due to <a class="link" href="smb.conf.5.html#MAPTOGUEST" target="_top">map to guest = bad user</a>, which
3002
3002
silently connected you under the guest account when you gave (maybe by accident) an incorrect username. Remove
3003
3003
<a class="link" href="smb.conf.5.html#MAPTOGUEST" target="_top">map to guest</a> if you want to prevent this.
3004
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2649304"></a>Upgrading to CUPS Drivers from Adobe Drivers</h3></div></div></div><p>
 
3004
</p></div><div class="sect2" title="Upgrading to CUPS Drivers from Adobe Drivers"><div class="titlepage"><div><div><h3 class="title"><a name="id2655397"></a>Upgrading to CUPS Drivers from Adobe Drivers</h3></div></div></div><p>
3005
3005
This information came from a mailing list posting regarding problems experienced when
3006
3006
upgrading from Adobe drivers to CUPS drivers on Microsoft Windows NT/200x/XP clients.
3007
3007
</p><p>First delete all old Adobe-using printers. Then delete all old Adobe drivers. (On Windows 200x/XP, right-click in
3008
3008
the background of <span class="guilabel">Printers</span> folder, select <span class="guimenuitem">Server Properties...</span>, select
3009
 
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="id2649342"></a>Can't Use &#8220;<span class="quote">cupsaddsmb</span>&#8221; on Samba Server, Which Is a PDC</h3></div></div></div><p>Do you use the &#8220;<span class="quote">naked</span>&#8221; root user name? Try to do it
 
3009
tab <span class="guilabel">Drivers</span>, and delete here).</p></div><div class="sect2" title="Can't Use &#8220;cupsaddsmb&#8221; on Samba Server, Which Is a PDC"><div class="titlepage"><div><div><h3 class="title"><a name="id2655434"></a>Can't Use <span class="quote">&#8220;<span class="quote">cupsaddsmb</span>&#8221;</span> on Samba Server, Which Is a PDC</h3></div></div></div><p>Do you use the <span class="quote">&#8220;<span class="quote">naked</span>&#8221;</span> root user name? Try to do it
3010
3010
this way: <strong class="userinput"><code>cupsaddsmb -U <em class="replaceable"><code>DOMAINNAME</code></em>\\root -v
3011
3011
<em class="replaceable"><code>printername</code></em></code></strong>&gt; (note the two backslashes: the first one is
3012
 
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="id2649378"></a>Deleted Windows 200x Printer Driver Is Still Shown</h3></div></div></div><p>Deleting a printer on the client will not delete the
 
3012
required to <span class="quote">&#8220;<span class="quote">escape</span>&#8221;</span> the second one).</p></div><div class="sect2" title="Deleted Windows 200x Printer Driver Is Still Shown"><div class="titlepage"><div><div><h3 class="title"><a name="id2655470"></a>Deleted Windows 200x Printer Driver Is Still Shown</h3></div></div></div><p>Deleting a printer on the client will not delete the
3013
3013
driver too (to verify, right-click on the white background of the
3014
3014
<span class="guilabel">Printers</span> folder, select <span class="guimenuitem">Server Properties</span> and click on the
3015
3015
<span class="guilabel">Drivers</span> tab). These same old drivers will be re-used when you try to
3016
3016
install a printer with the same name. If you want to update to a new
3017
3017
driver, delete the old ones first. Deletion is only possible if no
3018
 
other printer uses the same driver.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2649412"></a>Windows 200x/XP Local Security Policies</h3></div></div></div><a class="indexterm" name="id2649418"></a><a class="indexterm" name="id2649426"></a><p>Local security policies may not allow the installation of unsigned drivers  &#8220;<span class="quote">local
3019
 
security policies</span>&#8221; may not allow the installation of printer drivers at all.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2649445"></a>Administrator Cannot Install Printers for All Local Users</h3></div></div></div><p>
3020
 
<a class="indexterm" name="id2649454"></a>
3021
 
<a class="indexterm" name="id2649461"></a>
3022
 
Windows XP handles SMB printers on a &#8220;<span class="quote">per-user</span>&#8221; basis.
 
3018
other printer uses the same driver.</p></div><div class="sect2" title="Windows 200x/XP Local Security Policies"><div class="titlepage"><div><div><h3 class="title"><a name="id2655505"></a>Windows 200x/XP Local Security Policies</h3></div></div></div><a class="indexterm" name="id2655511"></a><a class="indexterm" name="id2655518"></a><p>Local security policies may not allow the installation of unsigned drivers  <span class="quote">&#8220;<span class="quote">local
 
3019
security policies</span>&#8221;</span> may not allow the installation of printer drivers at all.</p></div><div class="sect2" title="Administrator Cannot Install Printers for All Local Users"><div class="titlepage"><div><div><h3 class="title"><a name="id2655538"></a>Administrator Cannot Install Printers for All Local Users</h3></div></div></div><p>
 
3020
<a class="indexterm" name="id2655546"></a>
 
3021
<a class="indexterm" name="id2655553"></a>
 
3022
Windows XP handles SMB printers on a <span class="quote">&#8220;<span class="quote">per-user</span>&#8221;</span> basis.
3023
3023
This means every user needs to install the printer himself or herself. To have a printer available for
3024
3024
everybody, you might want to use the built-in IPP client capabilities of Win XP. Add a printer with the print
3025
3025
path of <em class="parameter"><code>http://cupsserver:631/printers/printername</code></em>.  We're still looking into this one.
3026
3026
Maybe a logon script could automatically install printers for all users.
3027
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2649486"></a>Print Change, Notify Functions on NT Clients</h3></div></div></div><p>For print change, notify functions on NT++ clients.  These need to run the <code class="literal">Server</code>
3028
 
service first (renamed to <code class="literal">File &amp; Print Sharing for MS Networks</code> in XP).</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2649512"></a>Windows XP SP1</h3></div></div></div><p>Windows XP SP1 introduced a Point and Print Restriction Policy (this restriction does not apply to
3029
 
&#8220;<span class="quote">Administrator</span>&#8221; or &#8220;<span class="quote">Power User</span>&#8221; groups of users). In Group Policy Object Editor, go
 
3027
</p></div><div class="sect2" title="Print Change, Notify Functions on NT Clients"><div class="titlepage"><div><div><h3 class="title"><a name="id2655579"></a>Print Change, Notify Functions on NT Clients</h3></div></div></div><p>For print change, notify functions on NT++ clients.  These need to run the <code class="literal">Server</code>
 
3028
service first (renamed to <code class="literal">File &amp; Print Sharing for MS Networks</code> in XP).</p></div><div class="sect2" title="Windows XP SP1"><div class="titlepage"><div><div><h3 class="title"><a name="id2655604"></a>Windows XP SP1</h3></div></div></div><p>Windows XP SP1 introduced a Point and Print Restriction Policy (this restriction does not apply to
 
3029
<span class="quote">&#8220;<span class="quote">Administrator</span>&#8221;</span> or <span class="quote">&#8220;<span class="quote">Power User</span>&#8221;</span> groups of users). In Group Policy Object Editor, go
3030
3030
to <span class="guimenu">User Configuration -&gt; Administrative Templates -&gt; Control Panel -&gt; Printers</span>. The policy
3031
3031
is automatically set to <code class="constant">Enabled</code> and the <code class="constant">Users can only Point and Print to
3032
3032
machines in their Forest</code> . You probably need to change it to <code class="constant">Disabled</code> or
3033
3033
<code class="constant">Users can only Point and Print to these servers</code> to make driver downloads from Samba
3034
3034
possible.
3035
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2649558"></a>Print Options for All Users Can't Be Set on Windows 200x/XP</h3></div></div></div><p>How are you doing it? I bet the wrong way (it is not easy to find out, though). There are three
 
3035
</p></div><div class="sect2" title="Print Options for All Users Can't Be Set on Windows 200x/XP"><div class="titlepage"><div><div><h3 class="title"><a name="id2655651"></a>Print Options for All Users Can't Be Set on Windows 200x/XP</h3></div></div></div><p>How are you doing it? I bet the wrong way (it is not easy to find out, though). There are three
3036
3036
different ways to bring you to a dialog that <span class="emphasis"><em>seems</em></span> to set everything. All three dialogs
3037
3037
<span class="emphasis"><em>look</em></span> the same, yet only one of them does what you intend. You need to be Administrator or
3038
3038
Print Administrator to do this for all users. Here is how I do it on XP:
3039
 
</p><div class="orderedlist"><ol type="A"><li><p>The first wrong way:
 
3039
</p><div class="orderedlist"><ol class="orderedlist" type="A"><li class="listitem"><p>The first wrong way:
3040
3040
 
3041
 
                </p><div class="orderedlist"><ol type="I"><li><p>Open the <span class="guilabel">Printers</span>
3042
 
                folder.</p></li><li><p>Right-click on the printer
 
3041
                </p><div class="orderedlist"><ol class="orderedlist" type="I"><li class="listitem"><p>Open the <span class="guilabel">Printers</span>
 
3042
                folder.</p></li><li class="listitem"><p>Right-click on the printer
3043
3043
                (<span class="guilabel">remoteprinter on cupshost</span>) and
3044
3044
                select in context menu <span class="guimenuitem">Printing
3045
 
                Preferences...</span></p></li><li><p>Look at this dialog closely and remember what it looks like.</p></li></ol></div><p>
3046
 
        </p></li><li><p>The second wrong way:
3047
 
        </p><div class="orderedlist"><ol type="I"><li><p>Open the <span class="guilabel">Printers</span> folder.</p></li><li><p>Right-click on the printer (<span class="guilabel">remoteprinter on
 
3045
                Preferences...</span></p></li><li class="listitem"><p>Look at this dialog closely and remember what it looks like.</p></li></ol></div><p>
 
3046
        </p></li><li class="listitem"><p>The second wrong way:
 
3047
        </p><div class="orderedlist"><ol class="orderedlist" type="I"><li class="listitem"><p>Open the <span class="guilabel">Printers</span> folder.</p></li><li class="listitem"><p>Right-click on the printer (<span class="guilabel">remoteprinter on
3048
3048
                cupshost</span>) and select the context menu
3049
 
                <span class="guimenuitem">Properties</span>.</p></li><li><p>Click on the <span class="guilabel">General</span> tab.</p></li><li><p>Click on the button <span class="guibutton">Printing
3050
 
                Preferences...</span></p></li><li><p>A new dialog opens. Keep this dialog open and go back
 
3049
                <span class="guimenuitem">Properties</span>.</p></li><li class="listitem"><p>Click on the <span class="guilabel">General</span> tab.</p></li><li class="listitem"><p>Click on the button <span class="guibutton">Printing
 
3050
                Preferences...</span></p></li><li class="listitem"><p>A new dialog opens. Keep this dialog open and go back
3051
3051
                to the parent dialog.</p></li></ol></div><p>
3052
 
        </p></li><li><p>The third and correct way: 
3053
 
        </p><div class="orderedlist"><ol type="I"><li><p>Open the <span class="guilabel">Printers</span> folder.</p></li><li><p>Right-click on the printer (<span class="guilabel">remoteprinter on
 
3052
        </p></li><li class="listitem"><p>The third and correct way: 
 
3053
        </p><div class="orderedlist"><ol class="orderedlist" type="I"><li class="listitem"><p>Open the <span class="guilabel">Printers</span> folder.</p></li><li class="listitem"><p>Right-click on the printer (<span class="guilabel">remoteprinter on
3054
3054
                cupshost</span>) and select the context menu
3055
 
                <span class="guimenuitem">Properties</span>.</p></li><li><p>Click on the <span class="guilabel">Advanced</span>
3056
 
                tab. (If everything is &#8220;<span class="quote">grayed out,</span>&#8221; then you are not logged
3057
 
                in as a user with enough privileges).</p></li><li><p>Click on the <span class="guibutton">Printing
3058
 
                Defaults...</span> button.</p></li><li><p>On any of the two new tabs, click on the
3059
 
                <span class="guibutton">Advanced...</span> button.</p></li><li><p>A new dialog opens. Compare this one to the other
3060
 
                identical-looking one from step &#8220;<span class="quote">B.5</span>&#8221; or A.3".</p></li></ol></div><p>
 
3055
                <span class="guimenuitem">Properties</span>.</p></li><li class="listitem"><p>Click on the <span class="guilabel">Advanced</span>
 
3056
                tab. (If everything is <span class="quote">&#8220;<span class="quote">grayed out,</span>&#8221;</span> then you are not logged
 
3057
                in as a user with enough privileges).</p></li><li class="listitem"><p>Click on the <span class="guibutton">Printing
 
3058
                Defaults...</span> button.</p></li><li class="listitem"><p>On any of the two new tabs, click on the
 
3059
                <span class="guibutton">Advanced...</span> button.</p></li><li class="listitem"><p>A new dialog opens. Compare this one to the other
 
3060
                identical-looking one from step <span class="quote">&#8220;<span class="quote">B.5</span>&#8221;</span> or A.3".</p></li></ol></div><p>
3061
3061
        </p></li></ol></div><p>
3062
3062
Do you see any difference? I don't either. However, only the last one, which you arrived at with steps
3063
 
&#8220;<span class="quote">C.1. to C.6.</span>&#8221;, will save any settings permanently and be the defaults for new users. If you want
 
3063
<span class="quote">&#8220;<span class="quote">C.1. to C.6.</span>&#8221;</span>, will save any settings permanently and be the defaults for new users. If you want
3064
3064
all clients to get the same defaults, you need to conduct these steps <span class="emphasis"><em>as Administrator</em></span>
3065
3065
(<a class="link" href="smb.conf.5.html#PRINTERADMIN" target="_top">printer admin</a> in <code class="filename">smb.conf</code>) <span class="emphasis"><em>before</em></span> a client downloads the
3066
3066
driver (the clients can later set their own <span class="emphasis"><em>per-user defaults</em></span> by following the procedures
3067
3067
<span class="emphasis"><em>A</em></span> or <span class="emphasis"><em>B</em></span>).
3068
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2649842"></a>Most Common Blunders in Driver Settings on Windows Clients</h3></div></div></div><p>
 
3068
</p></div><div class="sect2" title="Most Common Blunders in Driver Settings on Windows Clients"><div class="titlepage"><div><div><h3 class="title"><a name="id2655934"></a>Most Common Blunders in Driver Settings on Windows Clients</h3></div></div></div><p>
3069
3069
Don't use <em class="parameter"><code>Optimize for Speed</code></em>, but use <em class="parameter"><code>Optimize for Portability</code></em>
3070
3070
instead (Adobe PS Driver). Don't use <em class="parameter"><code>Page Independence: No</code></em>. Always settle with
3071
3071
<em class="parameter"><code>Page Independence: Yes</code></em> (Microsoft PS Driver and CUPS PS Driver for Windows NT/200x/XP).
3072
3072
If there are problems with fonts, use <em class="parameter"><code>Download as Softfont into printer</code></em> (Adobe PS
3073
3073
Driver). For <span class="guilabel">TrueType Download Options</span> choose <code class="constant">Outline</code>. Use
3074
3074
PostScript Level 2 if you are having trouble with a non-PS printer and if there is a choice.
3075
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2649897"></a><code class="literal">cupsaddsmb</code> Does Not Work with Newly Installed Printer</h3></div></div></div><p>
 
3075
</p></div><div class="sect2" title="cupsaddsmb Does Not Work with Newly Installed Printer"><div class="titlepage"><div><div><h3 class="title"><a name="id2655990"></a><code class="literal">cupsaddsmb</code> Does Not Work with Newly Installed Printer</h3></div></div></div><p>
3076
3076
Symptom: The last command of <code class="literal">cupsaddsmb</code> does not complete successfully. If the <code class="literal">cmd
3077
3077
= setdriver printername printername</code> result was NT_STATUS_UNSUCCESSFUL, then possibly the printer was
3078
3078
not yet recognized by Samba. Did it show up in Network Neighborhood? Did it show up in <code class="literal">rpcclient
3079
3079
hostname -c `enumprinters'</code>? Restart smbd (or send a <code class="literal">kill -HUP</code> to all processes
3080
3080
listed by <code class="literal">smbstatus</code>, and try again.
3081
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2649947"></a>Permissions on <code class="filename">/var/spool/samba/</code> Get Reset After Each Reboot</h3></div></div></div><p>
 
3081
</p></div><div class="sect2" title="Permissions on /var/spool/samba/ Get Reset After Each Reboot"><div class="titlepage"><div><div><h3 class="title"><a name="id2656039"></a>Permissions on <code class="filename">/var/spool/samba/</code> Get Reset After Each Reboot</h3></div></div></div><p>
3082
3082
Have you ever by accident set the CUPS spool directory to the same location (<em class="parameter"><code>RequestRoot
3083
3083
/var/spool/samba/</code></em> in <code class="filename">cupsd.conf</code> or the other way round:
3084
3084
<code class="filename">/var/spool/cups/</code> is set as <a class="link" href="smb.conf.5.html#PATH" target="_top">path</a>&gt; in the <em class="parameter"><code>[printers]</code></em> section)? These <em class="parameter"><code>must</code></em> be different. Set <em class="parameter"><code>RequestRoot
3085
3085
/var/spool/cups/</code></em> in <code class="filename">cupsd.conf</code> and <a class="link" href="smb.conf.5.html#PATH" target="_top">path = 
3086
3086
/var/spool/samba</a> in the <em class="parameter"><code>[printers]</code></em> section of <code class="filename">smb.conf</code>. Otherwise,
3087
3087
cupsd will sanitize permissions to its spool directory with each restart and printing will not work reliably.
3088
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2650045"></a>Print Queue Called &#8220;<span class="quote">lp</span>&#8221; Mishandles Print Jobs</h3></div></div></div><p>
3089
 
In this case a print queue called &#8220;<span class="quote">lp</span>&#8221; intermittently swallows jobs and
 
3088
</p></div><div class="sect2" title="Print Queue Called &#8220;lp&#8221; Mishandles Print Jobs"><div class="titlepage"><div><div><h3 class="title"><a name="id2656138"></a>Print Queue Called <span class="quote">&#8220;<span class="quote">lp</span>&#8221;</span> Mishandles Print Jobs</h3></div></div></div><p>
 
3089
In this case a print queue called <span class="quote">&#8220;<span class="quote">lp</span>&#8221;</span> intermittently swallows jobs and
3090
3090
spits out completely different ones from what was sent.
3091
3091
</p><p>
3092
 
<a class="indexterm" name="id2650065"></a>
3093
 
<a class="indexterm" name="id2650072"></a>
3094
 
<a class="indexterm" name="id2650079"></a>
3095
 
It is a bad idea to name any printer &#8220;<span class="quote">lp</span>&#8221;. This is the traditional UNIX name for the default
 
3092
<a class="indexterm" name="id2656158"></a>
 
3093
<a class="indexterm" name="id2656164"></a>
 
3094
<a class="indexterm" name="id2656171"></a>
 
3095
It is a bad idea to name any printer <span class="quote">&#8220;<span class="quote">lp</span>&#8221;</span>. This is the traditional UNIX name for the default
3096
3096
printer. CUPS may be set up to do an automatic creation of Implicit Classes. This means, to group all printers
3097
3097
with the same name to a pool of devices and load-balance the jobs across them in a round-robin fashion.
3098
 
Chances are high that someone else has a printer named &#8220;<span class="quote">lp</span>&#8221; too. You may receive that person's
 
3098
Chances are high that someone else has a printer named <span class="quote">&#8220;<span class="quote">lp</span>&#8221;</span> too. You may receive that person's
3099
3099
jobs and send your own to his or her device unwittingly. To have tight control over the printer names, set
3100
3100
<em class="parameter"><code>BrowseShortNames No</code></em>. It will present any printer as
3101
3101
<em class="replaceable"><code>printername@cupshost</code></em>, which gives you better control over what may happen in a
3102
3102
large networked environment.
3103
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2650114"></a>Location of Adobe PostScript Driver Files for &#8220;<span class="quote">cupsaddsmb</span>&#8221;</h3></div></div></div><p>
 
3103
</p></div><div class="sect2" title="Location of Adobe PostScript Driver Files for &#8220;cupsaddsmb&#8221;"><div class="titlepage"><div><div><h3 class="title"><a name="id2656207"></a>Location of Adobe PostScript Driver Files for <span class="quote">&#8220;<span class="quote">cupsaddsmb</span>&#8221;</span></h3></div></div></div><p>
3104
3104
Use <code class="literal">smbclient</code> to connect to any Windows box with a shared PostScript printer:
3105
3105
<code class="literal">smbclient //windowsbox/print\$ -U guest</code>. You can navigate to the
3106
3106
<code class="filename">W32X86/2</code> subdir to <code class="literal">mget ADOBE*</code> and other files or to
3107
3107
<code class="filename">WIN40/0</code> to do the same.  Another option is to download the <code class="filename">*.exe</code>
3108
3108
packaged files from the Adobe Web site.
3109
 
</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2650168"></a>Overview of the CUPS Printing Processes</h2></div></div></div><p>
 
3109
</p></div></div><div class="sect1" title="Overview of the CUPS Printing Processes"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2656260"></a>Overview of the CUPS Printing Processes</h2></div></div></div><p>
3110
3110
A complete overview of the CUPS printing processes can be found in <a class="link" href="CUPS-printing.html#a_small" title="Figure�22.19.�CUPS Printing Overview.">the CUPS
3111
3111
Printing Overview diagram</a>.
3112
 
</p><div class="figure"><a name="a_small"></a><p class="title"><b>Figure�22.19.�CUPS Printing Overview.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/a_small.png" width="243" alt="CUPS Printing Overview."></div></div></div><br class="figure-break"></div><div class="footnotes"><br><hr width="100" align="left"><div class="footnote"><p><sup>[<a name="ftn.id2639412" href="#id2639412" class="para">6</a>] </sup>See also <a class="ulink" href="http://www.cups.org/cups-help.html" target="_top">http://www.cups.org/cups-help.html</a></p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="classicalprinting.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�21.�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�23.�Stackable VFS modules</td></tr></table></div></body></html>
 
3112
</p><div class="figure"><a name="a_small"></a><p class="title"><b>Figure�22.19.�CUPS Printing Overview.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/a_small.png" width="243" alt="CUPS Printing Overview."></div></div></div><br class="figure-break"></div><div class="footnotes"><br><hr width="100" align="left"><div class="footnote"><p><sup>[<a name="ftn.id2645504" href="#id2645504" class="para">6</a>] </sup>See also <a class="ulink" href="http://www.cups.org/cups-help.html" target="_top">http://www.cups.org/cups-help.html</a></p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="classicalprinting.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�21.�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�23.�Stackable VFS modules</td></tr></table></div></body></html>