1 <chapter id="CUPS-printing">
6 <firstname>Kurt</firstname><surname>Pfeifle</surname>
8 <orgname> Danka Deutschland GmbH </orgname>
9 <address><email>kpfeifle@danka.de</email></address>
13 <firstname>Ciprian</firstname><surname>Vizitiu</surname>
15 <address><email>CVizitiu@gbif.org</email></address>
17 <contrib>drawings</contrib>
20 <pubdate> (3 June 2003) </pubdate>
23 <title>CUPS Printing Support in Samba 3.0</title>
27 <title>Introduction</title>
30 <title>Features and Benefits</title>
33 The Common Unix Print System (<ulink
34 url="http://www.cups.org/">CUPS</ulink>) has become very popular. All
35 big Linux distributions now ship it as their default printing
36 system. But to many it is still a very mystical tool. Normally it
37 "just works" (TM). People tend to regard it as a sort of "black box",
38 which they don't want to look into, as long as it works OK. But once
39 there is a little problem, they are in trouble to find out where to
40 start debugging it. Also, even the most recent and otherwise excellent
41 printed Samba documentation has only limited attention paid to CUPS
42 printing, leaving out important pieces or even writing plain wrong
43 things about it. This demands rectification. But before you dive into
44 this chapter, make sure that you don't forget to refer to the
45 "Classical Printing" chapter also. It contains a lot of information
46 that is relevant for CUPS too.
50 CUPS sports quite a few unique and powerful features. While their
51 basic functions may be grasped quite easily, they are also
52 new. Because they are different from other, more traditional printing
53 systems, it is best to try and not apply any prior knowledge about
54 printing upon this new system. Rather try to start understand CUPS
55 from the beginning. This documentation will lead you here to a
56 complete understanding of CUPS, if you study all of the material
57 contained. But lets start with the most basic things first. Maybe this
58 is all you need for now. Then you can skip most of the other
65 <title>Overview</title>
68 CUPS is more than just a print spooling system. It is a complete
69 printer management system that complies with the new IPP
70 (<emphasis>Internet Printing Protocol</emphasis>). IPP is an industry
71 and IETF (<emphasis>Internet Engineering Task Force</emphasis>)
72 standard for network printing. Many of its functions can be managed
73 remotely (or locally) via a web browser (giving you a
74 platform-independent access to the CUPS print server). In addition it
75 has the traditional commandline and several more modern GUI interfaces
76 (GUI interfaces developed by 3rd parties, like KDE's
78 url="http://printing.kde.org/">KDEPrint</ulink>).
82 CUPS allows creation of "raw" printers (ie: NO print file
83 format translation) as well as "smart" printers (i.e. CUPS does
84 file format conversion as required for the printer). In many ways
85 this gives CUPS similar capabilities to the MS Windows print
86 monitoring system. Of course, if you are a CUPS advocate, you would
87 argue that CUPS is better! In any case, let us now move on to
88 explore how one may configure CUPS for interfacing with MS Windows
89 print clients via Samba.
95 <title>Basic Configuration of CUPS support</title>
98 Printing with CUPS in the most basic <filename>smb.conf</filename>
99 setup in Samba 3.0 (as was true for 2.2.x) only needs two
100 settings: <parameter>printing = cups</parameter> and <parameter>printcap
101 = cups</parameter>. CUPS itself doesn't need a printcap file
102 anymore. However, the <filename>cupsd.conf</filename> configuration
103 file knows two related directives: they control if such a file should
104 be automatically created and maintained by CUPS for the convenience of
105 third party applications (example: <parameter>Printcap
106 /etc/printcap</parameter> and <parameter>PrintcapFormat
107 BSD</parameter>). These legacy programs often require the existence of
108 printcap file containing printernames or they will refuse to
109 print. Make sure CUPS is set to generate and maintain a printcap! For
110 details see <command>man cupsd.conf</command> and other CUPS-related
111 documentation, like the wealth of documents on your CUPS server
113 url="http://localhost:631/documentation.html">http://localhost:631/documentation.html</ulink>.
117 <title>Linking of smbd with libcups.so</title>
120 Samba has a very special relationship to CUPS. The reason is: Samba
121 can be compiled with CUPS library support. Most recent installations
122 have this support enabled, and per default CUPS linking is compiled
123 into smbd and other Samba binaries. Of course, you can use CUPS even
124 if Samba is not linked against <filename>libcups.so</filename> -- but
125 there are some differences in required or supported configuration
130 If SAMBA is compiled against libcups, then <parameter>printcap =
131 cups</parameter> uses the CUPS API to list printers, submit jobs,
132 query queues, etc. Otherwise it maps to the System V commands with an
133 additional <command>-oraw</command> option for printing. On a Linux
134 system, you can use the <command>ldd</command> utility to find out
135 details (ldd may not be present on other OS platforms, or its function
136 may be embodied by a different command):
140 transmeta:/home/kurt # ldd `which smbd`
141 libssl.so.0.9.6 => /usr/lib/libssl.so.0.9.6 (0x4002d000)
142 libcrypto.so.0.9.6 => /usr/lib/libcrypto.so.0.9.6 (0x4005a000)
143 libcups.so.2 => /usr/lib/libcups.so.2 (0x40123000)
148 The line <computeroutput>libcups.so.2 => /usr/lib/libcups.so.2
149 (0x40123000)</computeroutput> shows there is CUPS support compiled
150 into this version of Samba. If this is the case, and printing = cups
151 is set, then <emphasis>any otherwise manually set print command in
152 <filename>smb.conf</filename> is ignored</emphasis>. This is an
153 important point to remember!
156 <tip><para> Should you require -- for any reason -- to set your own
157 print commands, you can still do this by setting <parameter>printing =
158 sysv</parameter>. However, you'll loose all the benefits from the
159 close CUPS/Samba integration. You are on your own then to manually
160 configure the rest of the printing system commands (most important:
161 <parameter>print command</parameter>; other commands are
162 <parameter>lppause command, lpresume command, lpq command, lprm
163 command, queuepause command </parameter> and <parameter>queue resume
164 command</parameter>).</para></tip>
168 <title>Simple <filename>smb.conf</filename> Settings for CUPS</title>
171 To summarize, here is the simplest printing-related setup
172 for <filename>smb.conf</filename> to enable basic CUPS support:
183 comment = All Printers
184 path = /var/spool/samba
190 printer admin = root, @ntadmins
195 This is all you need for basic printing setup for CUPS. It will print
196 all Graphic, Text, PDF and PostScript file submitted from Windows
197 clients. However, most of your Windows users would not know how to
198 send these kind of files to print without opening a GUI
199 application. Windows clients tend to have local printer drivers
200 installed. And the GUI application's print buttons start a printer
201 driver. Your users also very rarely send files from the command
202 line. Unlike UNIX clients, they hardly submit graphic, text or PDF
203 formatted files directly to the spooler. They nearly exclusively print
204 from GUI applications, with a "printer driver" hooked in between the
205 applications native format and the print data stream. If the backend
206 printer is not a PostScript device, the print data stream is "binary",
207 sensible only for the target printer. Read on to learn which problem
208 this may cause and how to avoid it.
213 <title>More complex <filename>smb.conf</filename> Settings for
217 Here is a slightly more complex printing-related setup
218 for <filename>smb.conf</filename>. It enables general CUPS printing
219 support for all printers, but defines one printer share which is set
231 comment = All Printers
232 path = /var/spool/samba
237 printer admin = root, @ntadmins
240 comment = A special printer with his own settings
241 path = /var/spool/samba-special
244 print command = echo "NEW: `date`: printfile %f" >> /tmp/smbprn.log ;\
245 echo " `date`: p-%p s-%s f-%f" >> /tmp/smbprn.log ;\
246 echo " `date`: j-%j J-%J z-%z c-%c" >> /tmp/smbprn.log :\
254 hosts allow = turbo_xp, 10.160.50.23, 10.160.51.60
259 This special share is only there for my testing purposes. It doesn't
260 even write the print job to a file. It just logs the job parameters
261 known to Samba into the <filename>/tmp/smbprn.log</filename> file and
262 deletes the jobfile. Moreover, the <parameter>printer
263 admin</parameter> of this share is "kurt" (not the "@ntadmins" group);
264 guest access is not allowed; the share isn't announced in Network
265 Neighbourhood (so you need to know it is there), and it is only
266 allowing access from three hosts. To prevent CUPS kicking in and
267 taking over the print jobs for that share, we need to set
268 <parameter>printing = sysv</parameter> and <parameter>printcap =
275 <title>Advanced Configuration</title>
278 Before we dive into all the configuration options, let's clarify a few
279 points. <emphasis>Network printing needs to be organized and setup
280 correctly</emphasis>. Often this is not done correctly. Legacy systems
281 or small LANs in business environments often lack a clear design and
286 <title>Central spooling vs. "Peer-to-Peer" printing</title>
289 Many small office or home networks, as well as badly organized larger
290 environments, allow each client a direct access to available network
291 printers. Generally, this is a bad idea. It often blocks one client's
292 access to the printer when another client's job is printing. It also
293 might freeze the first client's application while it is waiting to get
294 rid of the job. Also, there are frequent complaints about various jobs
295 being printed with their pages mixed with each other. A better concept
296 is the usage of a "print server": it routes all jobs through one
297 central system, which responds immediately, takes jobs from multiple
298 concurrent clients at the same time and in turn transfers them to the
299 printer(s) in the correct order.
304 <title>CUPS/Samba as a "spooling-only" Print Server; "raw" printing
305 with Vendor Drivers on Windows Clients</title>
308 Most traditionally configured Unix print servers acting on behalf of
309 Samba's Windows clients represented a really simple setup. Their only
310 task was to manage the "raw" spooling of all jobs handed to them by
311 Samba. This approach meant that the Windows clients were expected to
312 prepare the print job file in such a way that it became fit to be fed to
313 the printing device. Here a native (vendor-supplied) Windows printer
314 driver for the target device needed to be installed on each and every
319 Of course you can setup CUPS, Samba and your Windows clients in the
320 same, traditional and simple way. When CUPS printers are configured
321 for RAW print-through mode operation it is the responsibility of the
322 Samba client to fully render the print job (file). The file must be
323 sent in a format that is suitable for direct delivery to the
324 printer. Clients need to run the vendor-provided drivers to do
325 this. In this case CUPS will NOT do any print file format conversion
331 <title>Driver Installation Methods on Windows Clients</title>
334 The printer drivers on the Windows clients may be installed
335 in two functionally different ways:
339 <listitem><para>manually install the drivers locally on each client,
340 one by one; this yields the old <emphasis>LanMan</emphasis> style
341 printing; it uses a <filename>\\sambaserver\printershare</filename>
342 type of connection.</para></listitem>
344 <listitem><para>deposit and prepare the drivers (for later download) on
345 the print server (Samba); this enables the clients to use
346 "Point'n'Print" to get drivers semi-automatically installed the
347 first time they access the printer; with this method NT/2K/XP
348 clients use the <emphasis>SPOOLSS/MS-RPC</emphasis>
349 type printing calls.</para></listitem>
353 The second method is recommended for use over the first.
358 <title>Explicitly enable "raw" printing for
359 <emphasis>application/octet-stream</emphasis>!</title>
362 If you use the first option (drivers are installed on the client
363 side), there is one setting to take care of: CUPS needs to be told
364 that it should allow "raw" printing of deliberate (binary) file
365 formats. The CUPS files that need to be correctly set for RAW mode
366 printers to work are:
370 <listitem><para>/etc/cups/mime.types
373 <listitem><para>/etc/cups/mime.convs</para></listitem>
377 Both contain entries (at the end of the respective files) which must
378 be uncommented to allow RAW mode operation.
379 In<filename>/etc/cups/mime.types</filename> make sure this line is
385 application/octet-stream
390 In <filename>/etc/cups/mime.convs</filename>,
396 application/octet-stream application/vnd.cups-raw 0 -
401 If these two files are not set up correctly for raw Windows client
402 printing, you may encounter the dreaded <computeroutput>Unable to
403 convert file 0</computeroutput> in your CUPS error_log file.
406 <note><para>editing the <filename>mime.convs</filename> and the
407 <filename>mime.types</filename> file does not
408 <emphasis>enforce</emphasis> "raw" printing, it only
409 <emphasis>allows</emphasis> it.
412 <formalpara><title>Background</title>
415 CUPS being a more security-aware printing system than traditional ones
416 does not by default allow a user to send deliberate (possibly binary)
417 data to printing devices. This could be easily abused to launch a
418 "Denial of Service" attack on your printer(s), causing at the least
419 the loss of a lot of paper and ink. "Unknown" data are tagged by CUPS
420 as <emphasis>MIME type: application/octet-stream</emphasis> and not
421 allowed to go to the printer. By default, you can only send other
422 (known) MIME types "raw". Sending data "raw" means that CUPS does not
423 try to convert them and passes them to the printer untouched (see next
424 chapter for even more background explanations).
429 This is all you need to know to get the CUPS/Samba combo printing
430 "raw" files prepared by Windows clients, which have vendor drivers
431 locally installed. If you are not interested in background information about
432 more advanced CUPS/Samba printing, simply skip the remaining sections
438 <title>Three familiar Methods for driver upload plus a new one</title>
441 If you want to use the MS-RPC type printing, you must upload the
442 drivers onto the Samba server first (<parameter>[print$]</parameter>
443 share). For a discussion on how to deposit printer drivers on the
444 Samba host (so that the Windows clients can download and use them via
445 "Point'n'Print") please also refer to the previous chapter of this
446 HOWTO Collection. There you will find a description or reference to
447 three methods of preparing the client drivers on the Samba server:
451 <listitem><para>the GUI, "Add Printer Wizard"
452 <emphasis>upload-from-a-Windows-client</emphasis>
453 method;</para></listitem>
455 <listitem><para>the commandline, "smbclient/rpcclient"
456 <emphasis>upload-from-a-UNIX-workstation</emphasis>
457 method;</para></listitem>
459 <listitem><para>the <emphasis>Imprints</emphasis> Toolset
460 method.</para></listitem>
464 These 3 methods apply to CUPS all the same. A new and more
465 convenient way to load the Windows drivers into Samba is provided
466 provided if you use CUPS:
470 <listitem><para>the <emphasis>cupsaddsmb</emphasis>
471 utility.</para></listitem>
475 cupsaddsmb is discussed in much detail further below. But we will
476 first explore the CUPS filtering system and compare the Windows and
477 UNIX printing architectures.
483 <title>Using CUPS/Samba in an advanced Way -- intelligent printing
484 with PostScript Driver Download</title>
487 Still reading on? Good. Let's go into more detail then. We now know
488 how to set up a "dump" printserver, that is, a server which is spooling
489 printjobs "raw", leaving the print data untouched.
493 Possibly you need to setup CUPS in a more smart way. The reasons could
498 <listitem><para>Maybe your boss wants to get monthly statistics: Which
499 printer did how many pages? What was the average data size of a job?
500 What was the average print run per day? What are the typical hourly
501 peaks in printing? Which departments prints how
502 much?</para></listitem>
504 <listitem><para>Maybe you are asked to setup a print quota system:
505 users should not be able to print more jobs, once they have surpassed
506 a given limit per period?</para></listitem>
508 <listitem><para>Maybe your previous network printing setup is a mess
509 and shall be re-organized from a clean beginning?</para></listitem>
511 <listitem><para>Maybe you have experiencing too many "Blue Screens",
512 originating from poorly debugged printer drivers running in NT "kernel
513 mode"?</para></listitem>
517 These goals cannot be achieved by a raw print server. To build a
518 server meeting these requirements, you'll first need to learn about
519 how CUPS works and how you can enable its features.
523 What follows is the comparison of some fundamental concepts for
524 Windows and Unix printing; then is the time for a description of the
525 CUPS filtering system, how it works and how you can tweak it.
529 <title>GDI on Windows -- PostScript on Unix</title>
532 Network printing is one of the most complicated and error-prone
533 day-to-day tasks any user or an administrator may encounter. This is
534 true for all OS platforms. And there are reasons for this.
538 You can't expect for most file formats to just throw them towards
539 printers and they get printed. There needs to be a file format
540 conversion in between. The problem is: there is no common standard for
541 print file formats across all manufacturers and printer types. While
542 <emphasis>PostScript</emphasis> (trademark held by Adobe), and, to an
543 extent, <emphasis>PCL</emphasis> (trademark held by HP), have developed
544 into semi-official "standards", by being the most widely used PDLs
545 (<emphasis>Page Description Languages</emphasis>), there are still
546 many manufacturers who "roll their own" (their reasons may be
547 unacceptable license fees for using printer-embedded PostScript
553 <title>Windows Drivers, GDI and EMF</title>
556 In Windows OS, the format conversion job is done by the printer
557 drivers. On MS Windows OS platforms all application programmers have
558 at their disposal a built-in API, the GDI (<emphasis>Graphical Device
559 Interface</emphasis>), as part and parcel of the OS itself, to base
560 themselves on. This GDI core is used as one common unified ground, for
561 all Windows programs, to draw pictures, fonts and documents
562 <emphasis>on screen</emphasis> as well as <emphasis>on
563 paper</emphasis> (=print). Therefore printer driver developers can
564 standardize on a well-defined GDI output for their own driver
565 input. Achieving WYSIWYG ("What You See Is What You Get") is
566 relatively easy, because the on-screen graphic primitives, as well as
567 the on-paper drawn objects, come from one common source. This source,
568 the GDI, produces often a file format called EMF (<emphasis>Enhanced
569 MetaFile</emphasis>). The EMF is processed by the printer driver and
570 converted to the printer-specific file format.
574 To the GDI foundation in MS Windows, Apple has chosen to
575 put paper and screen output on a common foundation for their
576 (BSD-Unix-based, did you know??) Mac OS X and Darwin Operating
577 Systems.Their <emphasis>Core Graphic Engine</emphasis> uses a
578 <emphasis>PDF</emphasis> derivate for all display work.
583 <figure><title>Windows Printing to a local Printer</title>
585 <imageobject role="latex"><imagedata fileref="projdoc/imagefiles/1small"/></imageobject>
586 <imageobject><imagedata fileref="projdoc/imagefiles/1small.png"/></imageobject>
593 <title>Unix Printfile Conversion and GUI Basics</title>
596 In Unix and Linux, there is no comparable layer built into the OS
597 kernel(s) or the X (screen display) server. Every application is
598 responsible for itself to create its print output. Fortunately, most
599 use PostScript. That gives at least some common ground. Unfortunately,
600 there are many different levels of quality for this PostScript. And
601 worse: there is a huge difference (and no common root) in the way how
602 the same document is displayed on screen and how it is presented on
603 paper. WYSIWYG is more difficult to achieve. This goes back to the
604 time decades ago, when the predecessors of <emphasis>X.org</emphasis>,
605 designing the UNIX foundations and protocols for Graphical User
606 Interfaces refused to take over responsibility for "paper output"
607 also, as some had demanded at the time, and restricted itself to
608 "on-screen only". (For some years now, the "Xprint" project has been
609 under development, attempting to build printing support into the X
610 framework, including a PostScript and a PCL driver, but it is not yet
611 ready for prime time.) You can see this unfavorable inheritance up to
612 the present day by looking into the various "font" directories on your
613 system; there are separate ones for fonts used for X display and fonts
618 <title>Background</title>
621 The PostScript programming language is an "invention" by Adobe Inc.,
622 but its specifications have been published to the full. Its strength
623 lies in its powerful abilities to describe graphical objects (fonts,
624 shapes, patterns, lines, curves, dots...), their attributes (color,
625 linewidth...) and the way to manipulate (scale, distort, rotate,
626 shift...) them. Because of its open specification, anybody with the
627 skill can start writing his own implementation of a PostScript
628 interpreter and use it to display PostScript files on screen or on
629 paper. Most graphical output devices are based on the concept of
630 "raster images" or "pixels" (one notable exception are pen
631 plotters). Of course, you can look at a PostScript file in its textual
632 form and you will be reading its PostScript code, the language
633 instructions which need to be interpreted by a rasterizer. Rasterizers
634 produce pixel images, which may be displayed on screen by a viewer
635 program or on paper by a printer.
641 <title>PostScript and Ghostscript</title>
644 So, Unix is lacking a common ground for printing on paper and
645 displaying on screen. Despite this unfavorable legacy for Unix, basic
646 printing is fairly easy: if you have PostScript printers at your
647 disposal! The reason is: these devices have a built-in PostScript
648 language "interpreter", also called a <emphasis>Raster Image
649 Processor</emphasis> (RIP), (which makes them more expensive than
650 other types of printers); throw PostScript towards them, and they will
651 spit out your printed pages. Their RIP is doing all the hard work of
652 converting the PostScript drawing commands into a bitmap picture as
653 you see it on paper, in a resolution as done by your printer. This is
654 no different to PostScript printing of a file from a Windows origin.
657 <note><para>Traditional Unix programs and printing systems -- while
658 using PostScript -- are largely not PPD-aware. PPDs are "PostScript
659 Printer Description" files. They enable you to specify and control all
660 options a printer supports: duplexing, stapling, punching... Therefore
661 Unix users for a long time couldn't choose many of the supported
662 device and job options, unlike Windows or Apple users. But now there
668 <figure><title>Printing to a Postscript Printer</title>
670 <imageobject role="latex"><imagedata fileref="projdoc/imagefiles/2small"/></imageobject>
671 <imageobject><imagedata fileref="projdoc/imagefiles/2small.png"/></imageobject>
677 However, there are other types of printers out there. These don't know
678 how to print PostScript. They use their own <emphasis>Page Description
679 Language</emphasis> (PDL, often proprietary). To print to them is much
680 more demanding. Since your Unix applications mostly produce
681 PostScript, and since these devices don't understand PostScript, you
682 need to convert the printfiles to a format suitable for your printer
683 on the host, before you can send it away.
688 <title>Ghostscript -- the Software RIP for non-PostScript Printers</title>
691 Here is where <emphasis>Ghostscript</emphasis> kicks in. Ghostscript is
692 the traditional (and quite powerful) PostScript interpreter used on
693 Unix platforms. It is a RIP in software, capable to do a
694 <emphasis>lot</emphasis> of file format conversions, for a very broad
695 spectrum of hardware devices as well as software file formats.
696 Ghostscript technology and drivers is what enables PostScript printing
697 to non-PostScript hardware.
701 <figure><title>Ghostscript as a RIP for non-postscript printers</title>
703 <imageobject role="latex"><imagedata fileref="projdoc/imagefiles/3small"/></imageobject>
704 <imageobject><imagedata fileref="projdoc/imagefiles/3small.png"/></imageobject>
710 Use the "gs -h" command to check for all built-in "devices" of your
711 Ghostscript version. If you specify e.g. a parameter of
712 <parameter>-sDEVICE=png256</parameter> on your Ghostscript command
713 line, you are asking Ghostscript to convert the input into a PNG
714 file. Naming a "device" on the commandline is the most important
715 single parameter to tell Ghostscript how exactly it should render the
716 input. New Ghostscript versions are released at fairly regular
717 intervals, now by artofcode LLC. They are initially put under the
718 "AFPL" license, but re-released under the GNU GPL as soon as the next
719 AFPL version appears. GNU Ghostscript is probably the version
720 installed on most Samba systems. But it has got some
721 deficiencies. Therefore ESP Ghostscript was developed as an
722 enhancement over GNU Ghostscript, with lots of bug-fixes, additional
723 devices and improvements. It is jointly maintained by developers from
724 CUPS, Gimp-Print, MandrakeSoft, SuSE, RedHat and Debian. It includes
725 the "cups" device (essential to print to non-PS printers from CUPS).
730 <title>PostScript Printer Description (PPD) Specification</title>
733 While PostScript in essence is a <emphasis>Page Description
734 Language</emphasis> (PDL) to represent the page layout in a
735 <emphasis>device independent</emphasis> way, real world print jobs are
736 always ending up to be output on a hardware with device-specific
737 features. To take care of all the differences in hardware, and to
738 allow for innovations, Adobe has specified a syntax and file format
739 for <emphasis>PostScript Printer Description</emphasis> (PPD)
740 files. Every PostScript printer ships with one of these files.
744 PPDs contain all information about general and special features of the
745 given printer model: Which different resolutions can it handle? Does
746 it have a Duplexing Unit? How many paper trays are there? What media
747 types and sizes does it take? For each item it also names the special
748 command string to be sent to the printer (mostly inside the PostScript
749 file) in order to enable it.
753 Information from these PPDs is meant to be taken into account by the
754 printer drivers. Therefore, installed as part of the Windows
755 PostScript driver for a given printer is the printer's PPD. Where it
756 makes sense, the PPD features are presented in the drivers' UI dialogs
757 to display to the user as choice of print options. In the end, the
758 user selections are somehow written (in the form of special
759 PostScript, PJL, JCL or vendor-dependent commands) into the PostScript
760 file created by the driver.
764 A PostScript file that was created to contain device-specific commands
765 for achieving a certain print job output (e.g. duplexed, stapled and
766 punched) on a specific target machine, may not print as expected, or
767 may not be printable at all on other models; it also may not be fit
768 for further processing by software (e.g. by a PDF distilling program).
773 <title>CUPS can use all Windows-formatted Vendor PPDs</title>
776 CUPS can handle all spec-compliant PPDs as supplied by the
777 manufacturers for their PostScript models. Even if a
778 Unix/Linux-illiterate vendor might not have mentioned our favorite
779 OS in his manuals and brochures -- you can safely trust this:
780 <emphasis>if you get hold of the Windows NT version of the PPD, you
781 can use it unchanged in CUPS</emphasis> and thus access the full
782 power of your printer just like a Windows NT user could!
786 To check the spec compliance of any PPD online, go to <ulink
787 url="http://www.cups.org/testppd.php">http://www.cups.org/testppd.php</ulink>
788 and upload your PPD. You will see the results displayed
789 immediately. CUPS in all versions after 1.1.19 has a much more strict
790 internal PPD parsing and checking code enabled; in case of printing
791 trouble this online resource should be one of your first pitstops.
795 For real PostScript printers <emphasis>don't</emphasis> use the
796 <emphasis>Foomatic</emphasis> or <emphasis>cupsomatic</emphasis>
797 PPDs from Linuxprinting.org. With these devices the original
798 vendor-provided PPDs are always the first choice!
802 If you are looking for an original vendor-provided PPD of a specific
803 device, and you know that an NT4 box (or any other Windows box) on
804 your LAN has the PostScript driver installed, just use
805 <command>smbclient //NT4-box/print\$ -U username</command> to
806 access the Windows directory where all printer driver files are
807 stored. First look in the <filename>W32X86/2</filename> subdir for
808 the PPD you are seeking.
813 <title>CUPS also uses PPDs for non-PostScript Printers</title>
816 CUPS also uses specially crafted PPDs to handle non-PostScript
817 printers. These PPDs are usually not available from the vendors (and
818 no, you can't just take the PPD of a Postscript printer with the same
819 model name and hope it works for the non-PostScript version too). To
820 understand how these PPDs work for non-PS printers we first need to
821 dive deeply into the CUPS filtering and file format conversion
822 architecture. Stay tuned.
828 <title>The CUPS Filtering Architecture</title>
831 The core of the CUPS filtering system is based on
832 <emphasis>Ghostscript</emphasis>. In addition to Ghostscript, CUPS
833 uses some other filters of its own. You (or your OS vendor) may have
834 plugged in even more filters. CUPS handles all data file formats under
835 the label of various <emphasis>MIME types</emphasis>. Every incoming
836 printfile is subjected to an initial
837 <emphasis>auto-typing</emphasis>. The auto-typing determines its given
838 MIME type. A given MIME type implies zero or more possible filtering
839 chains relevant to the selected target printer. This section discusses
840 how MIME types recognition and conversion rules interact. They are
841 used by CUPS to automatically setup a working filtering chain for any
842 given input data format.
846 If CUPS rasterizes a PostScript file <emphasis>natively</emphasis> to
847 a bitmap, this is done in 2 stages:
851 <listitem><para>the first stage uses a Ghostscript device named "cups"
852 (this is since version 1.1.15) and produces a generic raster format
853 called "CUPS raster".
856 <listitem><para>the second stage uses a "raster driver" which converts
857 the generic CUPS raster to a device specific raster.</para></listitem>
861 Make sure your Ghostscript version has the "cups" device compiled in
862 (check with <command>gs -h | grep cups</command>). Otherwise you
863 may encounter the dreaded <computeroutput>Unable to convert file
864 0</computeroutput> in your CUPS error_log file. To have "cups" as a
865 device in your Ghostscript, you either need to <emphasis>patch GNU
866 Ghostscript</emphasis> and re-compile or use <ulink
867 url="http://www.cups.org/ghostscript.php">ESP Ghostscript</ulink>. The
868 superior alternative is ESP Ghostscript: it supports not just CUPS,
869 but 300 other devices too (while GNU Ghostscript supports only about
870 180). Because of this broad output device support, ESP Ghostscript is
871 the first choice for non-CUPS spoolers too. It is now recommended by
872 Linuxprinting.org for all spoolers.
876 CUPS printers may be setup to use <emphasis>external</emphasis>
877 rendering paths. One of the most common ones is provided by the
878 <emphasis>Foomatic/cupsomatic</emphasis> concept, from <ulink
879 url="http://www.linuxprinting.org/">Linuxprinting.org</ulink>. This
880 uses the classical Ghostscript approach, doing everything in one
881 step. It doesn't use the "cups" device, but one of the many
882 others. However, even for Foomatic/cupsomatic usage, best results and
883 broadest printer model support is provided by ESP Ghostscript (more
884 about cupsomatic/Foomatic, particularly the new version called now
885 <emphasis>foomatic-rip</emphasis>, follows below).
889 <title>MIME types and CUPS Filters</title>
892 CUPS reads the file <filename>/etc/cups/mime.types</filename>
893 (and all other files carrying a <filename>*.types</filename> suffix
894 in the same directory) upon startup. These files contain the MIME
895 type recognition rules which are applied when CUPS runs its
896 auto-typing routines. The rule syntax is explained in the man page
897 for <filename>mime.types</filename> and in the comments section of the
898 <filename>mime.types</filename> file itself. A simple rule reads
904 application/pdf pdf string(0,%PDF)
909 This means: if a filename has either a
910 <filename>.pdf</filename> suffix, or if the magic
911 string <emphasis>%PDF</emphasis> is right at the
912 beginning of the file itself (offset 0 from the start), then it is
913 a PDF file (<emphasis>application/pdf</emphasis>).
914 Another rule is this:
919 application/postscript ai eps ps string(0,%!) string(0,<04>%!)
924 Its meaning: if the filename has one of the suffixes
925 <filename>.ai</filename>, <filename>.eps</filename>,
926 <filename>.ps</filename> or if the file itself starts with one of the
927 strings <emphasis>%!</emphasis> or <emphasis><![CDATA[<04>%!]]></emphasis>, it
928 is a generic PostScript file
929 (<emphasis>application/postscript</emphasis>).
933 There is a very important difference between two similar MIME type in
934 CUPS: one is <emphasis>application/postscript</emphasis>, the other is
935 <emphasis>application/vnd.cups-postscript</emphasis>. While
936 <emphasis>application/postscript</emphasis> is meant to be device
937 independent (job options for the file are still outside the PS file
938 content, embedded in commandline or environment variables by CUPS),
939 <emphasis>application/vnd.cups-postscript</emphasis> may have the job
940 options inserted into the PostScript data itself (were
941 applicable). The transformation of the generic PostScript
942 (application/postscript) to the device-specific version
943 (application/vnd.cups-postscript) is the responsibility of the
944 CUPS <emphasis>pstops</emphasis> filter. pstops uses information
945 contained in the PPD to do the transformation.
949 Don't confuse the other mime.types file your system might be using
950 with the one in the <filename>/etc/cups/</filename> directory.
954 CUPS can handle ASCII text, HP-GL, PDF, PostScript, DVI and a
955 lot of image formats (GIF. PNG, TIFF, JPEG, Photo-CD, SUN-Raster,
956 PNM, PBM, SGI-RGB and some more) and their associated MIME types
962 <title>MIME type Conversion Rules</title>
965 CUPS reads the file <filename>/etc/cups/mime.convs</filename>
966 (and all other files named with a <filename>*.convs</filename>
967 suffix in the same directory) upon startup. These files contain
968 lines naming an input MIME type, an output MIME type, a format
969 conversion filter which can produce the output from the input type
970 and virtual costs associated with this conversion. One example line
976 application/pdf application/postscript 33 pdftops
981 This means that the <emphasis>pdftops</emphasis> filter will take
982 <emphasis>application/pdf</emphasis> as input and produce
983 <emphasis>application/postscript</emphasis> as output, the virtual
984 cost of this operation is 33 CUPS-$. The next filter is more
985 expensive, costing 66 CUPS-$:
990 application/vnd.hp-HPGL application/postscript 66 hpgltops
995 This is the <emphasis>hpgltops</emphasis>, which processes HP-GL
996 plotter files to PostScript.
1001 application/octet-stream
1006 Here are two more examples:
1011 application/x-shell application/postscript 33 texttops
1012 text/plain application/postscript 33 texttops
1017 The last two examples name the <emphasis>texttops</emphasis> filter
1018 to work on "text/plain" as well as on "application/x-shell". (Hint:
1019 this differentiation is needed for the syntax highlighting feature of
1025 <title>Filter Requirements</title>
1028 There are many more combinations named in mime.convs. However, you
1029 are not limited to use the ones pre-defined there. You can plug in any
1030 filter you like into the CUPS framework. It must meet, or must be made
1031 to meet some minimal requirements. If you find (or write) a cool
1032 conversion filter of some kind, make sure it complies to what CUPS
1033 needs, and put in the right lines in <filename>mime.types</filename>
1034 and <filename>mime.convs</filename>, then it will work seamlessly
1039 The mentioned "CUPS requirements" for filters are simple. Take
1040 filenames or <filename>stdin</filename> as input and write to
1041 <filename>stdout</filename>. They should take these 5 or 6 arguments:
1042 <emphasis>printer job user title copies options [filename]</emphasis>
1046 <varlistentry><term>Printer</term>
1047 <listitem><para>The name of the printer queue (normally this is the
1048 name of the filter being run)</para></listitem>
1051 <varlistentry><term>job</term>
1052 <listitem><para>The numeric job ID for the job being
1053 printed</para></listitem>
1056 <varlistentry><term>Printer</term>
1057 <listitem><para>The string from the originating-user-name
1058 attribute</para></listitem>
1061 <varlistentry><term>Printer</term>
1062 <listitem><para>The string from the job-name attribute</para></listitem>
1065 <varlistentry><term>Printer</term>
1066 <listitem><para>The numeric value from the number-copies
1067 attribute</para></listitem>
1070 <varlistentry><term>Printer</term>
1071 <listitem><para>The job options</para></listitem>
1074 <varlistentry><term>Printer</term>
1075 <listitem><para>(Optionally) The print request file (if missing,
1076 filters expected data fed through <filename>stdin</filename>). In most
1077 cases it is very easy to write a simple wrapper script around existing
1078 filters to make them work with CUPS.</para></listitem>
1085 <title>Prefilters</title>
1088 As was said, PostScript is the central file format to any Unix based
1089 printing system. From PostScript, CUPS generates raster data to feed
1090 non-PostScript printers.
1094 But what is happening if you send one of the supported non-PS formats
1095 to print? Then CUPS runs "pre-filters" on these input formats to
1096 generate PostScript first. There are pre-filters to create PS from
1097 ASCII text, PDF, DVI or HP-GL. The outcome of these filters is always
1098 of MIME type <emphasis>application/postscript</emphasis> (meaning that
1099 any device-specific print options are not yet embedded into the
1100 PostScript by CUPS, and that the next filter to be called is
1101 pstops). Another pre-filter is running on all supported image formats,
1102 the <emphasis>imagetops</emphasis> filter. Its outcome is always of
1103 MIME type <emphasis>application/vnd.cups-postscript</emphasis>
1104 (<emphasis>not</emphasis> application/postscript), meaning it has the
1105 print options already embedded into the file.
1109 <figure><title>Prefiltering in CUPS to form Postscript</title>
1111 <imageobject role="latex"><imagedata fileref="projdoc/imagefiles/4small"/></imageobject>
1112 <imageobject><imagedata fileref="projdoc/imagefiles/4small.png"/></imageobject>
1119 <title>pstops</title>
1122 <emphasis>pstops</emphasis>is the filter to convert
1123 <emphasis>application/postscript</emphasis> to
1124 <emphasis>application/vnd.cups-postscript</emphasis>. It was said
1125 above that this filter inserts all device-specific print options
1126 (commands to the printer to ask for the duplexing of output, or
1127 stapling an punching it, etc.) into the PostScript file.
1131 <figure><title>Adding Device-specific Print Options</title>
1133 <imageobject role="latex"><imagedata fileref="projdoc/imagefiles/5small"/></imageobject>
1134 <imageobject><imagedata fileref="projdoc/imagefiles/5small.png"/></imageobject>
1140 This is not all: other tasks performed by it are:
1145 selecting the range of pages to be printed (if you choose to
1146 print only pages "3, 6, 8-11, 16, 19-21", or only the odd numbered
1151 putting 2 or more logical pages on one sheet of paper (the
1152 so-called "number-up" function)
1155 <listitem><para>counting the pages of the job to insert the accounting
1156 information into the <filename>/var/log/cups/page_log</filename>
1162 <title>pstoraster</title>
1165 <emphasis>pstoraster</emphasis> is at the core of the CUPS filtering
1166 system. It is responsible for the first stage of the rasterization
1167 process. Its input is of MIME type application/vnd.cups-postscript;
1168 its output is application/vnd.cups-raster. This output format is not
1169 yet meant to be printable. Its aim is to serve as a general purpose
1170 input format for more specialized <emphasis>raster drivers</emphasis>,
1171 that are able to generate device-specific printer data.
1175 <figure><title>Postscript to intermediate Raster format</title>
1177 <imageobject role="latex"><imagedata fileref="projdoc/imagefiles/6small"/></imageobject>
1178 <imageobject><imagedata fileref="projdoc/imagefiles/6small.png"/></imageobject>
1184 CUPS raster is a generic raster format with powerful features. It is
1185 able to include per-page information, color profiles and more to be
1186 used by the following downstream raster drivers. Its MIME type is
1187 registered with IANA and its specification is of course completely
1188 open. It is designed to make it very easy and inexpensive for
1189 manufacturers to develop Linux and Unix raster drivers for their
1190 printer models, should they choose to do so. CUPS always takes care
1191 for the first stage of rasterization so these vendors don't need to care
1192 about Ghostscript complications (in fact, there is currently more
1193 than one vendor financing the development of CUPS raster drivers).
1197 <figure><title>CUPS-raster production using Ghostscript</title>
1199 <imageobject role="latex"><imagedata fileref="projdoc/imagefiles/7small"/></imageobject>
1200 <imageobject><imagedata fileref="projdoc/imagefiles/7small.png"/></imageobject>
1206 CUPS versions before version 1.1.15 were shipping a binary (or source
1207 code) standalone filter, named "pstoraster". pstoraster was derived
1208 from GNU Ghostscript 5.50, and could be installed besides and in
1209 addition to any GNU or AFPL Ghostscript package without conflicting.
1213 From version 1.1.15, this has changed. The functions for this has been
1214 integrated back into Ghostscript (now based on GNU Ghostscript version
1215 7.05). The "pstoraster" filter is now a simple shell script calling
1216 <command>gs</command> with the <command>-sDEVICE=cups</command>
1217 parameter. If your Ghostscript doesn't show a success on asking for
1218 <command>gs -h |grep cups</command>, you might not be able to
1219 print. Update your Ghostscript then!
1224 <title>imagetops and imagetoraster</title>
1227 Above in the section about prefilters, we mentioned the prefilter
1228 that generates PostScript from image formats. The imagetoraster
1229 filter is used to convert directly from image to raster, without the
1230 intermediate PostScript stage. It is used more often than the above
1231 mentioned prefilters. Here is a summarizing flowchart of image file
1236 <figure><title>Image format to CUPS-raster format conversion</title>
1238 <imageobject role="latex"><imagedata fileref="projdoc/imagefiles/8small"/></imageobject>
1239 <imageobject><imagedata fileref="projdoc/imagefiles/8small.png"/></imageobject>
1247 <title>rasterto [printers specific]</title>
1250 CUPS ships with quite some different raster drivers processing CUPS
1251 raster. On my system I find in /usr/lib/cups/filter/ these:
1252 <parameter>rastertoalps, rastertobj, rastertoepson, rastertoescp,
1253 rastertopcl, rastertoturboprint, rastertoapdk, rastertodymo,
1254 rastertoescp, rastertohp</parameter> and
1255 <parameter>rastertoprinter</parameter>. Don't worry if you have less
1256 than this; some of these are installed by commercial add-ons to CUPS
1257 (like <parameter>rastertoturboprint</parameter>), others (like
1258 <parameter>rastertoprinter</parameter>) by 3rd party driver
1259 development projects (such as Gimp-Print) wanting to cooperate as
1260 closely as possible with CUPS.
1264 <figure><title>Raster to Printer Specific formats</title>
1266 <imageobject role="latex"><imagedata fileref="projdoc/imagefiles/9small"/></imageobject>
1267 <imageobject><imagedata fileref="projdoc/imagefiles/9small.png"/></imageobject>
1274 <title>CUPS Backends</title>
1277 The last part of any CUPS filtering chain is a "backend". Backends
1278 are special programs that send the print-ready file to the final
1279 device. There is a separate backend program for any transfer
1280 "protocol" of sending printjobs over the network, or for every local
1281 interface. Every CUPS printqueue needs to have a CUPS "device-URI"
1282 associated with it. The device URI is the way to encode the backend
1283 used to send the job to its destination. Network device-URIs are using
1284 two slashes in their syntax, local device URIs only one, as you can
1285 see from the following list. Keep in mind that local interface names
1286 may vary much from my examples, if your OS is not Linux:
1290 <varlistentry><term>usb</term>
1292 This backend sends printfiles to USB-connected printers. An
1293 example for the CUPS device-URI to use is:
1294 <filename>usb:/dev/usb/lp0</filename>
1295 </para></listitem></varlistentry>
1297 <varlistentry><term>serial</term>
1299 This backend sends printfiles to serially connected printers.
1300 An example for the CUPS device-URI to use is:
1301 <filename>serial:/dev/ttyS0?baud=11500</filename>
1302 </para></listitem></varlistentry>
1304 <varlistentry><term>parallel</term>
1306 This backend sends printfiles to printers connected to the
1307 parallel port. An example for the CUPS device-URI to use is:
1308 <filename>parallel:/dev/lp0</filename>
1309 </para></listitem></varlistentry>
1311 <varlistentry><term>scsi</term>
1313 This backend sends printfiles to printers attached to the
1314 SCSI interface. An example for the CUPS device-URI to use is:
1315 <filename>scsi:/dev/sr1</filename>
1316 </para></listitem></varlistentry>
1318 <varlistentry><term>lpd</term>
1320 This backend sends printfiles to LPR/LPD connected network
1321 printers. An example for the CUPS device-URI to use is:
1322 <filename>lpd://remote_host_name/remote_queue_name</filename>
1323 </para></listitem></varlistentry>
1325 <varlistentry><term>AppSocket/HP JetDirect</term>
1327 This backend sends printfiles to AppSocket (a.k.a. "HP
1328 JetDirect") connected network printers. An example for the CUPS
1329 device-URI to use is:
1330 <filename>socket://10.11.12.13:9100</filename>
1331 </para></listitem></varlistentry>
1333 <varlistentry><term>ipp</term>
1335 This backend sends printfiles to IPP connected network
1336 printers (or to other CUPS servers). Examples for CUPS device-URIs
1338 <filename>ipp:://192.193.194.195/ipp</filename>
1339 (for many HP printers) or
1340 <filename>ipp://remote_cups_server/printers/remote_printer_name</filename>
1341 </para></listitem></varlistentry>
1343 <varlistentry><term>http</term>
1345 This backend sends printfiles to HTTP connected printers.
1346 (The http:// CUPS backend is only a symlink to the ipp:// backend.)
1347 Examples for the CUPS device-URIs to use are:
1348 <filename>http:://192.193.194.195:631/ipp</filename>
1349 (for many HP printers) or
1350 <filename>http://remote_cups_server:631/printers/remote_printer_name</filename>
1351 </para></listitem></varlistentry>
1353 <varlistentry><term>smb</term>
1355 This backend sends printfiles to printers shared by a Windows
1356 host. An example for CUPS device-URIs to use are:
1357 <filename>smb://workgroup/server/printersharename</filename>
1359 <filename>Smb://server/printersharename</filename>
1361 <filename>smb://username:password@workgroup/server/printersharename</filename>
1363 <filename>smb://username:password@server/printersharename</filename>.
1364 The smb:// backend is a symlink to the Samba utility
1365 <emphasis>smbspool</emphasis> (doesn't ship with CUPS). If the
1366 symlink is not present in your CUPS backend directory, have your
1367 root user create it: <command>ln -s `which smbspool`
1368 /usr/lib/cups/backend/smb</command>.
1369 </para></listitem></varlistentry>
1373 It is easy to write your own backends as Shell or Perl scripts, if you
1374 need any modification or extension to the CUPS print system. One
1375 reason could be that you want to create "special" printers which send
1376 the printjobs as email (through a "mailto:/" backend), convert them to
1377 PDF (through a "pdfgen:/" backend) or dump them to "/dev/null" (In
1378 fact I have the system-wide default printer set up to be connected to
1379 a "devnull:/" backend: there are just too many people sending jobs
1380 without specifying a printer, or scripts and programs which don't name
1381 a printer. The system-wide default deletes the job and sends a polite
1382 mail back to the $USER asking him to always specify a correct
1387 Not all of the mentioned backends may be present on your system or
1388 usable (depending on your hardware configuration). One test for all
1389 available CUPS backends is provided by the <emphasis>lpinfo</emphasis>
1390 utility. Used with the <parameter>-v</parameter> parameter, it lists
1391 all available backends:
1402 <title>cupsomatic/Foomatic -- how do they fit into the Picture?</title>
1405 "cupsomatic" filters may be the most widely used on CUPS
1406 installations. You must be clear about the fact that these were not
1407 developed by the CUPS people. They are a "Third Party" add-on to
1408 CUPS. They utilize the traditional Ghostscript devices to render jobs
1409 for CUPS. When troubleshooting, you should know about the
1410 difference. Here the whole rendering process is done in one stage,
1411 inside Ghostscript, using an appropriate "device" for the target
1412 printer. cupsomatic uses PPDs which are generated from the "Foomatic"
1413 Printer & Driver Database at Linuxprinting.org.
1417 You can recognize these PPDs from the line calling the
1418 <emphasis>cupsomatic</emphasis> filter:
1423 *cupsFilter: "application/vnd.cups-postscript 0 cupsomatic"
1428 This line you may find amongst the first 40 or so lines of the PPD
1429 file. If you have such a PPD installed, the printer shows up in the
1430 CUPS web interface with a <emphasis>foomatic</emphasis> namepart for
1431 the driver description. cupsomatic is a Perl script that runs
1432 Ghostscript, with all the complicated commandline options
1433 auto-constructed from the selected PPD and commandline options give to
1438 However, cupsomatic is now deprecated. Its PPDs (especially the first
1439 generation of them, still in heavy use out there) are not meeting the
1440 Adobe specifications. You might also suffer difficulties when you try
1441 to download them with "Point'n'Print" to Windows clients. A better,
1442 and more powerful successor is now in a very stable Beta-version
1443 available: it is called <emphasis>foomatic-rip</emphasis>. To use
1444 foomatic-rip as a filter with CUPS, you need the new-type PPDs. These
1445 have a similar, but different line:
1450 *cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
1455 The PPD generating engine at Linuxprinting.org has been revamped.
1456 The new PPDs comply to the Adobe spec. On top, they also provide a
1457 new way to specify different quality levels (hi-res photo, normal
1458 color, grayscale, draft...) with a single click (whereas before you
1459 could have required 5 or more different selections (media type,
1460 resolution, inktype, dithering algorithm...). There is support for
1461 custom-size media built in. There is support to switch
1462 print-options from page to page, in the middle of a job. And the
1463 best thing is: the new foomatic-rip now works seamlessly with all
1464 legacy spoolers too (like LPRng, BSD-LPD, PDQ, PPR etc.), providing
1465 for them access to use PPDs for their printing!
1470 <title>The Complete Picture</title>
1473 If you want to see an overview over all the filters and how they
1474 relate to each other, the complete picture of the puzzle is at the end
1480 <title><filename>mime.convs</filename></title>
1483 CUPS auto-constructs all possible filtering chain paths for any given
1484 MIME type, and every printer installed. But how does it decide in
1485 favor or against a specific alternative? (There may often be cases,
1486 where there is a choice of two or more possible filtering chains for
1487 the same target printer). Simple: you may have noticed the figures in
1488 the 3rd column of the mime.convs file. They represent virtual costs
1489 assigned to this filter. Every possible filtering chain will sum up to
1490 a total "filter cost". CUPS decides for the most "inexpensive" route.
1494 The setting of <parameter>FilterLimit 1000</parameter> in
1495 <filename>cupsd.conf</filename> will not allow more filters to
1496 run concurrently than will consume a total of 1000 virtual filter
1497 cost. This is a very efficient way to limit the load of any CUPS
1498 server by setting an appropriate "FilterLimit" value. A FilterLimit of
1499 200 allows roughly 1 job at a time, while a FilterLimit of 1000 allows
1500 approximately 5 jobs maximum at a time.
1505 <title>"Raw" printing</title>
1508 You can tell CUPS to print (nearly) any file "raw". "Raw" means it
1509 will not be filtered. CUPS will send the file to the printer "as is"
1510 without bothering if the printer is able to digest it. Users need to
1511 take care themselves that they send sensible data formats only. Raw
1512 printing can happen on any queue if the "-o raw" option is specified
1513 on the command line. You can also set up raw-only queues by simply not
1514 associating any PPD with it. This command:
1519 lpadmin -P rawprinter -v socket://11.12.13.14:9100 -E
1524 sets up a queue named "rawprinter", connected via the "socket"
1525 protocol (a.k.a. "HP JetDirect") to the device at IP address
1526 11.12.1.3.14, using port 9100. (If you had added a PPD with
1527 <command>-P /path/to/PPD</command> to this command line, you would
1528 have installed a "normal" printqueue.
1532 CUPS will automatically treat each job sent to a queue as a "raw" one,
1533 if it can't find a PPD associated with the queue. However, CUPS will
1534 only send known MIME types (as defined in its own mime.types file) and
1540 <title>"application/octet-stream" printing</title>
1543 Any MIME type with no rule in the
1544 <filename>/etc/cups/mime.types</filename> file is regarded as unknown
1545 or <emphasis>application/octet-stream</emphasis> and will not be
1546 sent. Because CUPS refuses to print unknown MIME types per default,
1547 you will probably have experienced the fact that printjobs originating
1548 from Windows clients were not printed. You may have found an error
1549 message in your CUPS logs like:
1554 Unable to convert file 0 to printable format for job
1559 To enable the printing of "application/octet-stream" files, edit
1564 <listitem><para><filename>/etc/cups/mime.convs</filename></para></listitem>
1566 <listitem><para><filename>/etc/cups/mime.types</filename></para></listitem>
1570 Both contain entries (at the end of the respective files) which must
1571 be uncommented to allow RAW mode operation for
1572 application/octet-stream. In <filename>/etc/cups/mime.types</filename>
1573 make sure this line is present:
1578 application/octet-stream
1583 This line (with no specific auto-typing rule set) makes all files
1584 not otherwise auto-typed a member of application/octet-stream. In
1585 <filename>/etc/cups/mime.convs</filename>, have this
1591 application/octet-stream application/vnd.cups-raw 0 -
1596 This line tells CUPS to use the <emphasis>Null Filter</emphasis>
1597 (denoted as "-", doing... nothing at all) on
1598 <emphasis>application/octet-stream</emphasis>, and tag the result as
1599 <emphasis>application/vnd.cups-raw</emphasis>. This last one is
1600 always a green light to the CUPS scheduler to now hand the file over
1601 to the "backend" connecting to the printer and sending it over.
1604 <note><para> Editing the <filename>mime.convs</filename> and the
1605 <filename>mime.types</filename> file does not
1606 <emphasis>enforce</emphasis> "raw" printing, it only
1607 <emphasis>allows</emphasis> it.
1611 <title>Background</title>
1614 CUPS being a more security-aware printing system than traditional ones
1615 does not by default allow one to send deliberate (possibly binary)
1616 data to printing devices. (This could be easily abused to launch a
1617 Denial of Service attack on your printer(s), causing at least the loss
1618 of a lot of paper and ink...) "Unknown" data are regarded by CUPS
1619 as <emphasis>MIME type</emphasis>
1620 <emphasis>application/octet-stream</emphasis>. While you
1621 <emphasis>can</emphasis> send data "raw", the MIME type for these must
1622 be one that is known to CUPS and an allowed one. The file
1623 <filename>/etc/cups/mime.types</filename> defines the "rules" how CUPS
1624 recognizes MIME types. The file
1625 <filename>/etc/cups/mime.convs</filename> decides which file
1626 conversion filter(s) may be applied to which MIME types.
1632 <title>PostScript Printer Descriptions (PPDs) for non-PS Printers</title>
1635 Originally PPDs were meant to be used for PostScript printers
1636 only. Here, they help to send device-specific commands and settings
1637 to the RIP which processes the jobfile. CUPS has extended this
1638 scope for PPDs to cover non-PostScript printers too. This was not
1639 very difficult, because it is a standardized file format. In a way
1640 it was logical too: CUPS handles PostScript and uses a PostScript
1641 RIP (=Ghostscript) to process the jobfiles. The only difference is:
1642 a PostScript printer has the RIP built-in, for other types of
1643 printers the Ghostscript RIP runs on the host computer.
1647 PPDs for a non-PS printer have a few lines that are unique to
1648 CUPS. The most important one looks similar to this:
1653 *cupsFilter: application/vnd.cups-raster 66 rastertoprinter
1658 It is the last piece in the CUPS filtering puzzle. This line tells the
1659 CUPS daemon to use as a last filter "rastertoprinter". This filter
1660 should be served as input an "application/vnd.cups-raster" MIME type
1661 file. Therefore CUPS should auto-construct a filtering chain, which
1662 delivers as its last output the specified MIME type. This is then
1663 taken as input to the specified "rastertoprinter" filter. After this
1664 the last filter has done its work ("rastertoprinter" is a Gimp-Print
1665 filter), the file should go to the backend, which sends it to the
1670 CUPS by default ships only a few generic PPDs, but they are good for
1671 several hundred printer models. You may not be able to control
1672 different paper trays, or you may get larger margins than your
1673 specific model supports):
1677 <varlistentry><term>deskjet.ppd</term>
1678 <listitem><para>older HP inkjet printers and compatible
1682 <varlistentry><term>deskjet2.ppd</term>
1683 <listitem><para>newer HP inkjet printers and compatible
1687 <varlistentry><term>dymo.ppd</term>
1688 <listitem><para>label printers
1692 <varlistentry><term>epson9.ppd</term>
1693 <listitem><para>Epson 24pin impact printers and compatible
1697 <varlistentry><term>epson24.ppd</term>
1698 <listitem><para>Epson 24pin impact printers and compatible
1702 <varlistentry><term>okidata9.ppd</term>
1703 <listitem><para>Okidata 9pin impact printers and compatible
1707 <varlistentry><term>okidat24.ppd</term>
1708 <listitem><para>Okidata 24pin impact printers and compatible
1712 <varlistentry><term>stcolor.ppd</term>
1713 <listitem><para>older Epson Stylus Color printers
1717 <varlistentry><term>stcolor2.ppd</term>
1718 <listitem><para>newer Epson Stylus Color printers
1722 <varlistentry><term>stphoto.ppd</term>
1723 <listitem><para>older Epson Stylus Photo printers
1727 <varlistentry><term>stphoto2.ppd</term>
1728 <listitem><para>newer Epson Stylus Photo printers
1732 <varlistentry><term>laserjet.ppd</term>
1733 <listitem><para>all PCL printers. Further below is a discussion
1734 of several other driver/PPD-packages suitable fur use with CUPS.
1741 <title>Difference between <emphasis>cupsomatic/foomatic-rip</emphasis> and
1742 <emphasis>native CUPS</emphasis> printing</title>
1745 Native CUPS rasterization works in two steps.
1750 First is the "pstoraster" step. It uses the special "cups"
1751 device from ESP Ghostscript 7.05.x as its tool
1755 Second comes the "rasterdriver" step. It uses various
1756 device-specific filters; there are several vendors who provide good
1757 quality filters for this step, some are Free Software, some are
1758 Shareware/Non-Free, some are proprietary.</para></listitem>
1762 Often this produces better quality (and has several more
1763 advantages) than other methods.
1767 <figure><title>cupsomatic/foomatic processing versus Native CUPS</title>
1769 <imageobject role="latex"><imagedata fileref="projdoc/imagefiles/10small"/></imageobject>
1770 <imageobject><imagedata fileref="projdoc/imagefiles/10small.png"/></imageobject>
1776 One other method is the <emphasis>cupsomatic/foomatic-rip</emphasis>
1777 way. Note that cupsomatic is <emphasis>not</emphasis> made by the CUPS
1778 developers. It is an independent contribution to printing development,
1779 made by people from Linuxprinting.org (see also <ulink
1780 url="http://www.cups.org/cups-help.html">http://www.cups.org/cups-help.html</ulink>).
1781 cupsomatic is no longer developed and maintained and is no longer
1782 supported. It has now been replaced by
1783 <emphasis>foomatic-rip</emphasis>. foomatic-rip is a complete re-write
1784 of the old cupsomatic idea, but very much improved and generalized to
1785 other (non-CUPS) spoolers. An upgrade to foomatic-rip is strongly
1786 advised, especially if you are upgrading to a recent version of CUPS
1791 Both the cupsomatic (old) and the foomatic-rip (new) methods from
1792 Linuxprinting.org use the traditional Ghostscript print file
1793 processing, doing everything in a single step. It therefore relies on
1794 all the other devices built-in into Ghostscript. The quality is as
1795 good (or bad) as Ghostscript rendering is in other spoolers. The
1796 advantage is that this method supports many printer models not
1797 supported (yet) by the more modern CUPS method.
1801 Of course, you can use both methods side by side on one system (and
1802 even for one printer, if you set up different queues), and find out
1803 which works best for you.
1807 cupsomatic "kidnaps" the printfile after the
1808 <emphasis>application/vnd.cups-postscript</emphasis> stage and
1809 deviates it through the CUPS-external, system wide Ghostscript
1810 installation: Therefore the printfile bypasses the "pstoraster" filter
1811 (and thus also bypasses the CUPS-raster-drivers
1812 "rastertosomething"). After Ghostscript finished its rasterization,
1813 cupsomatic hands the rendered file directly to the CUPS backend. The
1814 flowchart above illustrates the difference between native CUPS
1815 rendering and the Foomatic/cupsomatic method.
1820 <title>Examples for filtering Chains</title>
1823 Here are a few examples of commonly occurring filtering chains to
1824 illustrate the workings of CUPS.
1828 Assume you want to print a PDF file to a HP JetDirect-connected
1829 PostScript printer, but you want to print the pages 3-5, 7, 11-13
1830 only, and you want to print them "2-up" and "duplex":
1834 <listitem><para>your print options (page selection as required, 2-up,
1835 duplex) are passed to CUPS on the commandline;</para></listitem>
1837 <listitem><para>the (complete) PDF file is sent to CUPS and autotyped as
1838 <emphasis>application/pdf</emphasis>;</para></listitem>
1840 <listitem><para>the file therefore first must pass the
1841 <emphasis>pdftops</emphasis> pre-filter, which produces PostScript
1842 MIME type <emphasis>application/postscript</emphasis> (a preview here
1843 would still show all pages of the original PDF);</para></listitem>
1845 <listitem><para>the file then passes the <emphasis>pstops</emphasis>
1846 filter which applies the commandline options: it selects the pages
1847 2-5, 7 and 11-13, creates and imposed layout "2 pages on 1 sheet" and
1848 inserts the correct "duplex" command (as is defined in the printer's
1849 PPD) into the new PostScript file; the file now is of PostScript MIME
1851 <emphasis>application/vnd.cups-postscript</emphasis>;</para></listitem>
1853 <listitem><para>the file goes to the <emphasis>socket</emphasis>
1854 backend, which transfers the job to the printers.</para></listitem>
1858 The resulting filter chain therefore is:
1862 pdftops --> pstops --> socket
1866 Assume your want to print the same filter to an USB-connected
1867 Epson Stylus Photo printer, installed with the CUPS
1868 <filename>stphoto2.ppd</filename>. The first few filtering stages
1869 are nearly the same:
1873 <listitem><para>your print options (page selection as required, 2-up,
1874 duplex) are passed to CUPS on the commandline;</para></listitem>
1876 <listitem><para>the (complete) PDF file is sent to CUPS and autotyped as
1877 <emphasis>application/pdf</emphasis>;</para></listitem>
1879 <listitem><para>the file therefore first must pass the
1880 <emphasis>pdftops</emphasis> pre-filter, which produces PostScript
1881 MIME type <emphasis>application/postscript</emphasis> (a preview here
1882 would still show all pages of the original PDF);</para></listitem>
1884 <listitem><para>the file then passes the "pstops" filter which applies
1885 the commandline options: it selects the pages 2-5, 7 and 11-13,
1886 creates and imposed layout "2 pages on 1 sheet" and inserts the
1887 correct "duplex" command... (OOoops -- this printer and his PPD
1888 don't support duplex printing at all -- this option will be ignored
1889 then) into the new PostScript file; the file now is of PostScript
1891 <emphasis>application/vnd.cups-postscript</emphasis>;</para></listitem>
1893 <listitem><para>the file then passes the
1894 <emphasis>pstoraster</emphasis> stage and becomes MIME type
1895 <emphasis>application/cups-raster</emphasis>;</para></listitem>
1897 <listitem><para>finally, the <emphasis>rastertoepson</emphasis> filter
1898 does its work (as is indicated in the printer's PPD), creating the
1899 printer-specific raster data and embedding any user-selected
1900 print-options into the print data stream;</para></listitem>
1902 <listitem><para>the file goes to the <emphasis>usb</emphasis> backend,
1903 which transfers the job to the printers.</para></listitem>
1907 The resulting filter chain therefore is:
1911 pdftops --> pstops --> pstoraster --> rastertoepson --> usb
1916 <title>Sources of CUPS drivers / PPDs</title>
1919 On the internet you can find now many thousand CUPS-PPD files
1920 (with their companion filters), in many national languages,
1921 supporting more than 1000 non-PostScript models.
1925 <listitem><para><ulink url="http://wwwl.easysw.com/printpro/">ESP
1926 PrintPro (http://wwwl.easysw.com/printpro/)</ulink> (commercial,
1927 non-Free) is packaged with more than 3000 PPDs, ready for
1928 successful use "out of the box" on Linux, Mac OS X, IBM-AIX,
1929 HP-UX, Sun-Solaris, SGI-IRIX, Compaq Tru64, Digital Unix and some
1930 more commercial Unices (it is written by the CUPS developers
1931 themselves and its sales help finance the further development of
1932 CUPS, as they feed their creators).</para></listitem>
1934 <listitem><para>the <ulink
1935 url="http://gimp-print.sourceforge.net/">Gimp-Print-Project
1936 (http://gimp-print.sourceforge.net/)</ulink> (GPL, Free Software)
1937 provides around 140 PPDs (supporting nearly 400 printers, many driven
1938 to photo quality output), to be used alongside the Gimp-Print CUPS
1939 filters;</para></listitem>
1941 <listitem><para><ulink url="http://www.turboprint.com/">TurboPrint
1942 (http://www.turboprint.com/)</ulink> (Shareware, non-Free) supports
1943 roughly the same amount of printers in excellent
1944 quality;</para></listitem>
1946 <listitem><para><ulink
1947 url="http://www-124.ibm.com/developerworks/oss/linux/projects/omni/">OMNI
1948 (http://www-124.ibm.com/developerworks/oss/linux/projects/omni/)</ulink>
1949 (LPGL, Free) is a package made by IBM, now containing support for more
1950 than 400 printers, stemming from the inheritance of IBM OS/2 Know-How
1951 ported over to Linux (CUPS support is in a Beta-stage at
1952 present);</para></listitem>
1954 <listitem><para><ulink url="http://hpinkjet.sourceforge.net/">HPIJS
1955 (http://hpinkjet.sourceforge.net/)</ulink> (BSD-style licenses, Free)
1956 supports around 150 of HP's own printers and is also providing
1957 excellent print quality now (currently available only via the Foomatic
1958 path);</para></listitem>
1960 <listitem><para><ulink
1961 url="http://www.linuxprinting.org/">Foomatic/cupsomatic
1962 (http://www.linuxprinting.org/)</ulink> (LPGL, Free) from
1963 Linuxprinting.org are providing PPDs for practically every Ghostscript
1964 filter known to the world (including Omni, Gimp-Print and
1965 HPIJS).</para></listitem>
1969 The cupsomatic/Foomatic trick from Linuxprinting.org works
1970 differently from the other drivers. This is explained elsewhere in this
1976 <title>Printing with Interface Scripts</title>
1979 CUPS also supports the usage of "interface scripts" as known from
1980 System V AT&T printing systems. These are often used for PCL
1981 printers, from applications that generate PCL print jobs. Interface
1982 scripts are specific to printer models. They have a similar role as
1983 PPDs for PostScript printers. Interface scripts may inject the Escape
1984 sequences as required into the print data stream, if the user has
1985 chosen to select a certain paper tray, or print landscape, or use A3
1986 paper, etc. Interfaces scripts are practically unknown in the Linux
1987 realm. On HP-UX platforms they are more often used. You can use any
1988 working interface script on CUPS too. Just install the printer with
1989 the <command>-i</command> option:
1994 lpadmin -p pclprinter -v socket://11.12.13.14:9100 -i /path/to/interface-script
1999 Interface scripts might be the "unknown animal" to many. However,
2000 with CUPS they provide the most easy way to plug in your own
2001 custom-written filtering script or program into one specific print
2002 queue (some information about the traditional usage of interface scripts is
2003 to be found at <ulink
2004 url="http://playground.sun.com/printing/documentation/interface.html">http://playground.sun.com/printing/documentation/interface.html</ulink>).
2010 <title>Network printing (purely Windows)</title>
2013 Network printing covers a lot of ground. To understand what exactly
2014 goes on with Samba when it is printing on behalf of its Windows
2015 clients, let's first look at a "purely Windows" setup: Windows clients
2016 with a Windows NT print server.
2020 <title>From Windows Clients to an NT Print Server</title>
2023 Windows clients printing to an NT-based print server have two
2028 <listitem><para>execute the driver locally and render the GDI output
2029 (EMF) into the printer specific format on their own,
2030 or</para></listitem>
2032 <listitem><para>send the GDI output (EMF) to the server, where the
2033 driver is executed to render the printer specific
2034 output.</para></listitem>
2038 Both print paths are shown in the flowcharts below.
2043 <title>Driver Execution on the Client</title>
2046 In the first case the print server must spool the file as "raw",
2047 meaning it shouldn't touch the jobfile and try to convert it in any
2048 way. This is what traditional Unix-based print server can do too; and
2049 at a better performance and more reliably than NT print server. This
2050 is what most Samba administrators probably are familiar with. One
2051 advantage of this setup is that this "spooling-only" print server may
2052 be used even if no driver(s) for Unix are available it is sufficient
2053 to have the Windows client drivers available and installed on the
2058 <figure><title>Print Driver execution on the Client</title>
2060 <imageobject role="latex"><imagedata fileref="projdoc/imagefiles/11small"/></imageobject>
2061 <imageobject><imagedata fileref="projdoc/imagefiles/11small.png"/></imageobject>
2068 <title>Driver Execution on the Server</title>
2071 The other path executes the printer driver on the server. The clients
2072 transfers print files in EMF format to the server. The server uses the
2073 PostScript, PCL, ESC/P or other driver to convert the EMF file into
2074 the printer-specific language. It is not possible for Unix to do the
2075 same. Currently there is no program or method to convert a Windows
2076 client's GDI output on a Unix server into something a printer could
2081 <figure><title>Print Driver execution on the Server</title>
2083 <imageobject role="latex"><imagedata fileref="projdoc/imagefiles/12small"/></imageobject>
2084 <imageobject><imagedata fileref="projdoc/imagefiles/12small.png"/></imageobject>
2090 However, there is something similar possible with CUPS. Read on...
2096 <title>Network Printing (Windows clients -- UNIX/Samba Print
2100 Since UNIX print servers <emphasis>cannot</emphasis> execute the Win32
2101 program code on their platform, the picture is somewhat
2102 different. However, this doesn't limit your options all that
2103 much. In the contrary, you may have a way here to implement printing
2104 features which are not possible otherwise.
2108 <title>From Windows Clients to a CUPS/Samba Print Server</title>
2111 Here is a simple recipe showing how you can take advantage of CUPS
2112 powerful features for the benefit of your Windows network printing
2118 <listitem><para>Let the Windows clients send PostScript to the CUPS
2119 server.</para></listitem>
2121 <listitem><para>Let the CUPS server render the PostScript into device
2122 specific raster format.</para></listitem>
2126 This requires the clients to use a PostScript driver (even if the
2127 printer is a non-PostScript model. It also requires that you have a
2128 "driver" on the CUPS server.
2132 Firstly, to enable CUPS based printing through Samba the
2133 following options should be set in your <filename>smb.conf</filename> file [globals]
2138 <listitem><para><parameter>printing = CUPS</parameter></para></listitem>
2140 <listitem><para><parameter>printcap = CUPS</parameter></para></listitem>
2144 When these parameters are specified, all manually set print directives
2145 (like <parameter>print command =...</parameter>, or <parameter>lppause
2146 command =...</parameter>) in <filename>smb.conf</filename> (as well as
2147 in samba itself) will be ignored. Instead, Samba will directly
2148 interface with CUPS through it's application program interface (API) -
2149 as long as Samba has been compiled with CUPS library (libcups)
2150 support. If Samba has NOT been compiled with CUPS support, and if no
2151 other print commands are set up, then printing will use the
2152 <emphasis>System V</emphasis> AT&T command set, with the -oraw
2153 option automatically passing through (if you want your own defined
2154 print commands to work with a Samba that has CUPS support compiled in,
2155 simply use <parameter>printing = sysv</parameter>).
2159 <figure><title>Printing via CUPS/samba server</title>
2161 <imageobject role="latex"><imagedata fileref="projdoc/imagefiles/13small"/></imageobject>
2162 <imageobject><imagedata fileref="projdoc/imagefiles/13small.png"/></imageobject>
2169 <title>Samba receiving Jobfiles and passing them to CUPS</title>
2172 Samba <emphasis>must</emphasis> use its own spool directory (it is set
2173 by a line similar to <parameter>path = /var/spool/samba</parameter>,
2174 in the <parameter>[printers]</parameter> or
2175 <parameter>[printername]</parameter> section of
2176 <filename>smb.conf</filename>). Samba receives the job in its own
2177 spool space and passes it into the spool directory of CUPS (the CUPS
2178 spooling directory is set by the <parameter>RequestRoot</parameter>
2179 directive, in a line that defaults to <parameter>RequestRoot
2180 /var/spool/cups</parameter>). CUPS checks the access rights of its
2181 spool dir and resets it to healthy values with every re-start. We have
2182 seen quite some people who had used a common spooling space for Samba
2183 and CUPS, and were struggling for weeks with this "problem".
2187 A Windows user authenticates only to Samba (by whatever means is
2188 configured). If Samba runs on the same host as CUPS, you only need to
2189 allow "localhost" to print. If they run on different machines, you
2190 need to make sure the Samba host gets access to printing on CUPS.
2196 <title>Network PostScript RIP: CUPS Filters on Server -- clients use
2197 PostScript Driver with CUPS-PPDs</title>
2200 PPDs can control all print device options. They are usually provided
2201 by the manufacturer; if you own a PostScript printer, that is. PPD
2202 files (PostScript Printer Descriptions) are always a component of
2203 PostScript printer drivers on MS Windows or Apple Mac OS systems. They
2204 are ASCII files containing user-selectable print options, mapped to
2205 appropriate PostScript, PCL or PJL commands for the target
2206 printer. Printer driver GUI dialogs translate these options
2207 "on-the-fly" into buttons and drop-down lists for the user to select.
2211 CUPS can load, without any conversions, the PPD file from any Windows
2212 (NT is recommended) PostScript driver and handle the options. There is
2213 a web browser interface to the print options (select <ulink
2214 url="http://localhost:631/printers/">http://localhost:631/printers/</ulink>
2215 and click on one <emphasis>Configure Printer</emphasis> button to see
2216 it), or a commandline interface (see <command>man lpoptions</command>
2217 or see if you have lphelp on your system). There are also some
2218 different GUI frontends on Linux/UNIX, which can present PPD options
2219 to users. PPD options are normally meant to be evaluated by the
2220 PostScript RIP on the real PostScript printer.
2224 <title>PPDs for non-PS Printers on UNIX</title>
2227 CUPS doesn't limit itself to "real" PostScript printers in its usage
2228 of PPDs. The CUPS developers have extended the scope of the PPD
2229 concept, to also describe available device and driver options for
2230 non-PostScript printers through CUPS-PPDs.
2234 This is logical, as CUPS includes a fully featured PostScript
2235 interpreter (RIP). This RIP is based on Ghostscript. It can process
2236 all received PostScript (and additionally many other file formats)
2237 from clients. All CUPS-PPDs geared to non-PostScript printers contain
2238 an additional line, starting with the keyword
2239 <parameter>*cupsFilter</parameter> . This line tells the CUPS print
2240 system which printer-specific filter to use for the interpretation of
2241 the supplied PostScript. Thus CUPS lets all its printers appear as
2242 PostScript devices to its clients, because it can act as a PostScript
2243 RIP for those printers, processing the received PostScript code into a
2244 proper raster print format.
2249 <title>PPDs for non-PS Printers on Windows</title>
2252 CUPS-PPDs can also be used on Windows-Clients, on top of a
2253 "core" PostScript driver (now recommended is the "CUPS PostScript
2254 Driver for WindowsNT/2K/XP"; you can also use the Adobe one, with
2255 limitations). This feature enables CUPS to do a few tricks no other
2261 <listitem><para>act as a networked PostScript RIP (Raster Image
2262 Processor), handling printfiles from all client platforms in a uniform
2263 way;</para></listitem>
2265 <listitem><para>act as a central accounting and billing server, since
2266 all files are passed through the pstops filter and are therefore
2267 logged in the CUPS <filename>page_log</filename> file.
2268 <emphasis>NOTE:</emphasis> this can not happen with "raw" print jobs,
2269 which always remain unfiltered per definition;</para></listitem>
2271 <listitem><para>enable clients to consolidate on a single PostScript
2272 driver, even for many different target printers.</para></listitem>
2276 Using CUPS PPDs on Windows clients enables these to control
2277 all print job settings just as a UNIX client can do too.
2283 <title>Windows Terminal Servers (WTS) as CUPS Clients</title>
2286 This setup may be of special interest to people experiencing major
2287 problems in WTS environments. WTS need often a multitude of
2288 non-PostScript drivers installed to run their clients' variety of
2289 different printer models. This often imposes the price of much
2290 increased instability.
2294 <title>Printer Drivers running in "Kernel Mode" cause many
2298 The reason is that in Win NT printer drivers run in "Kernel
2299 Mode", this introduces a high risk for the stability of the system
2300 if the driver is not really stable and well-tested. And there are a
2301 lot of bad drivers out there! Especially notorious is the example
2302 of the PCL printer driver that had an additional sound module
2303 running, to notify users via soundcard of their finished jobs. Do I
2304 need to say that this one was also reliably causing "Blue Screens
2305 of Death" on a regular basis?
2309 PostScript drivers generally are very well tested. They are not known
2310 to cause any problems, even though they run in Kernel Mode too. This
2311 might be because there have so far only been 2 different PostScript
2312 drivers the ones from Adobe and the one from Microsoft. Both are
2313 very well tested and are as stable as you ever can imagine on
2314 Windows. The CUPS driver is derived from the Microsoft one.
2319 <title>Workarounds impose Heavy Limitations</title>
2322 In many cases, in an attempt to work around this problem, site
2323 administrators have resorted to restrict the allowed drivers installed
2324 on their WTS to one generic PCL- and one PostScript driver. This
2325 however restricts the clients in the amount of printer options
2326 available for them; often they can't get out more than simplex
2327 prints from one standard paper tray, while their devices could do much
2328 better, if driven by a different driver! )
2333 <title>CUPS: a "Magical Stone"?</title>
2336 Using a PostScript driver, enabled with a CUPS-PPD, seems to be a very
2337 elegant way to overcome all these shortcomings. There are, depending
2338 on the version of Windows OS you use, up to 3 different PostScript
2339 drivers available: Adobe, Microsoft and CUPS PostScript drivers. None
2340 of them is known to cause major stability problems on WTS (even if
2341 used with many different PPDs). The clients will be able to (again)
2342 chose paper trays, duplex printing and other settings. However, there
2343 is a certain price for this too: a CUPS server acting as a PostScript
2344 RIP for its clients requires more CPU and RAM than when just acting as
2345 a "raw spooling" device. Plus, this setup is not yet widely tested,
2346 although the first feedbacks look very promising.
2351 <title>PostScript Drivers with no major problems -- even in Kernel
2355 More recent printer drivers on W2K and XP don't run in Kernel mode
2356 (unlike Win NT) any more. However, both operating systems can still
2357 use the NT drivers, running in Kernel mode (you can roughly tell which
2358 is which as the drivers in subdirectory "2" of "W32X86" are "old"
2359 ones). As was said before, the Adobe as well as the Microsoft
2360 PostScript drivers are not known to cause any stability problems. The
2361 CUPS driver is derived from the Microsoft one. There is a simple
2362 reason for this: The MS DDK (Device Development Kit) for Win NT (which
2363 used to be available at no cost to licensees of Visual Studio)
2364 includes the source code of the Microsoft driver, and licensees of
2365 Visual Studio are allowed to use and modify it for their own driver
2366 development efforts. This is what the CUPS people have done. The
2367 license doesn't allow them to publish the whole of the source code.
2368 However, they have released the "diff" under the GPL, and if you are
2369 owner of an "MS DDK for Win NT", you can check the driver yourself.
2375 <title> Setting up CUPS for driver Download</title>
2378 As we have said before: all previously known methods to prepare client
2379 printer drivers on the Samba server for download and "Point'n'Print"
2380 convenience of Windows workstations are working with CUPS too. These
2381 methods were described in the previous chapter. In reality, this is a
2382 pure Samba business, and only relates to the Samba/Win client
2387 <title><emphasis>cupsaddsmb</emphasis>: the unknown Utility</title>
2390 The cupsaddsmb utility (shipped with all current CUPS versions) is an
2391 alternative method to transfer printer drivers into the Samba
2392 <parameter>[print$]</parameter> share. Remember, this share is where
2393 clients expect drivers deposited and setup for download and
2394 installation. It makes the sharing of any (or all) installed CUPS
2395 printers very easy. cupsaddsmb can use the Adobe PostScript driver as
2396 well as the newly developed <emphasis>CUPS PostScript Driver for
2397 WinNT/2K/XP</emphasis>. Note, that cupsaddsmb does
2398 <emphasis>not</emphasis> work with arbitrary vendor printer drivers,
2399 but only with the <emphasis>exact</emphasis> driver files that are
2400 named in its man page.
2404 The CUPS printer driver is available from the CUPS download site. Its
2405 package name is <filename>cups-samba-[version].tar.gz</filename> . It
2406 is preferred over the Adobe drivers since it has a number of
2411 <listitem><para>it supports a much more accurate page
2412 accounting;</para></listitem>
2414 <listitem><para>it supports banner pages, and page labels on all
2415 printers;</para></listitem>
2417 <listitem><para>it supports the setting of a number of job IPP
2418 attributes (such as job-priority, page-label and
2419 job-billing)</para></listitem>
2423 However, currently only Windows NT, 2000, and XP are supported by the
2424 CUPS drivers. You will need to get the respective part of Adobe driver
2425 too if you need to support Windows 95, 98, and ME clients.
2430 <title>Prepare your <filename>smb.conf</filename> for
2434 Prior to running cupsaddsmb, you need the following settings in
2435 <filename>smb.conf</filename>:
2443 printcap name = cups
2446 comment = All Printers
2447 path = /var/spool/samba
2450 guest ok = yes # setting depends on your requirements
2453 printer admin = root
2456 comment = Printer Drivers
2457 path = /etc/samba/drivers
2467 <title>CUPS Package of "PostScript Driver for WinNT/2k/XP"</title>
2470 CUPS users may get the exactly same packages from<ulink
2471 url="http://www.cups.org/software.html"><emphasis>http://www.cups.org/software.html</emphasis></ulink>.
2472 It is a separate package from the CUPS base software files, tagged as
2473 <emphasis>CUPS 1.1.x Windows NT/2k/XP Printer Driver for SAMBA
2474 (tar.gz, 192k)</emphasis>. The filename to download is
2475 <filename>cups-samba-1.1.x.tar.gz</filename>. Upon untar-/unzip-ing,
2476 it will reveal these files:
2481 # tar xvzf cups-samba-1.1.19.tar.gz
2492 These have been packaged with the ESP meta packager software
2493 "EPM". The <filename>*.install</filename> and
2494 <filename>*.remove</filename> files are simple shell scripts, which
2495 untars the <filename>*.ss</filename> (the <filename>*.ss</filename> is
2496 nothing else but a tar-archive, which can be untar-ed by "tar"
2497 too). Then it puts the content into
2498 <filename>/usr/share/cups/drivers/</filename>. This content includes 3
2504 # tar tv cups-samba.ss
2513 The <emphasis>cups-samba.install</emphasis> shell scripts is easy to
2519 # ./cups-samba.install
2522 Installing software...
2523 Updating file permissions...
2524 Running post-install commands...
2525 Installation is complete.
2530 The script should automatically put the driver files into the
2531 <filename>/usr/share/cups/drivers/</filename> directory.
2535 Due to a bug, one recent CUPS release puts the
2536 <filename>cups.hlp</filename> driver file
2537 into<filename>/usr/share/drivers/</filename> instead of
2538 <filename>/usr/share/cups/drivers/</filename>. To work around this,
2539 copy/move the file (after running the
2540 <command>./cups-samba.install</command> script) manually to the
2546 cp /usr/share/drivers/cups.hlp /usr/share/cups/drivers/
2551 This new CUPS PostScript driver is currently binary-only, but free of
2552 charge. No complete source code is provided (yet). The reason is this:
2553 it has been developed with the help of the <emphasis>Microsoft Driver
2554 Developer Kit</emphasis> (DDK) and compiled with Microsoft Visual
2555 Studio 6. Driver developers are not allowed to distribute the whole of
2556 the source code as Free Software. However, CUPS developers released
2557 the "diff" in source code under the GPL, so anybody with a license of
2558 Visual Studio and a DDK will be able to compile for him/herself.
2563 <title>Recognize the different Driver Files</title>
2566 The CUPS drivers don't support the "older" Windows 95/98/ME, but only
2567 the Windows NT/2000/XP client:
2572 [Windows NT, 2000, and XP are supported by:]
2580 Adobe drivers are available for the older Windows 95/98/ME as well as
2581 the Windows NT/2000/XP clients. The set of files is different for the
2582 different platforms.
2587 [Windows 95, 98, and Me are supported by:]
2595 [Windows NT, 2000, and XP are supported by:]
2603 If both, the Adobe driver files and the CUPS driver files for the
2604 support of WinNT/2k/XP are present in , the Adobe ones will be ignored
2605 and the CUPS ones will be used. If you prefer -- for whatever reason
2606 -- to use Adobe-only drivers, move away the 3 CUPS driver files. The
2607 Win95/98/ME clients use the Adobe drivers in any case.
2612 <title>Acquiring the Adobe Driver Files</title>
2615 Acquiring the Adobe driver files seems to be unexpectedly difficult
2616 for many users. They are not available on the Adobe website as single
2617 files and the self-extracting and/or self-installing Windows-exe is
2618 not easy to locate either. Probably you need to use the included
2619 native installer and run the installation process on one client
2620 once. This will install the drivers (and one Generic PostScript
2621 printer) locally on the client. When they are installed, share the
2622 Generic PostScript printer. After this, the client's
2623 <parameter>[print$]</parameter> share holds the Adobe files, from
2624 where you can get them with smbclient from the CUPS host. A more
2625 detailed description about this is in the next (the CUPS printing)
2631 <title>ESP Print Pro Package of "PostScript Driver for
2632 WinNT/2k/XP"</title>
2635 Users of the ESP Print Pro software are able to install their "Samba
2636 Drivers" package for this purpose with no problem. Retrieve the driver
2637 files from the normal download area of the ESP Print Pro software
2639 url="http://www.easysw.com/software.html">http://www.easysw.com/software.html</ulink>.
2640 You need to locate the link labelled "SAMBA" amongst the
2641 <emphasis>Download Printer Drivers for ESP Print Pro 4.x</emphasis>
2642 area and download the package. Once installed, you can prepare any
2643 driver by simply highlighting the printer in the Printer Manager GUI
2644 and select <emphasis>Export Driver...</emphasis> from the menu. Of
2645 course you need to have prepared Samba beforehand too to handle the
2646 driver files; i.e. mainly setup the <parameter>[print$]</parameter>
2647 share, etc. The ESP Print Pro package includes the CUPS driver files
2648 as well as a (licensed) set of Adobe drivers for the Windows 95/98/ME
2654 <title>Caveats to be considered</title>
2657 Once you have run the install script (and possibly manually
2658 moved the <filename>cups.hlp</filename> file to
2659 <filename>/usr/share/cups/drivers/</filename>), the driver is
2660 ready to be put into Samba's <parameter>[print$]</parameter> share (which often maps to
2661 <filename>/etc/samba/drivers/</filename> and contains a subdir
2662 tree with <emphasis>WIN40</emphasis> and
2663 <emphasis>W32X86</emphasis> branches): You do this by running
2664 "cupsaddsmb" (see also <command>man cupsaddsmb</command> for
2665 CUPS since release 1.1.16).
2669 You may need to put root into the smbpasswd file by running
2670 <command>smbpasswd</command>; this is especially important if you
2671 should run this whole procedure for the first time, and are not
2672 working in an environment where everything is configured for
2673 <emphasis>Single Sign On</emphasis> to a Windows Domain Controller.
2677 Once the driver files are in the <parameter>[print$]</parameter> share
2678 and are initialized, they are ready to be downloaded and installed by
2679 the Win NT/2k/XP clients.
2685 Win 9x/ME clients won't work with the CUPS PostScript driver. For
2686 these you'd still need to use the <filename>ADOBE*.*</filename>
2687 drivers as previously.
2691 It is not harmful if you still have the
2692 <filename>ADOBE*.*</filename> driver files from previous
2693 installations in the <filename>/usr/share/cups/drivers/</filename>
2694 directory. The new <emphasis>cupsaddsmb</emphasis> (from 1.1.16) will
2695 automatically prefer "its own" drivers if it finds both.
2699 Should your Win clients have had the old <filename>ADOBE*.*</filename>
2700 files for the Adobe PostScript driver installed, the download and
2701 installation of the new CUPS PostScript driver for Windows NT/2k/XP
2702 will fail at first. You need to wipe the old driver from the clients
2703 first. It is not enough to "delete" the printer, as the driver files
2704 will still be kept by the clients and re-used if you try to re-install
2705 the printer. To really get rid of the Adobe driver files on the
2706 clients, open the "Printers" folder (possibly via <emphasis>Start
2707 --> Settings --> Control Panel --> Printers</emphasis>),
2708 right-click onto the folder background and select <emphasis>Server
2709 Properties</emphasis>. When the new dialog opens, select the
2710 <emphasis>Drivers</emphasis> tab. On the list select the driver you
2711 want to delete and click on the <emphasis>Delete</emphasis>
2712 button. This will only work if there is not one single printer left
2713 which uses that particular driver. You need to "delete" all printers
2714 using this driver in the "Printers" folder first. You will need
2715 Administrator privileges to do this.
2719 Once you have successfully downloaded the CUPS PostScript driver to a
2720 client, you can easily switch all printers to this one by proceeding
2721 as described elsewhere in the "Samba HOWTO Collection": either change
2722 a driver for an existing printer by running the "Printer Properties"
2723 dialog, or use <command>rpcclient</command> with the
2724 <command>setdriver</command> sub-command.
2731 <title>What are the Benefits of using the "CUPS PostScript Driver for
2732 Windows NT/2k/XP" as compared to the Adobe Driver?</title>
2735 You are interested in a comparison between the CUPS and the Adobe
2736 PostScript drivers? For our purposes these are the most important
2737 items which weigh in favor of the CUPS ones:
2741 <listitem><para>no hassle with the Adobe EULA</para></listitem>
2743 <listitem><para>no hassle with the question <quote>Where do I
2744 get the ADOBE*.* driver files from?</quote></para></listitem>
2746 <listitem><para>the Adobe drivers (on request of the printer PPD
2747 associated with them) often put a PJL header in front of the main
2748 PostScript part of the print file. Thus the printfile starts with
2749 <parameter><1B >%-12345X</parameter> or
2750 <parameter><escape>%-12345X</parameter> instead
2751 of <parameter>%!PS</parameter>). This leads to the
2752 CUPS daemon auto-typing the incoming file as a print-ready file,
2753 not initiating a pass through the "pstops" filter (to speak more
2754 technically, it is not regarded as the generic MIME type
2755 <emphasis>application/postscript</emphasis>, but as
2756 the more special MIME type
2757 <emphasis>application/cups.vnd-postscript</emphasis>),
2758 which therefore also leads to the page accounting in
2759 <emphasis>/var/log/cups/page_log</emphasis> not
2760 receiving the exact number of pages; instead the dummy page number
2761 of "1" is logged in a standard setup)</para></listitem>
2763 <listitem><para>the Adobe driver has more options to "mis-configure" the
2764 PostScript generated by it (like setting it inadvertently to
2765 <emphasis>Optimize for Speed</emphasis>, instead of
2766 <emphasis>Optimize for Portability</emphasis>, which
2767 could lead to CUPS being unable to process it)</para></listitem>
2769 <listitem><para>the CUPS PostScript driver output sent by Windows
2770 clients to the CUPS server will be guaranteed to be auto-typed always
2771 as generic MIME type <emphasis>application/postscript</emphasis>,
2772 thusly passing through the CUPS "pstops" filter and logging the
2773 correct number of pages in the <filename>page_log</filename> for
2774 accounting and quota purposes</para></listitem>
2776 <listitem><para>the CUPS PostScript driver supports the sending of
2777 additional standard (IPP) print options by Win NT/2k/XP clients. Such
2778 additional print options are: naming the CUPS standard
2779 <emphasis>banner pages</emphasis> (or the custom ones, should they be
2780 installed at the time of driver download), using the CUPS
2781 <emphasis>page-label</emphasis> option, setting a
2782 <emphasis>job-priority</emphasis> and setting the <emphasis>scheduled
2783 time of printing</emphasis> (with the option to support additional
2784 useful IPP job attributes in the future).</para></listitem>
2786 <listitem><para>the CUPS PostScript driver supports the inclusion of
2787 the new <emphasis>*cupsJobTicket</emphasis> comments at the
2788 beginning of the PostScript file (which could be used in the future
2789 for all sort of beneficial extensions on the CUPS side, but which will
2790 not disturb any other applications as they will regard it as a comment
2791 and simply ignore it).</para></listitem>
2793 <listitem><para>the CUPS PostScript driver will be the heart of the
2794 fully fledged CUPS IPP client for Windows NT/2K/XP to be released soon
2795 (probably alongside the first Beta release for CUPS
2796 1.2).</para></listitem>
2802 <title>Run "cupsaddsmb" (quiet Mode)</title>
2805 The cupsaddsmb command copies the needed files into your
2806 <parameter>[print$]</parameter> share. Additionally, the PPD
2807 associated with this printer is copied from
2808 <filename>/etc/cups/ppd/</filename> to
2809 <parameter>[print$]</parameter>. There the files wait for convenient
2810 Windows client installations via Point'n'Print. Before we can run the
2811 command successfully, we need to be sure that we can authenticate
2812 towards Samba. If you have a small network you are probably using user
2813 level security (<parameter>security = user</parameter>). Probably your
2814 root has already a Samba account. Otherwise, create it now, using
2815 <command>smbpasswd</command>:
2821 New SMB password: [type in password 'secret']
2822 Retype new SMB password: [type in password 'secret']
2827 Here is an example of a successfully run cupsaddsmb command.
2832 # cupsaddsmb -U root infotec_IS2027
2833 Password for root required to access localhost via SAMBA: [type in password 'secret']
2838 To share <emphasis>all</emphasis> printers and drivers, use the
2839 <parameter>-a</parameter> parameter instead of a printer name. Since
2840 cupsaddsmb "exports" the printer drivers to Samba, it should be
2841 obvious that it only works for queues with a CUPS driver associated.
2846 <title>Run "cupsaddsmb" with verbose Output</title>
2849 Probably you want to see what's going on. Use the
2850 <parameter>-v</parameter> parameter to get a more verbose output. The
2851 output below was edited for better readability: all "\" at the end of
2852 a line indicate that I inserted an artificial line break plus some
2857 You will see the root password for the Samba account printed on
2858 screen. If you use remote access, the password will go over the wire
2864 # cupsaddsmb -U root -v infotec_2105
2865 Password for root required to access localhost via SAMBA:
2866 Running command: smbclient //localhost/print\$ -N -U'root%secret' -c 'mkdir W32X86;put \
2867 /var/spool/cups/tmp/3e98bf2d333b5 W32X86/infotec_2105.ppd;put \
2868 /usr/share/cups/drivers/cupsdrvr.dll W32X86/cupsdrvr.dll;put \
2869 /usr/share/cups/drivers/cupsui.dll W32X86/cupsui.dll;put \
2870 /usr/share/cups/drivers/cups.hlp W32X86/cups.hlp'
2871 added interface ip=10.160.51.60 bcast=10.160.51.255 nmask=255.255.252.0
2872 Domain=[CUPS-PRINT] OS=[Unix] Server=[Samba 2.2.7a]
2873 NT_STATUS_OBJECT_NAME_COLLISION making remote directory \W32X86
2874 putting file /var/spool/cups/tmp/3e98bf2d333b5 as \W32X86/infotec_2105.ppd (2328.8 kb/s) \
2875 (average 2328.8 kb/s)
2876 putting file /usr/share/cups/drivers/cupsdrvr.dll as \W32X86/cupsdrvr.dll (9374.3 kb/s) \
2877 (average 5206.6 kb/s)
2878 putting file /usr/share/cups/drivers/cupsui.dll as \W32X86/cupsui.dll (8107.2 kb/s) \
2879 (average 5984.1 kb/s)
2880 putting file /usr/share/cups/drivers/cups.hlp as \W32X86/cups.hlp (3475.0 kb/s) \
2881 (average 5884.7 kb/s)
2883 Running command: rpcclient localhost -N -U'root%secret' -c 'adddriver "Windows NT x86" \
2884 "infotec_2105:cupsdrvr.dll:infotec_2105.ppd:cupsui.dll:cups.hlp:NULL: \
2886 cmd = adddriver "Windows NT x86" "infotec_2105:cupsdrvr.dll:infotec_2105.ppd:cupsui.dll: \
2887 cups.hlp:NULL:RAW:NULL"
2888 Printer Driver infotec_2105 successfully installed.
2890 Running command: smbclient //localhost/print\$ -N -U'root%secret' -c 'mkdir WIN40;put \
2891 /var/spool/cups/tmp/3e98bf2d333b5 WIN40/infotec_2105.PPD; put \
2892 /usr/share/cups/drivers/ADFONTS.MFM WIN40/ADFONTS.MFM;put \
2893 /usr/share/cups/drivers/ADOBEPS4.DRV WIN40/ADOBEPS4.DRV;put \
2894 /usr/share/cups/drivers/ADOBEPS4.HLP WIN40/ADOBEPS4.HLP;put \
2895 /usr/share/cups/drivers/DEFPRTR2.PPD WIN40/DEFPRTR2.PPD;put \
2896 /usr/share/cups/drivers/ICONLIB.DLL
2897 WIN40/ICONLIB.DLL;put /usr/share/cups/drivers/PSMON.DLL WIN40/PSMON.DLL;'
2898 added interface ip=10.160.51.60 bcast=10.160.51.255 nmask=255.255.252.0
2899 Domain=[CUPS-PRINT] OS=[Unix] Server=[Samba 2.2.7a]
2900 NT_STATUS_OBJECT_NAME_COLLISION making remote directory \WIN40
2901 putting file /var/spool/cups/tmp/3e98bf2d333b5 as \WIN40/infotec_2105.PPD (2328.8 kb/s) \
2902 (average 2328.8 kb/s)
2903 putting file /usr/share/cups/drivers/ADFONTS.MFM as \WIN40/ADFONTS.MFM (9368.0 kb/s) \
2904 (average 6469.6 kb/s)
2905 putting file /usr/share/cups/drivers/ADOBEPS4.DRV as \WIN40/ADOBEPS4.DRV (9958.2 kb/s) \
2906 (average 8404.3 kb/s)
2907 putting file /usr/share/cups/drivers/ADOBEPS4.HLP as \WIN40/ADOBEPS4.HLP (8341.5 kb/s) \
2908 (average 8398.6 kb/s)
2909 putting file /usr/share/cups/drivers/DEFPRTR2.PPD as \WIN40/DEFPRTR2.PPD (2195.9 kb/s) \
2910 (average 8254.3 kb/s)
2911 putting file /usr/share/cups/drivers/ICONLIB.DLL as \WIN40/ICONLIB.DLL (8239.9 kb/s) \
2912 (average 8253.6 kb/s)
2913 putting file /usr/share/cups/drivers/PSMON.DLL as \WIN40/PSMON.DLL (6222.2 kb/s) \
2914 (average 8188.5 kb/s)
2916 Running command: rpcclient localhost -N -U'root%secret' -c 'adddriver "Windows 4.0" \
2917 "infotec_2105:ADOBEPS4.DRV:infotec_2105.PPD:NULL:ADOBEPS4.HLP: \
2918 PSMON.DLL:RAW:ADOBEPS4.DRV,infotec_2105.PPD,ADOBEPS4.HLP,PSMON.DLL, \
2919 ADFONTS.MFM,DEFPRTR2.PPD,ICONLIB.DLL"'
2920 cmd = adddriver "Windows 4.0" "infotec_2105:ADOBEPS4.DRV:infotec_2105.PPD:NULL: \
2921 ADOBEPS4.HLP:PSMON.DLL:RAW:ADOBEPS4.DRV,infotec_2105.PPD,ADOBEPS4.HLP, \
2922 PSMON.DLL,ADFONTS.MFM,DEFPRTR2.PPD,ICONLIB.DLL"
2923 Printer Driver infotec_2105 successfully installed.
2925 Running command: rpcclient localhost -N -U'root%secret' \
2926 -c 'setdriver infotec_2105 infotec_2105'
2927 cmd = setdriver infotec_2105 infotec_2105
2928 Successfully set infotec_2105 to driver infotec_2105.
2933 If you look closely, you'll discover your root password was transfered
2934 unencrypted over the wire, so beware! Also, if you look further her,
2935 you'll discover error messages like NT_STATUS_OBJECT_NAME_COLLISION in
2936 between. They occur, because the directories WIN40 and W32X86 already
2937 existed in the <parameter>[print$]</parameter> driver download share
2938 (from a previous driver installation). They are harmless here.
2943 <title>Understanding cupsaddsmb</title>
2946 What has happened? What did cupsaddsmb do? There are five stages of
2952 <listitem><para>call the CUPS server via IPP and request the
2953 driver files and the PPD file for the named printer;</para></listitem>
2955 <listitem><para>store the files temporarily in the local
2956 TEMPDIR (as defined in
2957 <filename>cupsd.conf</filename>);</para></listitem>
2959 <listitem><para>connect via smbclient to the Samba server's
2960 <parameter>[print$]</parameter> share and put the files into the
2961 share's WIN40 (for Win95/98/ME) and W32X86/ (for WinNT/2k/XP) sub
2962 directories;</para></listitem>
2964 <listitem><para>connect via rpcclient to the Samba server and
2965 execute the "adddriver" command with the correct
2966 parameters;</para></listitem>
2968 <listitem><para>connect via rpcclient to the Samba server a second
2969 time and execute the "setdriver" command.</para></listitem>
2973 Note, that you can run the cupsaddsmb utility with parameters to
2974 specify one remote host as Samba host and a second remote host as CUPS
2975 host. Especially if you want to get a deeper understanding, it is a
2976 good idea try it and see more clearly what is going on (though in real
2977 life most people will have their CUPS and Samba servers run on the
2983 # cupsaddsmb -H sambaserver -h cupsserver -v printername
2989 <title>How to recognize if cupsaddsm completed successfully</title>
2992 You <emphasis>must</emphasis> always check if the utility completed
2993 successfully in all fields. You need as a minimum these 3 messages
2999 <listitem><para><emphasis>Printer Driver infotec_2105 successfully
3000 installed.</emphasis> # (for the W32X86 == WinNT/2K/XP
3001 architecture...)</para></listitem>
3003 <listitem><para><emphasis>Printer Driver infotec_2105 successfully
3004 installed.</emphasis> # (for the WIN40 == Win9x/ME
3005 architecture...)</para></listitem>
3007 <listitem><para><emphasis>Successfully set [printerXPZ] to driver
3008 [printerXYZ].</emphasis></para></listitem>
3012 These messages probably not easily recognized in the general
3013 output. If you run cupsaddsmb with the <parameter>-a</parameter>
3014 parameter (which tries to prepare <emphasis>all</emphasis> active CUPS
3015 printer drivers for download), you might miss if individual printers
3016 drivers had problems to install properly. Here a redirection of the
3017 output will help you analyze the results in retrospective.
3021 It is impossible to see any diagnostic output if you don't run
3022 cupsaddsmb in verbose mode. Therefore we strongly recommend to not
3023 use the default quiet mode. It will hide any problems from you which
3029 <title>cupsaddsmb with a Samba PDC</title>
3032 You can't get the standard cupsaddsmb command to run on a Samba PDC?
3033 You are asked for the password credential all over again and again and
3034 the command just will not take off at all? Try one of these
3040 # cupsaddsmb -U DOMAINNAME\\root -v printername
3041 # cupsaddsmb -H SAMBA-PDC -U DOMAINNAME\\root -v printername
3042 # cupsaddsmb -H SAMBA-PDC -U DOMAINNAME\\root -h cups-server -v printername
3047 (Note the two backslashes: the first one is required to
3048 "escape" the second one).
3053 <title>cupsaddsmb Flowchart</title>
3056 Here is a chart about the procedures, commandflows and
3057 dataflows of the "cupaddsmb" command. Note again: cupsaddsmb is
3058 not intended to, and does not work with, "raw" queues!
3062 <figure><title>cupsaddsmb flowchart</title>
3064 <imageobject role="latex"><imagedata fileref="projdoc/imagefiles/1small"/></imageobject>
3065 <imageobject><imagedata fileref="projdoc/imagefiles/1small.png"/></imageobject>
3072 <title>Installing the PostScript Driver on a Client</title>
3075 After cupsaddsmb completed, your driver is prepared for the clients to
3076 use. Here are the steps you must perform to download and install it
3077 via "Point'n'Print". From a Windows client, browse to the CUPS/Samba
3083 <listitem><para>open the <emphasis>Printers</emphasis>
3084 share of Samba in Network Neighbourhood;</para></listitem>
3086 <listitem><para>right-click on the printer in
3087 question;</para></listitem>
3089 <listitem><para>from the opening context-menu select
3090 <emphasis>Install...</emphasis> or
3091 <emphasis>Connect...</emphasis> (depending on the Windows version you
3092 use).</para></listitem>
3096 After a few seconds, there should be a new printer in your
3097 client's <emphasis>local</emphasis> "Printers" folder: On Windows
3098 XP it will follow a naming convention of <emphasis>PrinterName on
3099 SambaServer</emphasis>. (In my current case it is "infotec_2105 on
3100 kde-bitshop"). If you want to test it and send your first job from
3101 an application like Winword, the new printer will appears in a
3102 <filename>\\SambaServer\PrinterName</filename> entry in the
3103 dropdown list of available printers.
3107 cupsaddsmb will only reliably work with CUPS version 1.1.15 or higher
3108 and Samba from 2.2.4. If it doesn't work, or if the automatic printer
3109 driver download to the clients doesn't succeed, you can still manually
3110 install the CUPS printer PPD on top of the Adobe PostScript driver on
3111 clients. Then point the client's printer queue to the Samba printer
3112 share for a UNC type of connection:
3117 net use lpt1: \\sambaserver\printershare /user:ntadmin
3122 should you desire to use the CUPS networked PostScript RIP
3123 functions. (Note that user "ntadmin" needs to be a valid Samba user
3124 with the required privileges to access the printershare) This would
3125 set up the printer connection in the traditional
3126 <emphasis>LanMan</emphasis> way (not using MS-RPC).
3131 <title>Avoiding critical PostScript Driver Settings on the
3135 Soooo: printing works, but there are still problems. Most jobs print
3136 well, some don't print at all. Some jobs have problems with fonts,
3137 which don't look very good. Some jobs print fast, and some are
3138 dead-slow. Many of these problems can be greatly reduced or even
3139 completely eliminated if you follow a few guidelines. Remember, if
3140 your print device is not PostScript-enabled, you are treating your
3141 Ghostscript installation on your CUPS host with the output your client
3142 driver settings produce. Treat it well:
3146 <listitem><para>Avoid the <emphasis>PostScript Output Option: Optimize
3147 for Speed</emphasis> setting. Rather use the <emphasis>Optimize for
3148 Portability</emphasis> instead (Adobe PostScript
3149 driver).</para></listitem>
3151 <listitem><para>Don't use the <emphasis>Page Independence:
3152 NO</emphasis> setting. Instead use <emphasis>Page Independence
3153 YES</emphasis> (CUPS PostScript Driver)</para></listitem>
3155 <listitem><para>Recommended is the <emphasis>True Type Font
3156 Downloading Option: Native True Type</emphasis> over
3157 <emphasis>Automatic</emphasis> and <emphasis>Outline</emphasis>; you
3158 should by all means avoid <emphasis>Bitmap</emphasis> (Adobe
3159 PostScript Driver)</para></listitem>
3161 <listitem><para>Choose <emphasis>True Type Font: Download as Softfont
3162 into Printer</emphasis> over the default <emphasis>Replace by Device
3163 Font</emphasis> (for exotic fonts you may need to change it back to
3164 get a printout at all) (Adobe)</para></listitem>
3166 <listitem><para>Sometimes you can choose <emphasis>PostScript Language
3167 Level</emphasis>: in case of problems try <emphasis>2</emphasis>
3168 instead of <emphasis>3</emphasis> (the latest ESP Ghostscript package
3169 handles Level 3 PostScript very well) (Adobe).</para></listitem>
3171 <listitem><para>Say <emphasis>Yes</emphasis> to <emphasis>PostScript
3172 Error Handler</emphasis> (Adobe)</para></listitem>
3178 <title>Installing PostScript Driver Files manually (using
3182 Of course you can run all the commands which are embedded into the
3183 cupsaddsmb convenience utility yourself, one by one, and hereby upload
3184 and prepare the driver files for future client downloads.
3188 <listitem><para>prepare Samba (a CUPS printqueue with the name of the
3189 printer should be there. We are providing the driver
3190 now);</para></listitem>
3192 <listitem><para>copy all files to
3193 <parameter>[print$]:</parameter></para></listitem>
3195 <listitem><para>run <command>rpcclient adddriver</command>
3196 (for each client architecture you want to support):</para></listitem>
3198 <listitem><para>run <command>rpcclient
3199 setdriver.</command></para></listitem>
3203 We are going to do this now. First, read the man page on "rpcclient"
3204 to get a first idea. Look at all the printing related
3205 sub-commands. <command>enumprinters</command>,
3206 <command>enumdrivers</command>, <command>enumports</command>,
3207 <command>adddriver</command>, <command>setdriver</command> are amongst
3208 the most interesting ones. rpcclient implements an important part of
3209 the MS-RPC protocol. You can use it to query (and command) a Win NT
3210 (or 2K/XP) PC too. MS-RPC is used by Windows clients, amongst other
3211 things, to benefit from the "Point'n'Print" features. Samba can now
3216 <title>A Check of the rpcclient man Page</title>
3219 First let's have a little check of the rpcclient man page. Here are
3220 two relevant passages:
3224 <command>adddriver <arch> <config></command> Execute an
3225 AddPrinterDriver() RPC to install the printer driver information on
3226 the server. Note that the driver files should already exist in the
3227 directory returned by <command>getdriverdir</command>. Possible
3228 values for <parameter>arch</parameter> are the same as those for the
3229 <command>getdriverdir</command> command. The
3230 <parameter>config</parameter> parameter is defined as follows:
3239 Language Monitor Name:\
3241 Comma Separated list of Files
3244 <para>Any empty fields should be enter as the string "NULL". </para>
3246 <para>Samba does not need to support the concept of Print Monitors
3247 since these only apply to local printers whose driver can make use of
3248 a bi-directional link for communication. This field should be "NULL".
3249 On a remote NT print server, the Print Monitor for a driver must
3250 already be installed prior to adding the driver or else the RPC will
3255 <command>setdriver <printername> <drivername></command>
3256 Execute a <command>SetPrinter()</command> command to update the
3257 printer driver associated with an installed printer. The printer
3258 driver must already be correctly installed on the print server.
3261 <para> See also the enumprinters and enumdrivers commands for
3262 obtaining a list of installed printers and drivers.
3268 <title>Understanding the rpcclient man Page</title>
3271 The <emphasis>exact</emphasis> format isn't made too clear by the man
3272 page, since you have to deal with some parameters containing
3273 spaces. Here is a better description for it. We have line-broken the
3274 command and indicated the breaks with "\". Usually you would type the
3275 command in one line without the linebreaks:
3280 adddriver "Architecture" \
3281 "LongPrinterName:DriverFile:DataFile:ConfigFile:HelpFile:\
3282 LanguageMonitorFile:DataType:ListOfFiles,Comma-separated"
3287 What the man pages denotes as a simple <config>
3288 keyword, does in reality consist of 8 colon-separated fields. The
3289 last field may take multiple (in some, very insane, cases, even
3290 20 different additional files. This might sound confusing at first.
3291 Note, that what the man pages names the "LongPrinterName" in
3292 reality should rather be called the "Driver Name". You can name it
3293 anything you want, as long as you use this name later in the
3294 <emphasis>rpcclient ... setdriver</emphasis> command. For
3295 practical reasons, many name the driver the same as the
3300 True: it isn't simple at all. I hear you asking:
3301 <emphasis>How do I know which files are "Driver
3302 File", "Data File", "Config File", "Help File" and "Language
3303 Monitor File" in each case?</emphasis> -- For an answer you may
3304 want to have a look at how a Windows NT box with a shared printer
3305 presents the files to us. Remember, that this whole procedure has
3306 to be developed by the Samba Team by overhearing the traffic caused
3307 by Windows computers on the wire. We may as well turn to a Windows
3308 box now, and access it from a UNIX workstation. We will query it
3309 with <command>rpcclient</command> to see what it tells us and
3310 try to understand the man page more clearly which we've read just
3316 <title>Producing an Example by querying a Windows Box</title>
3319 We could run <command>rpcclient</command> with a
3320 <command>getdriver</command> or a <command>getprinter</command>
3321 subcommand (in level 3 verbosity) against it. Just sit down at UNIX or
3322 Linux workstation with the Samba utilities installed. Then type the
3328 rpcclient -U'USERNAME%PASSWORD' NT-SERVER-NAME -c 'getdriver printername 3'
3333 From the result it should become clear which is which. Here is an
3334 example from my installation:
3339 # rpcclient -U'Danka%xxxx' W2KSERVER -c'getdriver "DANKA InfoStream Virtual Printer" 3'
3340 cmd = getdriver "DANKA InfoStream Virtual Printer" 3
3343 Printer Driver Info 3:
3345 Driver Name: [DANKA InfoStream]
3346 Architecture: [Windows NT x86]
3347 Driver Path: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\PSCRIPT.DLL]
3348 Datafile: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\INFOSTRM.PPD]
3349 Configfile: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\PSCRPTUI.DLL]
3350 Helpfile: [C:\WINNT\System32\spool\DRIVERS\W32X86\2\PSCRIPT.HLP]
3366 Some printer drivers list additional files under the label
3367 "Dependentfiles": these would go into the last field
3368 <emphasis>ListOfFiles,Comma-separated</emphasis>. For the CUPS
3369 PostScript drivers we don't need any (nor would we for the Adobe
3370 PostScript driver): therefore the field will get a "NULL" entry.
3375 <title>What is required for adddriver and setdriver to succeed</title>
3378 From the manpage (and from the quoted output
3379 of <emphasis>cupsaddsmb</emphasis>, above) it becomes clear that you
3380 need to have certain conditions in order to make the manual uploading
3381 and initializing of the driver files succeed. The two rpcclient
3382 subcommands (<command>adddriver</command> and
3383 <command>setdriver</command>) need to encounter the following
3384 pre-conditions to complete successfully:
3388 <listitem><para>you are connected as "printer admin", or root (note,
3389 that this is <emphasis>not</emphasis> the "Printer Operators" group in
3390 NT, but the <emphasis>printer admin</emphasis> group, as defined in
3391 the <parameter>[global]</parameter> section of
3392 <filename>smb.conf</filename>);</para></listitem>
3394 <listitem><para>copy all required driver files to
3395 <filename>\\sambaserver\print$\w32x86</filename> and
3396 <filename>\\sambaserver\print$\win40</filename> as appropriate. They
3397 will end up in the "0" respective "2" subdirectories later -- for now
3398 <emphasis>don't</emphasis> put them there, they'll be automatically
3399 used by the <command>adddriver</command> subcommand.! (if you use
3400 "smbclient" to put the driver files into the share, note that you need
3401 to escape the "$": <command>smbclient //sambaserver/print\$ -U
3402 root</command>);</para></listitem>
3404 <listitem><para>the user you're connecting as must be able to write to
3405 the <parameter>[print$]</parameter> share and create
3406 subdirectories;</para></listitem>
3408 <listitem><para>the printer you are going to setup for the Windows
3409 clients, needs to be installed in CUPS already;</para></listitem>
3411 <listitem><para>the CUPS printer must be known to Samba, otherwise the
3412 <command>setdriver</command> subcommand fails with an
3413 NT_STATUS_UNSUCCESSFUL error. To check if the printer is known by
3414 Samba you may use the <command>enumprinters</command> subcommand to
3415 rpcclient. A long-standing bug prevented a proper update of the
3416 printer list until every smbd process had received a SIGHUP or was
3417 restarted. Remember this in case you've created the CUPS printer just
3418 shortly ago and encounter problems: try restarting
3419 Samba.</para></listitem>
3424 <title>Manual Commandline Driver Installation in 15 little Steps</title>
3427 We are going to install a printer driver now by manually executing all
3428 required commands. As this may seem a rather complicated process at
3429 first, we go through the procedure step by step, explaining every
3430 single action item as it comes up.
3434 <title>First Step: Install the Printer on CUPS</title>
3438 # lpadmin -p mysmbtstprn -v socket://10.160.51.131:9100 -E -P /home/kurt/canonIR85.ppd
3443 This installs printer with the name <emphasis>mysmbtstprn</emphasis>
3444 to the CUPS system. The printer is accessed via a socket
3445 (a.k.a. JetDirect or Direct TCP/IP) connection. You need to be root
3451 <title>Second Step (optional): Check if the Printer is recognized by
3456 # rpcclient -Uroot%xxxx -c 'enumprinters' localhost | grep -C2 mysmbtstprn
3459 name:[\\kde-bitshop\mysmbtstprn]
3460 description:[\\kde-bitshop\mysmbtstprn,,mysmbtstprn]
3461 comment:[mysmbtstprn]
3466 This should show the printer in the list. If not, stop and re-start
3467 the Samba daemon (smbd), or send a HUP signal: <command>kill -HUP
3468 `pidof smbd`</command>. Check again. Troubleshoot and repeat until
3469 success. Note the "empty" field between the two commas in the
3470 "description" line. Here would the driver name appear if there was one
3471 already. You need to know root's Samba password (as set by the
3472 <command>smbpasswd</command> command) for this step and most of the
3473 following steps. Alternatively you can authenticate as one of the
3474 users from the "write list" as defined in <filename>smb.conf</filename> for
3475 <parameter>[print$]</parameter>.
3480 <title>Third Step (optional): Check if Samba knows a Driver for the
3485 # rpcclient -Uroot%xxxx -c 'getprinter mysmbtstprn 2' localhost | grep driver
3488 # rpcclient -Uroot%xxxx -c 'getprinter mysmbtstprn 2' localhost | grep -C4 driv
3489 servername:[\\kde-bitshop]
3490 printername:[\\kde-bitshop\mysmbtstprn]
3491 sharename:[mysmbtstprn]
3492 portname:[Samba Printer Port]
3494 comment:[mysmbtstprn]
3497 printprocessor:[winprint]
3499 # rpcclient -U root%xxxx -c 'getdriver mysmbtstprn' localhost
3500 result was WERR_UNKNOWN_PRINTER_DRIVER
3505 Neither method of the three commands shown above should show a driver.
3506 This step was done for the purpose of demonstrating this condition. An
3507 attempt to connect to the printer at this stage will prompt the
3508 message along the lines: "The server has not the required printer
3514 <title>Fourth Step: Put all required Driver Files into Samba's
3519 # smbclient //localhost/print\$ -U 'root%xxxx' \
3521 put /etc/cups/ppd/mysmbtstprn.ppd mysmbtstprn.PPD; \
3522 put /usr/share/cups/drivers/cupsui.dll cupsui.dll; \
3523 put /usr/share/cups/drivers/cupsdrvr.dll cupsdrvr.dll; \
3524 put /usr/share/cups/drivers/cups.hlp cups.hlp'
3529 (Note that this command should be entered in one long single
3530 line. Line-breaks and the line-end indicating "\" has been inserted
3531 for readability reasons.) This step is <emphasis>required</emphasis>
3532 for the next one to succeed. It makes the driver files physically
3533 present in the <parameter>[print$]</parameter> share. However, clients
3534 would still not be able to install them, because Samba does not yet
3535 treat them as driver files. A client asking for the driver would still
3536 be presented with a "not installed here" message.
3541 <title>Fifth Step: Verify where the Driver Files are now</title>
3545 # ls -l /etc/samba/drivers/W32X86/
3547 drwxr-sr-x 2 root ntadmin 532 May 25 23:08 2
3548 drwxr-sr-x 2 root ntadmin 670 May 16 03:15 3
3549 -rwxr--r-- 1 root ntadmin 14234 May 25 23:21 cups.hlp
3550 -rwxr--r-- 1 root ntadmin 278380 May 25 23:21 cupsdrvr.dll
3551 -rwxr--r-- 1 root ntadmin 215848 May 25 23:21 cupsui.dll
3552 -rwxr--r-- 1 root ntadmin 169458 May 25 23:21 mysmbtstprn.PPD
3557 The driver files now are in the W32X86 architecture "root" of
3558 <parameter>[print$]</parameter>.
3563 <title>Sixth Step: Tell Samba that these are
3564 <emphasis>Driver</emphasis> Files
3565 (<command>adddriver</command>)</title>
3569 # rpcclient -Uroot%xxxx -c `adddriver "Windows NT x86" "mydrivername: \
3570 cupsdrvr.dll:mysmbtstprn.PPD: \
3571 cupsui.dll:cups.hlp:NULL:RAW<citation>:</citation>NULL" \
3574 Printer Driver mydrivername successfully installed.
3579 Note that your cannot repeat this step if it fails. It could fail even
3580 as a result of a simple typo. It will most likely have moved a part of
3581 the driver files into the "2" subdirectory. If this step fails, you
3582 need to go back to the fourth step and repeat it, before you can try
3583 this one again. In this step you need to choose a name for your
3584 driver. It is normally a good idea to use the same name as is used for
3585 the printername; however, in big installations you may use this driver
3586 for a number of printers which have obviously different names. So the
3587 name of the driver is not fixed.
3592 <title>Seventh Step: Verify where the Driver Files are now</title>
3596 # ls -l /etc/samba/drivers/W32X86/
3598 drwxr-sr-x 2 root ntadmin 532 May 25 23:22 2
3599 drwxr-sr-x 2 root ntadmin 670 May 16 03:15 3
3602 # ls -l /etc/samba/drivers/W32X86/2
3605 -rwxr--r-- 1 root ntadmin 14234 May 25 23:21 cups.hlp
3606 -rwxr--r-- 1 root ntadmin 278380 May 13 13:53 cupsdrvr.dll
3607 -rwxr--r-- 1 root ntadmin 215848 May 13 13:53 cupsui.dll
3608 -rwxr--r-- 1 root ntadmin 169458 May 25 23:21 mysmbtstprn.PPD
3613 Notice how step 6 did also move the driver files to the appropriate
3614 subdirectory. Compare with the situation after step 5.
3619 <title>Eighth Step (optional): Verify if Samba now recognizes the
3624 # rpcclient -Uroot%xxxx -c 'enumdrivers 3' localhost | grep -B2 -A5 mydrivername
3626 Printer Driver Info 3:
3628 Driver Name: [mydrivername]
3629 Architecture: [Windows NT x86]
3630 Driver Path: [\\kde-bitshop\print$\W32X86\2\cupsdrvr.dll]
3631 Datafile: [\\kde-bitshop\print$\W32X86\2\mysmbtstprn.PPD]
3632 Configfile: [\\kde-bitshop\print$\W32X86\2\cupsui.dll]
3633 Helpfile: [\\kde-bitshop\print$\W32X86\2\cups.hlp]
3638 Remember, this command greps for the name you did choose for the
3639 driver in step Six. This command must succeed before you can proceed.
3644 <title>Ninth Step: Tell Samba which Printer should use these Driver
3645 Files (<command>setdriver</command>)</title>
3649 # rpcclient -Uroot%xxxx -c 'setdriver mysmbtstprn mydrivername' localhost
3651 Successfully set mysmbtstprn to driver mydrivername
3656 Since you can bind any printername (=printqueue) to any driver, this
3657 is a very convenient way to setup many queues which use the same
3658 driver. You don't need to repeat all the previous steps for the
3659 setdriver command to succeed. The only pre-conditions are:
3660 <command>enumdrivers</command> must find the driver and
3661 <command>enumprinters</command> must find the printer.
3666 <title>Tenth Step (optional): Verify if Samba has this Association
3671 # rpcclient -Uroot%xxxx -c 'getprinter mysmbtstprn 2' localhost | grep driver
3672 drivername:[mydrivername]
3674 # rpcclient -Uroot%xxxx -c 'getprinter mysmbtstprn 2' localhost | grep -C4 driv
3675 servername:[\\kde-bitshop]
3676 printername:[\\kde-bitshop\mysmbtstprn]
3677 sharename:[mysmbtstprn]
3679 drivername:[mydrivername]
3680 comment:[mysmbtstprn]
3683 printprocessor:[winprint]
3685 # rpcclient -U root%xxxx -c 'getdriver mysmbtstprn' localhost
3687 Printer Driver Info 3:
3689 Driver Name: [mydrivername]
3690 Architecture: [Windows NT x86]
3691 Driver Path: [\\kde-bitshop\print$\W32X86\2\cupsdrvr.dll]
3692 Datafile: [\\kde-bitshop\print$\W32X86\2\mysmbtstprn.PPD]
3693 Configfile: [\\kde-bitshop\print$\W32X86\2\cupsui.dll]
3694 Helpfile: [\\kde-bitshop\print$\W32X86\2\cups.hlp]
3696 Defaultdatatype: [RAW]
3698 Defaultdatatype: [RAW]
3700 # rpcclient -Uroot%xxxx -c 'enumprinters' localhost | grep mysmbtstprn
3701 name:[\\kde-bitshop\mysmbtstprn]
3702 description:[\\kde-bitshop\mysmbtstprn,mydrivername,mysmbtstprn]
3703 comment:[mysmbtstprn]
3708 Compare these results with the ones from steps 2 and 3. Note that
3709 every single of these commands show the driver is installed. Even
3710 the <command>enumprinters</command> command now lists the driver
3711 on the "description" line.
3716 <title>Eleventh Step (optional): Tickle the Driver into a correct
3720 You certainly know how to install the driver on the client. In case
3721 you are not particularly familiar with Windows, here is a short
3722 recipe: browse the Network Neighbourhood, go to the Samba server, look
3723 for the shares. You should see all shared Samba printers.
3724 Double-click on the one in question. The driver should get
3725 installed, and the network connection set up. An alternative way is to
3726 open the "Printers (and Faxes)" folder, right-click on the printer in
3727 question and select "Connect" or "Install". As a result, a new printer
3728 should have appeared in your client's local "Printers (and Faxes)"
3729 folder, named something like "printersharename on Sambahostname".
3733 It is important that you execute this step as a Samba printer admin
3734 (as defined in <filename>smb.conf</filename>). Here is another method
3735 to do this on Windows XP. It uses a commandline, which you may type
3736 into the "DOS box" (type root's smbpassword when prompted):
3741 C:\> runas /netonly /user:root "rundll32 printui.dll,PrintUIEntry /in /n \\sambacupsserver\mysmbtstprn"
3746 Change any printer setting once (like <emphasis>"portrait"
3747 --> "landscape"</emphasis>), click "Apply"; change the setting
3753 <title>Twelfth Step: Install the Printer on a Client
3754 ("Point'n'Print")</title>
3758 C:\> rundll32 printui.dll,PrintUIEntry /in /n "\\sambacupsserver\mysmbtstprn"
3763 If it doesn't work it could be a permission problem with the
3764 <parameter>[print$]</parameter> share.
3769 <title>Thirteenth Step (optional): Print a Test Page</title>
3773 C:\> rundll32 printui.dll,PrintUIEntry /p /n "\\sambacupsserver\mysmbtstprn"
3778 Then hit [TAB] 5 times, [ENTER] twice, [TAB] once and [ENTER] again
3779 and march to the printer.
3784 <title>Fourteenth Step (recommended): Study the Test Page</title>
3787 Hmmm.... just kidding! By now you know everything about printer
3788 installations and you don't need to read a word. Just put it in a
3789 frame and bolt it to the wall with the heading "MY FIRST
3790 RPCCLIENT-INSTALLED PRINTER" - why not just throw it away!
3795 <title>Fifteenth Step (obligatory): Enjoy. Jump. Celebrate your
3800 # echo "Cheeeeerioooooo! Success..." >> /var/log/samba/log.smbd
3807 <title>Troubleshooting revisited</title>
3810 The setdriver command will fail, if in Samba's mind the queue is not
3811 already there. You had promising messages about the:
3816 Printer Driver ABC successfully installed.
3821 after the "adddriver" parts of the procedure? But you are also seeing
3822 a disappointing message like this one beneath?
3827 result was NT_STATUS_UNSUCCESSFUL
3832 It is not good enough that <emphasis>you</emphasis>
3833 can see the queue <emphasis>in CUPS</emphasis>, using
3834 the <command>lpstat -p ir85wm</command> command. A
3835 bug in most recent versions of Samba prevents the proper update of
3836 the queuelist. The recognition of newly installed CUPS printers
3837 fails unless you re-start Samba or send a HUP to all smbd
3838 processes. To verify if this is the reason why Samba doesn't
3839 execute the setdriver command successfully, check if Samba "sees"
3845 # rpcclient transmeta -N -U'root%secret' -c 'enumprinters 0'| grep ir85wm
3846 printername:[ir85wm]
3851 An alternative command could be this:
3856 # rpcclient transmeta -N -U'root%secret' -c 'getprinter ir85wm'
3857 cmd = getprinter ir85wm
3859 name:[\\transmeta\ir85wm]
3860 description:[\\transmeta\ir85wm,ir85wm,DPD]
3861 comment:[CUPS PostScript-Treiber for WinNT/2K/XP]
3866 BTW, you can use these commands, plus a few more, of course,
3867 to install drivers on remote Windows NT print servers too!
3873 <title>The printing <filename>*.tdb</filename> Files</title>
3876 Some mystery is associated with the series of files with a
3877 tdb-suffix appearing in every Samba installation. They are
3878 <filename>connections.tdb</filename>,
3879 <filename>printing.tdb</filename>,
3880 <filename>share_info.tdb</filename> ,
3881 <filename>ntdrivers.tdb</filename>,
3882 <filename>unexpected.tdb</filename>,
3883 <filename>brlock.tdb</filename> ,
3884 <filename>locking.tdb</filename>,
3885 <filename>ntforms.tdb</filename>,
3886 <filename>messages.tdb</filename> ,
3887 <filename>ntprinters.tdb</filename>,
3888 <filename>sessionid.tdb</filename> and
3889 <filename>secrets.tdb</filename>. What is their purpose?
3893 <title>Trivial DataBase Files</title>
3896 A Windows NT (Print) Server keeps track of all information needed to serve
3897 its duty toward its clients by storing entries in the Windows
3898 "Registry". Client queries are answered by reading from the registry,
3899 Administrator or user configuration settings are saved by writing into
3900 the Registry. Samba and Unix obviously don't have such a kind of
3901 Registry. Samba instead keeps track of all client related information in a
3902 series of <filename>*.tdb</filename> files. (TDB = Trivial Data
3903 Base). These are often located in <filename>/var/lib/samba/</filename>
3904 or <filename>/var/lock/samba/</filename> . The printing related files
3905 are <filename>ntprinters.tdb</filename>,
3906 <filename>printing.tdb</filename>,<filename>ntforms.tdb</filename> and
3907 <filename>ntdrivers.tdb</filename>.
3912 <title>Binary Format</title>
3915 <filename>*.tdb</filename> files are not human readable. They are
3916 written in a binary format. "Why not ASCII?", you may ask. "After all,
3917 ASCII configuration files are a good and proofed tradition on UNIX."
3918 -- The reason for this design decision by the Samba Team is mainly
3919 performance. Samba needs to be fast; it runs a separate
3920 <command>smbd</command> process for each client connection, in some
3921 environments many thousand of them. Some of these smbds might need to
3922 write-access the same <filename>*.tdb</filename> file <emphasis>at the
3923 same time</emphasis>. The file format of Samba's
3924 <filename>*.tdb</filename> files allows for this provision. Many smbd
3925 processes may write to the same <filename>*.tdb</filename> file at the
3926 same time. This wouldn't be possible with pure ASCII files.
3931 <title>Losing <filename>*.tdb</filename> Files</title>
3934 It is very important that all <filename>*.tdb</filename> files remain
3935 consistent over all write and read accesses. However, it may happen
3936 that these files <emphasis>do</emphasis> get corrupted. (A
3937 <command>kill -9 `pidof smbd`</command> while a write access is in
3938 progress could do the damage as well as a power interruption,
3939 etc.). In cases of trouble, a deletion of the old printing-related
3940 <filename>*.tdb</filename> files may be the only option. You need to
3941 re-create all print related setup after that. Or you have made a
3942 backup of the <filename>*.tdb</filename> files in time.
3947 <title>Using <emphasis>tdbbackup</emphasis></title>
3950 Samba ships with a little utility which helps the root user of your
3951 system to back up your <filename>*.tdb</filename> files. If you run it
3952 with no argument, it prints a little usage message:
3958 Usage: tdbbackup [options] <fname...>
3961 -h this help message
3962 -s suffix set the backup suffix
3963 -v verify mode (restore if corrupt)
3968 Here is how I backed up my printing.tdb file:
3974 . browse.dat locking.tdb ntdrivers.tdb printing.tdb share_info.tdb
3975 .. connections.tdb messages.tdb ntforms.tdb printing.tdbkp unexpected.tdb
3976 brlock.tdb gmon.out namelist.debug ntprinters.tdb sessionid.tdb
3978 kde-bitshop:/var/lock/samba # tdbbackup -s .bak printing.tdb
3979 printing.tdb : 135 records
3981 kde-bitshop:/var/lock/samba # ls -l printing.tdb*
3982 -rw------- 1 root root 40960 May 2 03:44 printing.tdb
3983 -rw------- 1 root root 40960 May 2 03:44 printing.tdb.bak
3990 <title>CUPS Print Drivers from Linuxprinting.org</title>
3993 CUPS ships with good support for HP LaserJet type printers. You can
3994 install the generic driver as follows:
3999 lpadmin -p laserjet4plus -v parallel:/dev/lp0 -E -m laserjet.ppd
4004 The <parameter>-m</parameter> switch will retrieve the
4005 <filename>laserjet.ppd</filename> from the standard repository for
4006 not-yet-installed-PPDs, which CUPS typically stores in
4007 <filename>/usr/share/cups/model</filename>. Alternatively, you may use
4008 <parameter>-P /path/to/your.ppd</parameter>.
4012 The generic laserjet.ppd however does not support every special option
4013 for every LaserJet-compatible model. It constitutes a sort of "least
4014 denominator" of all the models. If for some reason it is ruled out to
4015 you to pay for the commercially available ESP Print Pro drivers, your
4016 first move should be to consult the database on <ulink
4017 url="http://www.linuxprinting.org/printer_list.cgi">http://www.linuxprinting.org/printer_list.cgi</ulink>.
4018 Linuxprinting.org has excellent recommendations about which driver is
4019 best used for each printer. Its database is kept current by the
4020 tireless work of Till Kamppeter from MandrakeSoft, who is also the
4021 principal author of the foomatic-rip utility.
4025 The former "cupsomatic" concept is now be replaced by the new, much
4026 more powerful "foomatic-rip". foomatic-rip is the successor of
4027 cupsomatic. cupsomatic is no longer maintained. Here is the new URL
4028 to the Foomatic-3.0 database:<ulink
4029 url="http://www.linuxprinting.org/driver_list.cgi">http://www.linuxprinting.org/driver_list.cgi</ulink>.
4030 If you upgrade to foomatic-rip, don't forget to also upgrade to the
4031 new-style PPDs for your foomatic-driven printers. foomatic-rip will
4032 not work with PPDs generated for the old cupsomatic. The new-style
4033 PPDs are 100% compliant to the Adobe PPD specification. They are
4034 intended to be used by Samba and the cupsaddsmb utility also, to
4035 provide the driver files for the Windows clients also!
4039 <title>foomatic-rip and Foomatic explained</title>
4042 Nowadays most Linux distros rely on the utilities of Linuxprinting.org
4043 to create their printing related software (which, BTW, works on all
4044 UNIXes and on Mac OS X or Darwin too). It is not known as well as it
4045 should be, that it also has a very end-user friendly interface which
4046 allows for an easy update of drivers and PPDs, for all supported
4047 models, all spoolers, all operating systems and all package formats
4048 (because there is none). Its history goes back a few years.
4052 Recently Foomatic has achieved the astonishing milestone of <ulink
4053 url="http://www.linuxprinting.org/printer_list.cgi?make=Anyone">1000
4054 listed</ulink> printer models. Linuxprinting.org keeps all the
4055 important facts about printer drivers, supported models and which
4056 options are available for the various driver/printer combinations in
4058 url="http://www.linuxprinting.org/foomatic.html">Foomatic</ulink>
4059 database. Currently there are <ulink
4060 url="http://www.linuxprinting.org/driver_list.cgi">245 drivers</ulink>
4061 in the database: many drivers support various models, and many models
4062 may be driven by different drivers; it's your choice!
4066 <title>690 "perfect" Printers</title>
4069 At present there are 690 devices dubbed as working "perfectly", 181
4070 "mostly", 96 "partially" and 46 are "Paperweights". Keeping in mind
4071 that most of these are non-PostScript models (PostScript printers are
4072 automatically supported supported by CUPS to perfection, by using
4073 their own manufacturer-provided Windows-PPD...), and that a
4074 multifunctional device never qualifies as working "perfectly" if it
4075 doesn't also scan and copy and fax under GNU/Linux: then this is a
4076 truly astonishing achievement. Three years ago the number was not
4077 more than 500, and Linux or UNIX "printing" at the time wasn't
4078 anywhere near the quality it is today!
4083 <title>How the "Printing HOWTO" started it all</title>
4086 A few years ago <ulink
4087 url="http://www2.picante.com:81/~gtaylor/">Grant Taylor</ulink>
4088 started it all. The roots of today's Linuxprinting.org are in the
4090 url="http://www.linuxprinting.org/foomatic2.9/howto/">Linux Printing
4091 HOWTO</ulink> which he authored. As a side-project to this document,
4092 which served many Linux users and admins to guide their first steps in
4093 this complicated and delicate setup (to a scientist, printing is
4094 "applying a structured deposition of distinct patterns of ink or toner
4095 particles on paper substrates" <emphasis>;-)</emphasis>, he started to
4096 build in a little Postgres database with information about the
4097 hardware and driver zoo that made up Linux printing of the time. This
4098 database became the core component of today's Foomatic collection of
4099 tools and data. In the meantime it has moved to an XML representation
4105 <title>Foomatic's strange Name</title>
4108 "Why the funny name?", you ask. When it really took off, around spring
4109 2000, CUPS was far less popular than today, and most systems used LPD,
4110 LPRng or even PDQ to print. CUPS shipped with a few generic "drivers"
4111 (good for a few hundred different printer models). These didn't
4112 support many device-specific options. CUPS also shipped with its own
4113 built-in rasterization filter ("pstoraster", derived from
4114 Ghostscript). On the other hand, CUPS provided brilliant support for
4115 <emphasis>controlling</emphasis> all printer options through
4116 standardized and well-defined "PPD files" (PostScript Printers
4117 Description files). Plus, CUPS was designed to be easily extensible.
4121 Grant already had in his database a respectable compilation
4122 of facts about a many more printers, and the Ghostscript "drivers"
4123 they run with. His idea, to generate PPDs from the database info
4124 and use them to make standard Ghostscript filters work within CUPS,
4125 proved to work very well. It also "killed several birds with one
4130 <listitem><para>It made all current and future Ghostscript filter
4131 developments available for CUPS;</para></listitem>
4133 <listitem><para>It made available a lot of additional printer models
4134 to CUPS users (because often the "traditional" Ghostscript way of
4135 printing was the only one available);</para></listitem>
4137 <listitem><para>It gave all the advanced CUPS options (web interface,
4138 GUI driver configurations) to users wanting (or needing) to use
4139 Ghostscript filters.</para></listitem>
4144 <title>cupsomatic, pdqomatic, lpdomatic, directomatic</title>
4147 CUPS worked through a quickly-hacked up filter script named <ulink
4148 url="http://www.linuxprinting.org/download.cgi?filename=cupsomatic&show=0">cupsomatic</ulink>.
4149 cupsomatic ran the printfile through Ghostscript, constructing
4150 automatically the rather complicated command line needed. It just
4151 required to be copied into the CUPS system to make it work. To
4152 "configure" the way cupsomatic controls the Ghostscript rendering
4153 process, it needs a CUPS-PPD. This PPD is generated directly from the
4154 contents of the database. For CUPS and the respective printer/filter
4155 combo another Perl script named "CUPS-O-Matic" did the PPD
4156 generation. After that was working, Grant implemented within a few
4157 days a similar thing for two other spoolers. Names chosen for the
4158 config-generator scripts were <ulink
4159 url="http://www.linuxprinting.org/download.cgi?filename=lpdomatic&show=0">PDQ-O-Matic</ulink>
4160 (for PDQ) and <ulink
4161 url="http://www.linuxprinting.org/download.cgi?filename=lpdomatic&show=0">LPD-O-Matic</ulink>
4162 (for - you guessed it - LPD); the configuration here didn't use PPDs
4163 but other spooler-specific files.
4167 From late summer of that year, <ulink
4168 url="http://www.linuxprinting.org/till/">Till Kamppeter</ulink>
4169 started to put work into the database. Till had been newly employed by
4170 <ulink url="http://www.mandrakesoft.com/">MandrakeSoft</ulink> to
4171 convert their printing system over to CUPS, after they had seen his
4172 <ulink url="http://www.fltk.org/">FLTK</ulink>-based <ulink
4173 url="http://cups.sourceforge.net/xpp/">XPP</ulink> (a GUI frontend to
4174 the CUPS lp-command). He added a huge amount of new information and new
4175 printers. He also developed the support for other spoolers, like
4176 <ulink url="http://ppr.sourceforge.net/">PPR</ulink> (via ppromatic),
4177 <ulink url="http://sourceforge.net/projects/lpr/">GNUlpr</ulink> and
4178 <ulink url="http://www.lprng.org/">LPRng</ulink> (both via an extended
4179 lpdomatic) and "spoolerless" printing (<ulink
4180 url="http://www.linuxprinting.org/download.cgi?filename=directomatic&show=0">directomatic</ulink>)....
4184 So, to answer your question: "Foomatic" is the general name for all
4185 the overlapping code and data behind the "*omatic" scripts.... --
4186 Foomatic up to versions 2.0.x required (ugly) Perl data structures
4187 attached the Linuxprinting.org PPDs for CUPS. It had a different
4188 "*omatic" script for every spooler, as well as different printer
4189 configuration files..
4194 <title>7.13.1.5.The <emphasis>Grand Unification</emphasis>
4198 This all has changed in Foomatic versions 2.9 (Beta) and released as
4199 "stable" 3.0. This has now achieved the convergence of all *omatic
4200 scripts: it is called the <ulink
4201 url="http://www.linuxprinting.org/foomatic2.9/download.cgi?filename=foomatic-rip&show=0">foomatic-rip</ulink>.
4202 This single script is the unification of the previously different
4203 spooler-specific *omatic scripts. foomatic-rip is used by all the
4204 different spoolers alike. Because foomatic-rip can read PPDs (both the
4205 original PostScript printer PPDs and the Linuxprinting.org-generated
4206 ones), all of a sudden all supported spoolers can have the power of
4207 PPDs at their disposal; users only need to plug "foomatic-rip" into
4208 their system.... For users there is improved media type and source
4209 support; paper sizes and trays are easier to configure.
4213 Also, the New Generation of Linuxprinting.org PPDs doesn't contain
4214 Perl data structures any more. If you are a distro maintainer and have
4215 used the previous version of Foomatic, you may want to give the new
4216 one a spin: but don't forget to generate a new-version set of PPDs,
4218 url="http://www.linuxprinting.org/download/foomatic/foomatic-db-engine-3.0.0beta1.tar.gz">foomatic-db-engine</ulink>!
4219 Individual users just need to generate a single new PPD specific to
4220 their model by <ulink
4221 url="http://www.linuxprinting.org/kpfeifle/LinuxKongress2002/Tutorial/II.Foomatic-User/II.tutorial-handout-foomatic-user.html">following
4222 the steps</ulink> outlined in the Foomatic tutorial or further
4223 below. This new development is truly amazing.
4227 foomatic-rip is a very clever wrapper around the need to run
4228 Ghostscript with a different syntax, different options, different
4229 device selections and/or different filters for each different printer
4230 or different spooler. At the same time it can read the PPD associated
4231 with a print queue and modify the print job according to the user
4232 selections. Together with this comes the 100% compliance of the new
4233 Foomatic PPDs with the Adobe spec. Some really innovative features of
4234 the Foomatic concept will surprise users: it will support custom paper
4235 sizes for many printers; and it will support printing on media drawn
4236 from different paper trays within the same job (in both cases: even
4237 where there is no support for this from Windows-based vendor printer
4243 <title>Driver Development outside</title>
4246 Most driver development itself does not happen within
4247 Linuxprinting.org. Drivers are written by independent maintainers.
4248 Linuxprinting.org just pools all the information, and stores it in its
4249 database. In addition, it also provides the Foomatic glue to integrate
4250 the many drivers into any modern (or legacy) printing system known to
4255 Speaking of the different driver development groups: most of
4256 the work is currently done in three projects. These are:
4260 <listitem><para><ulink
4261 url="http://www-124.ibm.com/developerworks/oss/linux/projects/omni/">Omni</ulink>
4262 -- a Free Software project by IBM which tries to convert their printer
4263 driver knowledge from good-ol' OS/2 times into a modern, modular,
4264 universal driver architecture for Linux/Unix (still Beta). This
4265 currently supports 437 models.</para></listitem>
4267 <listitem><para><ulink url="http://hpinkjet.sf.net/">HPIJS</ulink> --
4268 a Free Software project by HP to provide the support for their own
4269 range of models (very mature, printing in most cases is perfect and
4270 provides true photo quality). This currently supports 369
4271 models.</para></listitem>
4273 <listitem><para><ulink
4274 url="http://gimp-print.sf.net/">Gimp-Print</ulink> -- a Free software
4275 effort, started by Michael Sweet (also lead developer for CUPS), now
4276 directed by Robert Krawitz, which has achieved an amazing level of
4277 photo print quality (many Epson users swear that its quality is
4278 better than the vendor drivers provided by Epson for the Microsoft
4279 platforms). This currently supports 522 models.</para></listitem>
4284 <title>Forums, Downloads, Tutorials, Howtos -- also for Mac OS X and
4285 commercial Unix</title>
4288 Linuxprinting.org today is the one-stop "shop" to download printer
4289 drivers. Look for printer information and <ulink
4290 url="http://www.linuxprinting.org//kpfeifle/LinuxKongress2002/Tutorial/">tutorials</ulink>
4291 or solve printing problems in its popular <ulink
4292 url="http://www.linuxprinting.org/newsportal/">forums</ulink>. But
4293 it's not just for GNU/Linux: users and admins of <ulink
4294 url="http://www.linuxprinting.org/macosx/">commercial UNIX
4295 systems</ulink> are also going there, and the relatively new <ulink
4296 url="http://www.linuxprinting.org/newsportal/thread.php3?name=linuxprinting.macosx.general">Mac
4297 OS X forum</ulink> has turned out to be one of the most frequented
4298 fora after only a few weeks.
4302 Linuxprinting.org and the Foomatic driver wrappers around Ghostscript
4303 are now a standard toolchain for printing on all the important
4304 distros. Most of them also have CUPS underneath. While in recent years
4305 most printer data had been added by Till (who works at Mandrake), many
4306 additional contributions came from engineers with SuSE, RedHat,
4307 Connectiva, Debian and others. Vendor-neutrality is an important goal
4308 of the Foomatic project.
4312 Till Kamppeter from MandrakeSoft is doing an excellent job in his
4313 spare time to maintain Linuxprinting.org and Foomatic. So if you use
4314 it often, please send him a note showing your appreciation.
4319 <title>Foomatic Database generated PPDs</title>
4322 The Foomatic database is an amazing piece of ingenuity in itself. Not
4323 only does it keep the printer and driver information, but it is
4324 organized in a way that it can generate "PPD" files "on the fly" from
4325 its internal XML-based datasets. While these PPDs are modelled to the
4326 Adobe specification of "PostScript Printer Descriptions" (PPDs), the
4327 Linuxprinting.org/Foomatic-PPDs don't normally drive PostScript
4328 printers: they are used to describe all the bells and whistles you
4329 could ring or blow on an Epson Stylus inkjet, or a HP Photosmart or
4330 what-have-you. The main "trick" is one little additional line, not
4331 envisaged by the PPD specification, starting with the "*cupsFilter"
4332 keyword: it tells the CUPS daemon how to proceed with the PostScript
4333 print file (old-style Foomatic-PPDs named the
4334 <emphasis>cupsomatic</emphasis> filter script, while the new-style
4335 PPDs now call <emphasis>foomatic-rip</emphasis>). This filter
4336 script calls Ghostscript on the host system (the recommended variant
4337 is ESP Ghostscript) to do the rendering work. foomatic-rip knows which
4338 filter or internal device setting it should ask from Ghostscript to
4339 convert the PostScript printjob into a raster format ready for the
4340 target device. This usage of PPDs to describe the options of non-PS
4341 printers was the invention of the CUPS developers. The rest is easy:
4342 GUI tools (like KDE's marvellous <ulink
4343 url="http://printing.kde.org/overview/kprinter.phtml">"kprinter"</ulink>,
4345 url="http://gtklp.sourceforge.net/">"gtklp"</ulink>, "xpp" and the CUPS
4346 web interface) read the PPD too and use this information to present
4347 the available settings to the user as an intuitive menu selection.
4353 <title>foomatic-rip and Foomatic-PPD Download and Installation</title>
4356 Here are the steps to install a foomatic-rip driven "LaserJet 4 Plus"
4357 compatible printer in CUPS (note that recent distributions of SuSE,
4358 UnitedLinux and Mandrake may ship with a complete package of
4359 Foomatic-PPDs plus the foomatic-rip utility. going directly to
4360 Linuxprinting.org ensures you to get the latest driver/PPD files):
4363 <listitem><para>Surf to <ulink
4364 url="http://www.linuxprinting.org/printer_list.cgi">http://www.linuxprinting.org/printer_list.cgi</ulink>
4367 <listitem><para>Check the complete list of printers in the database:
4369 url="http://www.linuxprinting.org/printer_list.cgi?make=Anyone">http://www.linuxprinting.org/printer_list.cgi?make=Anyone</ulink>
4372 <listitem><para>There select your model and click on the
4373 link.</para></listitem>
4375 <listitem><para>You'll arrive at a page listing all drivers working
4376 with this model (for all printers, there will always be
4377 <emphasis>one</emphasis> recommended driver. Try this one
4378 first).</para></listitem>
4380 <listitem><para>In our case ("HP LaserJet 4 Plus"), we'll arrive here:
4382 url="http://www.linuxprinting.org/show_printer.cgi?recnum=HP-LaserJet_4_Plus">http://www.linuxprinting.org/show_printer.cgi?recnum=HP-LaserJet_4_Plus</ulink>
4385 <listitem><para>The recommended driver is "ljet4".</para></listitem>
4387 <listitem><para>There are several links provided here. You should
4388 visit them all, if you are not familiar with the Linuxprinting.org
4389 database.</para></listitem>
4391 <listitem><para>There is a link to the database page for the "ljet4":
4393 url="http://www.linuxprinting.org/show_driver.cgi?driver=ljet4">http://www.linuxprinting.org/show_driver.cgi?driver=ljet4</ulink>
4394 On the driver's page, you'll find important and detailed information
4395 about how to use that driver within the various available
4396 spoolers.</para></listitem>
4398 <listitem><para>Another link may lead you to the homepage of the
4399 driver author or the driver.</para></listitem>
4401 <listitem><para>Important links are the ones which provide hints with
4402 setup instructions for CUPS (<ulink
4403 url="http://www.linuxprinting.org/cups-doc.html">http://www.linuxprinting.org/cups-doc.html</ulink>),
4405 url="http://www.linuxprinting.org/pdq-doc.html">http://www.linuxprinting.org/pdq-doc.html</ulink>),
4406 LPD, LPRng and GNUlpr (<ulink
4407 url="http://www.linuxprinting.org/lpd-doc.html">http://www.linuxprinting.org/lpd-doc.html</ulink>)
4408 as well as PPR (<ulink
4409 url="http://www.linuxprinting.org/ppr-doc.html">http://www.linuxprinting.org/ppr-doc.html)</ulink>
4410 or "spooler-less" printing (<ulink
4411 url="http://www.linuxprinting.org/direct-doc.html">http://www.linuxprinting.org/direct-doc.html</ulink>
4412 ).</para></listitem>
4414 <listitem><para>You can view the PPD in your browser through this
4416 url="http://www.linuxprinting.org/ppd-o-matic.cgi?driver=ljet4&printer=HP-LaserJet_4_Plus&show=1">http://www.linuxprinting.org/ppd-o-matic.cgi?driver=ljet4&printer=HP-LaserJet_4_Plus&show=1</ulink>
4417 </para></listitem> <listitem><para>You can also (most importantly)
4418 generate and download the PPD: <ulink
4419 url="http://www.linuxprinting.org/ppd-o-matic.cgi?driver=ljet4&printer=HP-LaserJet_4_Plus&show=0">http://www.linuxprinting.org/ppd-o-matic.cgi?driver=ljet4&printer=HP-LaserJet_4_Plus&show=0</ulink>
4422 <listitem><para>The PPD contains all the information needed to use our
4423 model and the driver; this is, once installed, working transparently
4424 for the user. Later you'll only need to choose resolution, paper size
4425 etc. from the web-based menu, or from the print dialog GUI, or from
4426 the commandline.</para></listitem>
4428 <listitem><para>Should you have ended up on the driver's page (<ulink
4429 url="http://www.linuxprinting.org/show_driver.cgi?driver=ljet4">http://www.linuxprinting.org/show_driver.cgi?driver=ljet4</ulink>),
4430 you can choose to use the "PPD-O-Matic" online PPD generator
4431 program.</para></listitem>
4433 <listitem><para>Select the exact model and check either "download" or
4434 "display PPD file" and click on "Generate PPD file".</para></listitem>
4436 <listitem><para>If you save the PPD file from the browser view, please
4437 don't use "cut'n'past" (since it could possibly damage line endings
4438 and tabs, which makes the PPD likely to fail its duty), but use "Save
4439 as..." in your browser's menu. (Best is to use the "download" option
4440 from the web page directly).</para></listitem>
4442 <listitem><para>Another very interesting part on each driver page is
4443 the <emphasis>Show execution details</emphasis> button. If you
4444 select your printer model and click that button, you will get
4445 displayed a complete Ghostscript command line, enumerating all options
4446 available for that driver/printermodel combo. This is a great way to
4447 "Learn Ghostscript By Doing". It is also an excellent "cheat sheet"
4448 for all experienced users who need to re-construct a good command line
4449 for that damn printing script, but can't remember the exact
4450 syntax. ;-)</para></listitem>
4452 <listitem><para>Some time during your visit to Linuxprinting.org, save
4453 the PPD to a suitable place on your harddisk, say
4454 <filename>/path/to/my-printer.ppd</filename> (if you prefer to install
4455 your printers with the help of the CUPS web interface, save the PPD to
4456 the <filename>/usr/share/cups/model/</filename> path and re-start
4457 cupsd).</para></listitem>
4459 <listitem><para>Then install the printer with a suitable commandline,
4465 lpadmin -p laserjet4plus -v parallel:/dev/lp0 -E -P path/to/my-printer.ppd
4467 </screen></para></listitem>
4469 <listitem><para>Note again this: for all the new-style "Foomatic-PPDs"
4470 from Linuxprinting.org, you also need a special "CUPS filter" named
4471 "foomatic-rip".Get the latest version of "foomatic-rip" from: <ulink
4472 url="http://www.linuxprinting.org/foomatic2.9/download.cgi?filename=foomatic-rip&show=0">http://www.linuxprinting.org/foomatic2.9/download.cgi?filename=foomatic-rip&show=0</ulink>
4475 <listitem><para>The foomatic-rip Perlscript itself also makes some
4476 interesting reading (<ulink
4477 url="http://www.linuxprinting.org/foomatic2.9/download.cgi?filename=foomatic-rip&show=1">http://www.linuxprinting.org/foomatic2.9/download.cgi?filename=foomatic-rip&show=1</ulink>),
4478 because it is very well documented by Till's inline comments (even
4479 non-Perl hackers will learn quite a bit about printing by reading
4480 it... ;-)</para></listitem>
4482 <listitem><para>Save foomatic-rip either directly in
4483 <filename>/usr/lib/cups/filter/foomatic-rip</filename> or somewhere in
4484 your $PATH (and don't forget to make it world-executable). Again,
4485 don't save by "copy'n'paste" but use the appropriate link, or the
4486 "Save as..." menu item in your browser.</para></listitem>
4488 <listitem><para>If you save foomatic-rip in your $PATH, create a symlink:
4489 <command>cd /usr/lib/cups/filter/ ; ln -s `which
4490 foomatic-rip`</command>. For CUPS to discover this new
4491 available filter at startup, you need to re-start
4492 cupsd.</para></listitem>
4496 Once you print to a printqueue set up with the Foomatic-PPD, CUPS will
4497 insert the appropriate commands and comments into the resulting
4498 PostScript jobfile. foomatic-rip is able to read and act upon
4499 these. foomatic-rip uses some specially encoded Foomatic comments,
4500 embedded in the jobfile. These in turn are used to construct
4501 (transparently for you, the user) the complicated ghostscript command
4502 line telling for the printer driver how exactly the resulting raster
4503 data should look like and which printer commands to embed into the
4513 <listitem><para>A "foomatic+something" PPD -- but it this not enough
4514 to print with CUPS (it is only <emphasis>one</emphasis> important
4515 component)</para></listitem>
4517 <listitem><para>The "foomatic-rip" filter script (Perl) in
4518 /usr/lib/cups/filters/</para></listitem>
4520 <listitem><para>Perl to make foomatic-rip run</para></listitem>
4522 <listitem><para>Ghostscript (because it is doing the main work,
4523 controlled by the PPD/foomatic-rip combo) to produce the raster data
4524 fit for your printermodel's consumption</para></listitem>
4526 <listitem><para>Ghostscript <emphasis>must</emphasis> (depending on
4527 the driver/model) contain support for a certain "device", representing
4528 the selected "driver" for your model (as shown by "gs
4529 -h")</para></listitem>
4531 <listitem><para>foomatic-rip needs a new version of PPDs (PPD versions
4532 produced for cupsomatic don't work with
4533 foomatic-rip).</para></listitem>
4539 <title>Page Accounting with CUPS</title>
4542 Often there are questions regarding "print quotas" wherein Samba users
4543 (that is, Windows clients) should not be able to print beyond a
4544 certain amount of pages or data volume per day, week or month. This
4545 feature is dependent on the real print subsystem you're using.
4546 Samba's part is always to receive the job files from the clients
4547 (filtered <emphasis>or</emphasis> unfiltered) and hand it over to this
4552 Of course one could "hack" things with one's own scripts. But then
4553 there is CUPS. CUPS supports "quotas" which can be based on sizes of
4554 jobs or on the number of pages or both, and are spanning any time
4559 <title>Setting up Quotas</title>
4562 This is an example command how root would set a print quota in CUPS,
4563 assuming an existing printer named "quotaprinter":
4568 lpadmin -p quotaprinter -o job-quota-period=604800 -o job-k-limit=1024 -o job-page-limit=100
4573 This would limit every single user to print 100 pages or 1024 KB of
4574 data (whichever comes first) within the last 604,800 seconds ( = 1
4580 <title>Correct and incorrect Accounting</title>
4583 For CUPS to count correctly, the printfile needs to pass the CUPS
4584 "pstops" filter, otherwise it uses a "dummy" count of "1". Some
4585 printfiles don't pass it (eg: image files) but then those are mostly 1
4586 page jobs anyway. This also means that proprietary drivers for the
4587 target printer running on the client computers and CUPS/Samba, which
4588 then spool these files as "raw" (i.e. leaving them untouched, not
4589 filtering them), will be counted as "1-pagers" too!
4593 You need to send PostScript from the clients (i.e. run a PostScript
4594 driver there) to have the chance to get accounting done. If the
4595 printer is a non-PostScript model, you need to let CUPS do the job to
4596 convert the file to a print-ready format for the target printer. This
4597 will be working for currently about 1,000 different printer models,
4599 url="http://www.linuxprinting.org/printer_list.cgi">http://www.linuxprinting.org/printer_list.cgi</ulink>).
4604 <title>Adobe and CUPS PostScript Drivers for Windows Clients</title>
4607 Before CUPS-1.1.16 your only option was to use the Adobe PostScript
4608 Driver on the Windows clients. The output of this driver was not
4609 always passed through the "pstops" filter on the CUPS/Samba side, and
4610 therefore was not counted correctly (the reason is that it often,
4611 depending on the "PPD" being used, wrote a "PJL"-header in front of
4612 the real PostScript which caused CUPS to skip pstops and go directly
4613 to the "pstoraster" stage).
4617 From CUPS-1.1.16 onward you can use the "CUPS PostScript Driver for
4618 Windows NT/2K/XP clients" (which is tagged in the download area of
4619 http://www.cups.org/ as the "cups-samba-1.1.16.tar.gz" package). It does
4620 <emphasis>not</emphasis> work for Win9x/ME clients. But it guarantees:
4625 <listitem><para>to not write an PJL-header</para></listitem>
4627 <listitem><para>to still read and support all PJL-options named in the
4628 driver PPD with its own means</para></listitem>
4630 <listitem><para> that the file will pass through the "pstops" filter
4631 on the CUPS/Samba server</para></listitem>
4633 <listitem><para>to page-count correctly the
4634 printfile</para></listitem>
4638 You can read more about the setup of this combination in the manpage
4639 for "cupsaddsmb" (which is only present with CUPS installed, and only
4640 current from CUPS 1.1.16).
4645 <title>The page_log File Syntax</title>
4648 These are the items CUPS logs in the "page_log" for every
4649 single <emphasis>page</emphasis> of a job:
4653 <listitem><para>Printer name</para></listitem>
4655 <listitem><para>User name</para></listitem>
4657 <listitem><para>Job ID</para></listitem>
4659 <listitem><para>Time of printing</para></listitem>
4661 <listitem><para>the page number</para></listitem>
4663 <listitem><para>the number of copies</para></listitem>
4665 <listitem><para>a billing information string
4666 (optional)</para></listitem>
4668 <listitem><para>the host which sent the job (included since version
4669 1.1.19)</para></listitem>
4673 Here is an extract of my CUPS server's page_log file to illustrate the
4674 format and included items:
4679 infotec_IS2027 kurt 401 [22/Apr/2003:10:28:43 +0100] 1 3 #marketing 10.160.50.13
4680 infotec_IS2027 kurt 401 [22/Apr/2003:10:28:43 +0100] 2 3 #marketing 10.160.50.13
4681 infotec_IS2027 kurt 401 [22/Apr/2003:10:28:43 +0100] 3 3 #marketing 10.160.50.13
4682 infotec_IS2027 kurt 401 [22/Apr/2003:10:28:43 +0100] 4 3 #marketing 10.160.50.13
4683 DigiMaster9110 boss 402 [22/Apr/2003:10:33:22 +0100] 1 440 finance-dep 10.160.51.33
4688 This was job ID "401", printed on "infotec_IS2027" by user "kurt", a
4689 64-page job printed in 3 copies and billed to "#marketing", sent
4690 from IP address 10.160.50.13. The next job had ID "402", was sent by
4691 user "boss" from IP address 10.160.51.33,printed from one page 440
4692 copies and is set to be billed to "finance-dep".
4697 <title>Possible Shortcomings</title>
4700 What flaws or shortcomings are there with this quota system?
4704 <listitem><para>the ones named above (wrongly logged job in case of
4705 printer hardware failure, etc.)</para></listitem>
4707 <listitem><para>in reality, CUPS counts the job pages that are being
4708 processed in <emphasis>software</emphasis> (that is, going through the
4709 "RIP") rather than the physical sheets successfully leaving the
4710 printing device. Thus if there is a jam while printing the 5th sheet out
4711 of 1000 and the job is aborted by the printer, the "page count" will
4712 still show the figure of 1000 for that job</para></listitem>
4714 <listitem><para>all quotas are the same for all users (no flexibility
4715 to give the boss a higher quota than the clerk) no support for
4716 groups</para></listitem>
4718 <listitem><para>no means to read out the current balance or the
4719 "used-up" number of current quota</para></listitem>
4721 <listitem><para>a user having used up 99 sheets of 100 quota will
4722 still be able to send and print a 1,000 sheet job</para></listitem>
4724 <listitem><para>a user being denied a job because of a filled-up quota
4725 doesn't get a meaningful error message from CUPS other than
4726 "client-error-not-possible".</para></listitem>
4731 <title>Future Developments</title>
4734 This is the best system currently available, and there are huge
4735 improvements under development for CUPS 1.2:
4739 <listitem><para>page counting will go into the "backends" (these talk
4740 directly to the printer and will increase the count in sync with the
4741 actual printing process: thus a jam at the 5th sheet will lead to a
4742 stop in the counting)</para></listitem>
4744 <listitem><para>quotas will be handled more flexibly</para></listitem>
4746 <listitem><para>probably there will be support for users to inquire
4747 their "accounts" in advance</para></listitem>
4749 <listitem><para>probably there will be support for some other tools
4750 around this topic</para></listitem>
4755 <title>Other Accounting Tools</title>
4758 PrintAnalyzer, pyKota, printbill, LogReport.
4764 <title>Additional Material</title>
4767 A printer queue with <emphasis>no</emphasis> PPD associated to it is a
4768 "raw" printer and all files will go directly there as received by the
4769 spooler. The exceptions are file types "application/octet-stream"
4770 which need "passthrough feature" enabled. "Raw" queues don't do any
4771 filtering at all, they hand the file directly to the CUPS backend.
4772 This backend is responsible for the sending of the data to the device
4773 (as in the "device URI" notation: <filename>lpd://, socket://,
4774 smb://, ipp://, http://, parallel:/, serial:/, usb:/</filename> etc.)
4778 "cupsomatic"/Foomatic are <emphasis>not</emphasis> native CUPS drivers
4779 and they don't ship with CUPS. They are a Third Party add-on,
4780 developed at Linuxprinting.org. As such, they are a brilliant hack to
4781 make all models (driven by Ghostscript drivers/filters in traditional
4782 spoolers) also work via CUPS, with the same (good or bad!) quality as
4783 in these other spoolers. "cupsomatic" is only a vehicle to execute a
4784 ghostscript commandline at that stage in the CUPS filtering chain,
4785 where "normally" the native CUPS "pstoraster" filter would kick
4786 in. cupsomatic by-passes pstoraster, "kidnaps" the printfile from CUPS
4787 away and re-directs it to go through Ghostscript. CUPS accepts this,
4788 because the associated CUPS-O-Matic-/Foomatic-PPD specifies:
4793 *cupsFilter: "application/vnd.cups-postscript 0 cupsomatic"
4798 This line persuades CUPS to hand the file to cupsomatic, once it has
4799 successfully converted it to the MIME type
4800 "application/vnd.cups-postscript". This conversion will not happen for
4801 Jobs arriving from Windows which are auto-typed
4802 "application/octet-stream", with the according changes in
4803 <filename>/etc/cups/mime.types</filename> in place.
4807 CUPS is widely configurable and flexible, even regarding its filtering
4808 mechanism. Another workaround in some situations would be to have in
4809 <filename>/etc/cups/mime.types</filename> entries as follows:
4814 application/postscript application/vnd.cups-raw 0 -
4815 application/vnd.cups-postscript application/vnd.cups-raw 0 -
4820 This would prevent all Postscript files from being filtered (rather,
4821 they will through the virtual <emphasis>nullfilter</emphasis>
4822 denoted with "-"). This could only be useful for PS printers. If you
4823 want to print PS code on non-PS printers (provided they support ASCII
4824 text printing) an entry as follows could be useful:
4829 */* application/vnd.cups-raw 0 -
4834 and would effectively send <emphasis>all</emphasis> files to the
4835 backend without further processing.
4839 Lastly, you could have the following entry:
4844 application/vnd.cups-postscript application/vnd.cups-raw 0 my_PJL_stripping_filter
4849 You will need to write a <emphasis>my_PJL_stripping_filter</emphasis>
4850 (could be a shellscript) that parses the PostScript and removes the
4851 unwanted PJL. This would need to conform to CUPS filter design
4852 (mainly, receive and pass the parameters printername, job-id,
4853 username, jobtitle, copies, print options and possibly the
4854 filename). It would be installed as world executable into
4855 <filename>/usr/lib/cups/filters/</filename> and will be called by CUPS
4856 if it encounters a MIME type "application/vnd.cups-postscript".
4860 CUPS can handle <emphasis>-o job-hold-until=indefinite</emphasis>.
4861 This keeps the job in the queue "on hold". It will only be printed
4862 upon manual release by the printer operator. This is a requirement in
4863 many "central reproduction departments", where a few operators manage
4864 the jobs of hundreds of users on some big machine, where no user is
4865 allowed to have direct access (such as when the operators often need
4866 to load the proper paper type before running the 10,000 page job
4867 requested by marketing for the mailing, etc.).
4872 <title>Auto-Deletion or Preservation of CUPS Spool Files</title>
4875 Samba print files pass through two "spool" directories. One is the
4876 incoming directory managed by Samba, (set in the <emphasis>path =
4877 /var/spool/samba</emphasis> directive in the
4878 <emphasis>[printers]</emphasis> section of
4879 <filename>smb.conf</filename>). The other is the spool directory of
4880 your UNIX print subsystem. For CUPS it is normally
4881 <filename>/var/spool/cups/</filename>, as set by the cupsd.conf
4882 directive <filename>RequestRoot /var/spool/cups</filename>.
4886 <title>CUPS Configuration Settings explained</title>
4889 Some important parameter settings in the CUPS configuration file
4890 <filename>cupsd.conf</filename> are:
4895 <varlistentry><term>PreserveJobHistory Yes</term>
4897 This keeps some details of jobs in cupsd's mind (well it keeps the
4898 "c12345", "c12346" etc. files in the CUPS spool directory, which do a
4899 similar job as the old-fashioned BSD-LPD control files). This is set
4900 to "Yes" as a default.
4901 </para></listitem></varlistentry>
4903 <varlistentry><term>PreserveJobFiles Yes</term>
4905 This keeps the job files themselves in cupsd's mind
4906 (well it keeps the "d12345", "d12346" etc. files in the CUPS spool
4907 directory...). This is set to "No" as the CUPS
4909 </para></listitem></varlistentry>
4911 <varlistentry><term><emphasis>"MaxJobs 500"</emphasis></term>
4913 This directive controls the maximum number of jobs
4914 that are kept in memory. Once the number of jobs reaches the limit,
4915 the oldest completed job is automatically purged from the system to
4916 make room for the new one. If all of the known jobs are still
4917 pending or active then the new job will be rejected. Setting the
4918 maximum to 0 disables this functionality. The default setting is
4920 </para></listitem></varlistentry>
4924 (There are also additional settings for "MaxJobsPerUser" and
4925 "MaxJobsPerPrinter"...)
4930 <title>Pre-conditions</title>
4933 For everything to work as announced, you need to have three
4938 <listitem><para>a Samba-smbd which is compiled against "libcups" (Check
4939 on Linux by running "ldd `which smbd`")</para></listitem>
4941 <listitem><para>a Samba-<filename>smb.conf</filename> setting of
4942 "printing = cups"</para></listitem>
4944 <listitem><para>another Samba-<filename>smb.conf</filename> setting of
4945 "printcap = cups"</para></listitem>
4949 In this case all other manually set printing-related commands (like
4950 "print command", "lpq command", "lprm command", "lppause command" or
4951 "lpresume command") are ignored and they should normally have no
4952 influence what-so-ever on your printing.
4957 <title>Manual Configuration</title>
4960 If you want to do things manually, replace the "printing =
4961 cups" by "printing = bsd". Then your manually set commands may work
4962 (haven't tested this), and a "print command = lp -d %P %s; rm %s"
4963 may do what you need.
4969 <title>When <emphasis>not</emphasis> to use Samba to print to
4978 <title>In Case of Trouble.....</title>
4981 If you have more problems, post the output of these commands
4982 to the CUPS or Samba mailing lists (choose the one which seems more
4983 relevant to your problem):
4988 grep -v ^# /etc/cups/cupsd.conf | grep -v ^$
4989 grep -v ^# /etc/samba/smb.conf | grep -v ^$ | grep -v "^;"
4994 (adapt paths as needed). These commands leave out the empty
4995 lines and lines with comments, providing the "naked settings" in a
4996 compact way. Don't forget to name the CUPS and Samba versions you
4997 are using! This saves bandwidth and makes for easier readability
4998 for experts (and you are expecting experts to read them, right?
5003 <title>Where to find Documentation</title>
5011 <title>How to ask for Help</title>
5019 <title>Where to find Help</title>
5028 <title>Appendix</title>
5031 <title>Printing <emphasis>from</emphasis> CUPS to Windows attached
5035 From time to time the question arises, how you can print
5036 <emphasis>to</emphasis> a Windows attached printer
5037 <emphasis>from</emphasis> Samba. Normally the local connection
5038 "Windows host <--> printer" would be done by USB or parallel
5039 cable, but this doesn't matter to Samba. From here only an SMB
5040 connection needs to be opened to the Windows host. Of course, this
5041 printer must be "shared" first. As you have learned by now, CUPS uses
5042 <emphasis>backends</emphasis> to talk to printers and other
5043 servers. To talk to Windows shared printers you need to use the
5044 <emphasis>smb</emphasis> (surprise, surprise!) backend. Check if this
5045 is in the CUPS backend directory. This resides usually in
5046 <filename>/usr/lib/cups/backend/</filename>. You need to find a "smb"
5047 file there. It should be a symlink to <filename>smbspool</filename>
5048 which file must exist and be executable:
5053 # ls -l /usr/lib/cups/backend/
5055 drwxr-xr-x 3 root root 720 Apr 30 19:04 .
5056 drwxr-xr-x 6 root root 125 Dec 19 17:13 ..
5057 -rwxr-xr-x 1 root root 10692 Feb 16 21:29 canon
5058 -rwxr-xr-x 1 root root 10692 Feb 16 21:29 epson
5059 lrwxrwxrwx 1 root root 3 Apr 17 22:50 http -> ipp
5060 -rwxr-xr-x 1 root root 17316 Apr 17 22:50 ipp
5061 -rwxr-xr-x 1 root root 15420 Apr 20 17:01 lpd
5062 -rwxr-xr-x 1 root root 8656 Apr 20 17:01 parallel
5063 -rwxr-xr-x 1 root root 2162 Mar 31 23:15 pdfdistiller
5064 lrwxrwxrwx 1 root root 25 Apr 30 19:04 ptal -> /usr/local/sbin/ptal-cups
5065 -rwxr-xr-x 1 root root 6284 Apr 20 17:01 scsi
5066 lrwxrwxrwx 1 root root 17 Apr 2 03:11 smb -> /usr/bin/smbspool
5067 -rwxr-xr-x 1 root root 7912 Apr 20 17:01 socket
5068 -rwxr-xr-x 1 root root 9012 Apr 20 17:01 usb
5070 # ls -l `which smbspool`
5071 -rwxr-xr-x 1 root root 563245 Dec 28 14:49 /usr/bin/smbspool
5076 If this symlink doesn't exist, create it:
5081 # ln -s `which smbspool` /usr/lib/cups/backend/smb
5086 smbspool has been written by Mike Sweet from the CUPS folks. It is
5087 included and ships with Samba. It may also be used with print
5088 subsystems other than CUPS, to spool jobs to Windows printer shares. To
5089 set up printer "winprinter" on CUPS, you need to have a "driver" for
5090 it. Essentially this means to convert the print data on the CUPS/Samba
5091 host to a format that the printer can digest (the Windows host is
5092 unable to convert any files you may send). This also means you should
5093 be able to print to the printer if it were hooked directly at your
5094 Samba/CUPS host. For troubleshooting purposes, this is what you
5095 should do, to determine if that part of the process chain is in
5096 order. Then proceed to fix the network connection/authentication to
5097 the Windows host, etc.
5101 To install a printer with the smb backend on CUPS, use this command:
5106 # lpadmin -p winprinter -v smb://WINDOWSNETBIOSNAME/printersharename -P /path/to/PPD
5111 The <emphasis>PPD</emphasis> must be able to direct CUPS to generate
5112 the print data for the target model. For PostScript printers just use
5113 the PPD that would be used with the Windows NT PostScript driver. But
5114 what can you do if the printer is only accessible with a password? Or
5115 if the printer's host is part of another workgroup? This is provided
5116 for: you can include the required parameters as part of the
5117 <filename>smb://</filename> device-URI. Like this:
5122 smb://WORKGROUP/WINDOWSNETBIOSNAME/printersharename
5123 smb://username:password@WORKGROUP/WINDOWSNETBIOSNAME/printersharename
5124 smb://username:password@WINDOWSNETBIOSNAME/printersharename
5129 Note that the device-URI will be visible in the process list of the
5130 Samba server (e.g. when someone uses the <command>ps -aux</command>
5131 command on Linux), even if the username and passwords are sanitized
5132 before they get written into the log files. So this is an inherently
5133 insecure option. However it is the only one. Don't use it if you want
5134 to protect your passwords. Better share the printer in a way that
5135 doesn't require a password! Printing will only work if you have a
5136 working netbios name resolution up and running. Note that this is a
5137 feature of CUPS and you don't necessarily need to have smbd running
5138 (but who wants that? :-).
5143 <title>More CUPS filtering Chains</title>
5146 The following diagrams reveal how CUPS handles print jobs.
5150 #########################################################################
5152 # CUPS in and of itself has this (general) filter chain (CAPITAL
5153 # letters are FILE-FORMATS or MIME types, other are filters (this is
5154 # true for pre-1.1.15 of pre-4.3 versions of CUPS and ESP PrintPro):
5156 # SOMETHNG-FILEFORMAT
5162 # APPLICATION/POSTSCRIPT
5168 # APPLICATION/VND.CUPS-POSTSCRIPT
5171 # pstoraster # as shipped with CUPS, independent from any Ghostscipt
5172 # | # installation on the system
5173 # | (= "postscipt interpreter")
5175 # APPLICATION/VND.CUPS-RASTER
5178 # rastertosomething (e.g. Gimp-Print filters may be plugged in here)
5179 # | (= "raster driver")
5181 # SOMETHING-DEVICE-SPECIFIC
5187 # ESP PrintPro has some enhanced "rastertosomething" filters as compared to
5188 # CUPS, and also a somewhat improved "pstoraster" filter.
5190 # NOTE: Gimp-Print and some other 3rd-Party-Filters (like TurboPrint) to
5191 # CUPS and ESP PrintPro plug-in where rastertosomething is noted.
5193 #########################################################################
5197 #########################################################################
5199 # This is how "cupsomatic" comes into play:
5200 # =========================================
5202 # SOMETHNG-FILEFORMAT
5208 # APPLICATION/POSTSCRIPT
5214 # APPLICATION/VND.CUPS-POSTSCRIPT ----------------+
5217 # pstoraster (constructs complicated
5218 # | (= "postscipt interpreter") Ghostscript commandline
5219 # | to let the file be
5221 # APPLICATION/VND.CUPS-RASTER "-sDEVICE=s.th."
5224 # rastertosomething V
5225 # | (= "raster driver") +-------------------------+
5226 # | | Ghostscript at work.... |
5228 # SOMETHING-DEVICE-SPECIFIC *-------------------------+
5231 # backend <------------------------------------+
5237 # Note, that cupsomatic "kidnaps" the printfile after the
5238 # "APPLICATION/VND.CUPS-POSTSCRPT" stage and deviates it gh
5239 # the CUPS-external, systemwide Ghostscript installation, bypassing the
5240 # "pstoraster" filter (therefore also bypassing the CUPS-raster-drivers
5241 # "rastertosomething", and hands the rasterized file directly to the CUPS
5244 # cupsomatic is not made by the CUPS developers. It is an independent
5245 # contribution to printing development, made by people from
5246 # Linuxprinting.org. (see also http://www.cups.org/cups-help.html)
5248 # NOTE: Gimp-Print and some other 3rd-Party-Filters (like TurboPrint) to
5249 # CUPS and ESP PrintPro plug-in where rastertosomething is noted.
5251 #########################################################################
5255 #########################################################################
5257 # And this is how it works for ESP PrintPro from 4.3:
5258 # ===================================================
5260 # SOMETHNG-FILEFORMAT
5266 # APPLICATION/POSTSCRIPT
5272 # APPLICATION/VND.CUPS-POSTSCRIPT
5276 # | (= "postscipt interpreter")
5278 # APPLICATION/VND.CUPS-RASTER
5281 # rastertosomething (e.g. Gimp-Print filters may be plugged in here)
5282 # | (= "raster driver")
5284 # SOMETHING-DEVICE-SPECIFIC
5289 # NOTE: Gimp-Print and some other 3rd-Party-Filters (like TurboPrint) to
5290 # CUPS and ESP PrintPro plug-in where rastertosomething is noted.
5292 #########################################################################
5296 #########################################################################
5298 # This is how "cupsomatic" would come into play with ESP PrintPro:
5299 # ================================================================
5302 # SOMETHNG-FILEFORMAT
5308 # APPLICATION/POSTSCRIPT
5314 # APPLICATION/VND.CUPS-POSTSCRIPT ----------------+
5317 # gsrip (constructs complicated
5318 # | (= "postscipt interpreter") Ghostscript commandline
5319 # | to let the file be
5321 # APPLICATION/VND.CUPS-RASTER "-sDEVICE=s.th."
5324 # rastertosomething V
5325 # | (= "raster driver") +-------------------------+
5326 # | | Ghostscript at work.... |
5328 # SOMETHING-DEVICE-SPECIFIC *-------------------------+
5331 # backend <------------------------------------+
5336 # NOTE: Gimp-Print and some other 3rd-Party-Filters (like TurboPrint) to
5337 # CUPS and ESP PrintPro plug-in where rastertosomething is noted.
5339 #########################################################################
5343 #########################################################################
5345 # And this is how it works for CUPS from 1.1.15:
5346 # ==============================================
5348 # SOMETHNG-FILEFORMAT
5354 # APPLICATION/POSTSCRIPT
5360 # APPLICATION/VND.CUPS-POSTSCRIPT-----+
5361 # +------------------v------------------------------+
5365 # | "-sDEVICE=cups") |
5367 # | (= "postscipt interpreter") |
5369 # +------------------v------------------------------+
5371 # APPLICATION/VND.CUPS-RASTER >-------+
5375 # | (= "raster driver")
5377 # SOMETHING-DEVICE-SPECIFIC
5383 # NOTE: since version 1.1.15 CUPS "outsourced" the pstoraster process to
5384 # Ghostscript. GNU Ghostscript needs to be patched to handle the
5385 # CUPS requirement; ESP Ghostscript has this builtin. In any case,
5386 # "gs -h" needs to show up a "cups" device. pstoraster is now a
5387 # calling an appropriate "gs -sDEVICE=cups..." commandline to do
5388 # the job. It will output "application/vnd.cup-raster", which will
5389 # be finally processed by a CUPS raster driver "rastertosomething"
5390 # Note the difference to "cupsomatic", which will <emphasis>not</emphasis> output
5391 # CUPS-raster, but a final version of the printfile, ready to be
5392 # sent to the printer. cupsomatic also doesn't use the "cups"
5393 # devicemode in Ghostscript, but one of the classical devicemodes....
5395 # NOTE: Gimp-Print and some other 3rd-Party-Filters (like TurboPrint) to
5396 # CUPS and ESP PrintPro plug-in where rastertosomething is noted.
5398 #########################################################################
5402 #########################################################################
5404 # And this is how it works for CUPS from 1.1.15, with cupsomatic included:
5405 # ========================================================================
5407 # SOMETHNG-FILEFORMAT
5413 # APPLICATION/POSTSCRIPT
5419 # APPLICATION/VND.CUPS-POSTSCRIPT-----+
5420 # +------------------v------------------------------+
5421 # | Ghostscript . Ghostscript at work.... |
5422 # | at work... . (with "-sDEVICE= |
5423 # | (with . s.th." |
5424 # | "-sDEVICE=cups") . |
5426 # | (CUPS standard) . (cupsomatic) |
5428 # | (= "postscript interpreter") |
5430 # +------------------v--------------v---------------+
5432 # APPLICATION/VND.CUPS-RASTER >-------+ |
5435 # rastertosomething |
5436 # | (= "raster driver") |
5438 # SOMETHING-DEVICE-SPECIFIC >------------------------+
5444 # NOTE: Gimp-Print and some other 3rd-Party-Filters (like TurboPrint) to
5445 # CUPS and ESP PrintPro plug-in where rastertosomething is noted.
5447 ##########################################################################
5452 <title>Trouble Shooting Guidelines to fix typical Samba printing
5456 This is a short description of how to debug printing problems
5457 with Samba. This describes how to debug problems with printing from
5458 a SMB client to a Samba server, not the other way around.
5462 <varlistentry><term>Win9x client can't install driver</term>
5463 <listitem><para>For Win9x clients require the printer names to be 8
5464 chars (or "8 plus 3 chars suffix") max; otherwise the driver files
5465 won't get transferred when you want to download them from
5466 Samba.</para></listitem></varlistentry>
5468 <varlistentry><term>testparm</term>
5469 <listitem><para>Run <command>testparm</command>: It will tell you if
5470 <filename>smb.conf</filename> parameters are in the wrong
5471 section. Many people have had the "printer admin" parameter in the
5472 <parameter>[printers]</parameter> section and experienced
5473 problems. "testparm" will tell you if it sees
5474 this.</para></listitem></varlistentry>
5476 <varlistentry><term>"cupsaddsmb" keeps asking for a root password in a
5477 neverending loop</term>
5478 <listitem><para>Have you <parameter>security = user</parameter>? Have
5479 you used <command>smbpasswd</command> to give root a Samba account?
5480 You can do 2 things: open another terminal and execute
5481 <command>smbpasswd -a root</command> to create the account, and
5482 continue with entering the password into the first terminal. Or break
5483 out of the loop by hitting ENTER twice (without trying to type a
5484 password).</para></listitem></varlistentry>
5486 <varlistentry><term>"cupsaddsmb" gives "No PPD file for printer..."
5487 message (but I swear there is one!)</term>
5491 <listitem><para>Have you enabled printer sharing on CUPS? This means:
5492 do you have a <parameter><Location
5493 /printers>....</Location></parameter> section in CUPS
5494 server's <filename>cupsd.conf</filename> which doesn't deny access to
5495 the host you run "cupsaddsmb" from? It <emphasis>could</emphasis> be
5496 an issue if you use cupsaddsmb remotely, or if you use it with a
5497 <parameter>-h</parameter> parameter: <command>cupsaddsmb -H
5498 sambaserver -h cupsserver -v printername</command>.
5500 <listitem><para>Is your
5501 "TempDir" directive in
5502 <emphasis>cupsd.conf</emphasis>
5503 set to a valid value and is it writeable?
5504 </para></listitem></itemizedlist>
5505 </listitem></varlistentry>
5507 <varlistentry><term>I can't connect client to Samba printer.</term>
5508 <listitem><para>Use <command>smbstatus</command> to check which user
5509 you are from Samba's point of view. Do you have the privileges to
5510 write into the <parameter>[print$]</parameter>
5511 share?</para></listitem></varlistentry>
5513 <varlistentry><term>I can't reconnect to Samba under a new account
5514 from Win2K/XP</term>
5515 <listitem><para>Once you are connected as the "wrong" user (for
5516 example as "nobody", which often occurs if you have <parameter>map to
5517 guest = bad user</parameter>), Windows Explorer will not accept an
5518 attempt to connect again as a different user. There won't be any byte
5519 transfered on the wire to Samba, but still you'll see a stupid error
5520 message which makes you think that Samba has denied access. Use
5521 <command>smbstatus</command> to check for active connections. Kill the
5522 PIDs. You still can't re-connect and get the dreaded
5523 <computeroutput>You can't connect with a second account from the same
5524 machine</computeroutput> message, as soon as you are trying? And you
5525 don't see any single byte arriving at Samba (see logs; use "ethereal")
5526 indicating a renewed connection attempt? Shut all Explorer Windows.
5527 This makes Windows forget what it has cached in its memory as
5528 established connections. Then re-connect as the right user. Best
5529 method is to use a DOS terminal window and <emphasis>first</emphasis>
5530 do <command>net use z: \\SAMBAHOST\print$ /user:root</command>. Check
5531 with <command>smbstatus</command> that you are connected under a
5532 different account. Now open the "Printers" folder (on the Samba server
5533 in the <emphasis>Network Neighbourhood</emphasis>), right-click the
5534 printer in question and select
5535 <emphasis>Connect...</emphasis></para></listitem></varlistentry>
5537 <varlistentry><term>Avoid being connected to the Samba server as the
5539 <listitem><para>You see per <command>smbstatus</command> that you are
5540 connected as user "nobody"; while you wanted to be "root" or
5541 "printeradmin"? This is probably due to <parameter>map to guest = bad
5542 user</parameter>, which silently connects you under the guest account,
5543 when you gave (maybe by accident) an incorrect username. Remove
5544 <parameter>map to guest</parameter>, if you want to prevent
5545 this.</para></listitem></varlistentry>
5547 <varlistentry><term>Upgrading to CUPS drivers from Adobe drivers on
5548 NT/2K/XP clients gives problems</term>
5549 <listitem><para>First delete all "old" Adobe-using printers. Then
5550 delete all "old" Adobe drivers. (On Win2K/XP, right-click in
5551 background of "Printers" folder, select "Server Properties...", select
5552 tab "Drivers" and delete here).</para></listitem></varlistentry>
5554 <varlistentry><term>I can't use "cupsaddsmb"on a Samba server which is
5556 <listitem><para>Do you use the "naked" root user name? Try to do it
5557 this way: <emphasis>cupsaddsmb -U DOMAINNAME\\root -v
5558 printername</emphasis> (note the two backslashes: the first one is
5559 required to "escape" the second one).</para></listitem></varlistentry>
5561 <varlistentry><term>I deleted a printer on Win2K; but I still see
5563 <listitem><para>Deleting a printer on the client won't delete the
5564 driver too (to verify, right-click on the white background of the
5565 "Printers" folder, select "Server Properties" and click on the
5566 "Drivers" tab). These same old drivers will be re-used when you try to
5567 install a printer with the same name. If you want to update to a new
5568 driver, delete the old ones first. Deletion is only possible if no
5569 other printer uses the same driver.</para></listitem></varlistentry>
5571 <varlistentry><term>Win2K/XP "Local Security
5573 <listitem><para><emphasis>Local Security Policies</emphasis> may not
5574 allow the installation of unsigned drivers. "Local Security Policies"
5575 may not allow the installation of printer drivers at
5576 all.</para></listitem></varlistentry>
5578 <varlistentry><term>WinXP clients: "Administrator can not install
5579 printers for all local users"</term>
5580 <listitem><para>Windows XP handles SMB printers on a "per-user" basis.
5581 This means every user needs to install the printer himself. To have a
5582 printer available for everybody, you might want to use the built-in
5583 IPP client capabilities of WinXP. Add a printer with the print path of
5584 <emphasis>http://cupsserver:631/printers/printername</emphasis>.
5585 Still looking into this one: maybe a "logon script" could
5586 automatically install printers for all
5587 users.</para></listitem></varlistentry>
5589 <varlistentry><term>"Print Change Notify" functions on
5591 <listitem><para>For "print change notify" functions on NT++ clients,
5592 these need to run the "Server" service first (re-named to
5593 <emphasis>File & Print Sharing for MS Networks</emphasis> in
5594 XP).</para></listitem></varlistentry>
5596 <varlistentry><term>WinXP-SP1</term>
5597 <listitem><para>WinXP-SP1 introduced a <emphasis>Point and Print
5598 Restriction Policy</emphasis> (this restriction doesn't apply to
5599 "Administrator" or "Power User" groups of users). In Group Policy
5600 Object Editor: go to <emphasis>User Configuration -->
5601 Administrative Templates --> Control Panel -->
5602 Printers</emphasis>. The policy is automatically set to
5603 <emphasis>Enabled</emphasis> and the <emphasis>Users can only Point
5604 and Print to machines in their Forest</emphasis> . You probably need
5605 to change it to <emphasis>Disabled</emphasis> or <emphasis>Users can
5606 only Point and Print to these servers</emphasis> in order to make
5607 driver downloads from Samba possible.</para></listitem></varlistentry>
5609 <varlistentry><term>I can't set and save default print options for all
5610 users on Win2K/XP</term>
5612 <listitem><para>How are you doing it? I bet the wrong way (it is not
5613 very easy to find out, though). There are 3 different ways to bring
5614 you to a dialog that <emphasis>seems</emphasis> to set everything. All
5615 three dialogs <emphasis>look</emphasis> the same. Only one of them
5616 <emphasis>does</emphasis> what you intend. You need to be
5617 Administrator or Print Administrator to do this for all users. Here
5618 is how I do in on XP:
5621 <orderedlist numeration="upperalpha">
5623 <listitem><para>The first "wrong" way:
5625 <orderedlist numeration="arabic">
5626 <listitem><para>Open the <emphasis>Printers</emphasis>
5627 folder.</para></listitem>
5629 <listitem><para>Right-click on the printer
5630 (<emphasis>remoteprinter on cupshost</emphasis>) and
5631 select in context menu <emphasis>Printing
5632 Preferences...</emphasis></para></listitem>
5634 <listitem><para>Look at this dialog closely and remember what it looks
5635 like.</para></listitem>
5640 <listitem><para>The second "wrong" way:
5642 <orderedlist numeration="arabic">
5643 <listitem><para>Open the <emphasis>Printers</emphasis>
5644 folder.</para></listitem>
5646 <listitem><para>Right-click on the printer (<emphasis>remoteprinter on
5647 cupshost</emphasis>) and select in the context menu
5648 <emphasis>Properties</emphasis></para></listitem>
5650 <listitem><para>Click on the <emphasis>General</emphasis>
5651 tab</para></listitem>
5653 <listitem><para>Click on the button <emphasis>Printing
5654 Preferences...</emphasis></para></listitem>
5656 <listitem><para>A new dialog opens. Keep this dialog open and go back
5657 to the parent dialog.</para></listitem>
5662 <listitem><para>The third, the "correct" way: (should you do
5663 this from the beginning, just carry out steps 1. and 2. from second
5666 <orderedlist numeration="arabic">
5667 <listitem><para>Click on the <emphasis>Advanced</emphasis>
5668 tab. (Hmmm... if everything is "Grayed Out", then you are not logged
5669 in as a user with enough privileges).</para></listitem>
5671 <listitem><para>Click on the <emphasis>Printing
5672 Defaults...</emphasis> button.</para></listitem>
5674 <listitem><para>On any of the two new tabs, click on the
5675 <emphasis>Advanced...</emphasis>
5676 button.</para></listitem>
5678 <listitem><para>A new dialog opens. Compare this one to the other,
5679 identical looking one from "B.5" or A.3".</para></listitem>
5686 Do you see any difference? I don't either... However, only the last
5687 one, which you arrived at with steps "C.1.-6." will save any settings
5688 permanently and be the defaults for new users. If you want all clients
5689 to get the same defaults, you need to conduct these steps <emphasis>as
5690 Administrator</emphasis> (<parameter>printer admin</parameter> in
5691 <filename>smb.conf</filename>) <emphasis>before</emphasis> a client
5692 downloads the driver (the clients can later set their own
5693 <emphasis>per-user defaults</emphasis> by following the
5694 procedures <emphasis>A.</emphasis> or <emphasis>B.</emphasis>
5695 above).</para></listitem></varlistentry>
5697 <varlistentry><term>What are the most common blunders in driver
5698 settings on Windows clients?</term>
5699 <listitem><para>Don't use <emphasis>Optimize for
5700 Speed</emphasis>: use <emphasis>Optimize for
5701 Portability</emphasis> instead (Adobe PS Driver) Don't use
5702 <emphasis>Page Independence: No</emphasis>: always
5703 settle with <emphasis>Page Independence:
5704 Yes</emphasis> (Microsoft PS Driver and CUPS PS Driver for
5705 WinNT/2K/XP) If there are problems with fonts: use
5706 <emphasis>Download as Softfont into
5707 printer</emphasis> (Adobe PS Driver). For
5708 <emphasis>TrueType Download Options</emphasis>
5709 choose <emphasis>Outline</emphasis>. Use PostScript
5710 Level 2, if you are having trouble with a non-PS printer, and if
5711 there is a choice.</para></listitem></varlistentry>
5713 <varlistentry><term>I can't make <command>cupsaddsmb</command> work
5714 with newly installed printer</term>
5715 <listitem><para>Symptom: the last command of
5716 <command>cupsaddsmb</command> doesn't complete successfully:
5717 <command>cmd = setdriver printername printername</command> result was
5718 NT_STATUS_UNSUCCESSFUL then possibly the printer was not yet
5719 "recognized" by Samba. Did it show up in <emphasis>Network
5720 Neighbourhood</emphasis>? Did it show up in <command>rpcclient
5721 hostname -c 'enumprinters'</command>? Restart smbd (or send a
5722 <command>kill -HUP</command> to all processes listed by
5723 <command>smbstatus</command> and try
5724 again.</para></listitem></varlistentry>
5726 <varlistentry><term>My permissions on
5727 <filename>/var/spool/samba/</filename> get reset after each
5729 <listitem><para>Have you by accident set the CUPS spool directory to
5730 the same location? (<parameter>RequestRoot
5731 /var/spool/samba/</parameter> in <filename>cupsd.conf</filename> or
5732 the other way round: <filename>/var/spool/cups/</filename> is set as
5733 <parameter>path</parameter> in the <parameter>[printers]</parameter>
5734 section). These <emphasis>must</emphasis> be different. Set
5735 <parameter>RequestRoot /var/spool/cups/</parameter> in
5736 <filename>cupsd.conf</filename> and <parameter>path =
5737 /var/spool/samba</parameter> in the <parameter>[printers]</parameter>
5738 section of <filename>smb.conf</filename>. Otherwise cupsd will
5739 sanitize permissions to its spool directory with each restart, and
5740 printing will not work reliably.</para></listitem></varlistentry>
5742 <varlistentry><term>My printers work fine: just the printer named "lp"
5743 intermittently swallows jobs and spits out completely different
5745 <listitem><para>It is a very bad idea to name any printer "lp". This
5746 is the traditional Unix name for the default printer. CUPS may be set
5747 up to do an automatic creation of "Implicit Classes". This means, to
5748 group all printers with the same name to a pool of devices, and
5749 loadbalancing the jobs across them in a round-robin fashion. Chances
5750 are high that someone else has an "lp" named printer too. You may
5751 receive his jobs and send your own to his device unwittingly. To have
5752 tight control over the printer names, set <parameter>BrowseShortNames
5753 No</parameter>. It will present any printer as "printername@cupshost"
5754 then, giving you a better control over what may happen in a large
5755 networked environment.</para></listitem></varlistentry>
5757 <varlistentry><term>How do I "watch" my Samba server?</term>
5758 <listitem><para>You can use <command>tail -f
5759 /var/log/samba/log.smbd</command> (you may need a different path) to
5760 see a live scrolling of all log messages. <command>smbcontrol smbd
5761 debuglevel</command> tells you which verbosity goes into the
5762 logs. <command>smbcontrol smbd debug 3</command> sets the verbosity to
5763 a quite high level (you can choose from 0 to 10 or 100). This works
5764 "on the fly", without the need to restart the smbd daemon. Don't use
5765 more than 3 initially; or you'll drown in an ocean of
5766 messages.</para></listitem></varlistentry>
5768 <varlistentry><term>I can't use Samba from my WinXP Home box, while
5769 access from WinXP Prof works flawlessly</term>
5770 <listitem><para>You have our condolences! WinXP home has been
5771 completely neutered by Microsoft as compared to WinXP Prof: you can
5772 not log into a WinNT domain. It cannot join a Win NT domain as a
5773 member server. While it is possible to access domain resources, users
5774 don't have "single sign-on". They need to supply username and password
5775 each time they connect to a resource. Logon scripts and roaming
5776 profiles are not supported. It can serve file and print shares; but
5777 only in "share-mode security" level. It can not use "user-mode
5778 security" (what Windows 95/98/ME still can
5779 do).</para></listitem></varlistentry>
5781 <varlistentry><term>Where do I find the Adobe PostScript driver files
5782 I need for "cupsaddsmb"?</term>
5783 <listitem><para>Use <command>smbclient</command> to connect to any
5784 Windows box with a shared PostScript printer: <command>smbclient
5785 //windowsbox/print\$ -U guest</command>. You can navigate to the
5786 <filename>W32X86/2</filename> subdir to <command>mget ADOBE*</command>
5787 and other files or to <filename>WIN40/0</filename> to do the same. --
5788 Another option is to download the <filename>*.exe</filename> packaged
5789 files from the Adobe website.</para></listitem></varlistentry>
5794 <title>An Overview of the CUPS Printing Processes</title>
5797 <figure><title>CUPS Printing Overview</title>
5799 <imageobject role="latex"><imagedata fileref="projdoc/imagefiles/a_small"/></imageobject>
5800 <imageobject><imagedata fileref="projdoc/imagefiles/a_small.png"/></imageobject>