1 <chapter id="CUPS-printing">
7 <firstname>Kurt</firstname><surname>Pfeifle</surname>
9 <address><email>kpfeifle@danka.de</email></address>
12 <pubdate> (25 March 2003) </pubdate>
15 <title>CUPS Printing Support</title>
18 <title>Introduction</title>
21 The Common Unix Print System (CUPS) has become very popular, but to many it is
22 a very mystical tool. There is a great deal of uncertainty regarding CUPS and how
23 it works. The result is seen in a large number of posting on the samba mailing lists
24 expressing frustration when MS Windows printers appear not to work with a CUPS
29 This is a good time to point out how CUPS can be used and what it does. CUPS is more
30 than just a print spooling system - it is a complete printer management system that
31 complies with HTTP and IPP protocols. It can be managed remotely via a web browser
32 and it can print using http and ipp protocols.
36 CUPS allows to creation of RAW printers (ie: NO file format translation) as well as
37 SMART printers (ie: CUPS does file format conversion as required for the printer). In
38 many ways this gives CUPS similar capabilities to the MS Windows print monitoring
39 system. Of course, if you are a CUPS advocate, you would agrue that CUPS is better!
40 In any case, let us now move on to explore how one may configure CUPS for interfacing
41 with MS Windows print clients via Samba.
45 <ulink url="http://www.cups.org/">CUPS</ulink> is a newcomer in the UNIX printing scene,
46 which has convinced many people upon first trial already. However, it has quite a few
47 new features, which make it different from other, more traditional printing systems.
53 <title>Configuring <filename>smb.conf</filename> for CUPS</title>
56 Printing with CUPS in the most basic <filename>smb.conf</filename>
57 setup in Samba-3 only needs two settings: <command>printing = cups</command> and
58 <command>printcap = cups</command>. While CUPS itself doesn't need a printcap
59 anymore, the <filename>cupsd.conf</filename> configuration file knows two directives
60 (example: <command>Printcap /etc/printcap</command> and <command>PrintcapFormat
61 BSD</command>), which control if such a file should be created for the
62 convenience of third party applications. Make sure it is set! For details see
63 <command>man cupsd.conf</command> and other CUPS-related documentation.
67 If SAMBA is compiled against libcups, then <command>printcap = cups</command> uses the
68 CUPS API to list printers, submit jobs, etc. Otherwise it maps to the System V commands
69 with an additional <parameter>-oraw</parameter> option for printing. On a Linux system,
70 you can use the <command>ldd</command> command to find out details (ldd may not be
71 present on other OS platforms, or its function may be embodied by a different command):
75 <programlisting>transmeta:/home/kurt # ldd `which smbd`
76 libssl.so.0.9.6 => /usr/lib/libssl.so.0.9.6 (0x4002d000)
77 libcrypto.so.0.9.6 => /usr/lib/libcrypto.so.0.9.6 (0x4005a000)
78 libcups.so.2 => /usr/lib/libcups.so.2 (0x40123000)
79 libdl.so.2 => /lib/libdl.so.2 (0x401e8000)
80 libnsl.so.1 => /lib/libnsl.so.1 (0x401ec000)
81 libpam.so.0 => /lib/libpam.so.0 (0x40202000)
82 libc.so.6 => /lib/libc.so.6 (0x4020b000)
83 /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
84 </programlisting></para>
87 The line "libcups.so.2 => /usr/lib/libcups.so.2
88 (0x40123000)" shows there is CUPS support compiled into this version of
89 Samba. If this is the case, and <command>printing = cups</command> is set, then any
90 otherwise manually set print command in smb.conf is ignored.
95 <title>CUPS - RAW Print Through Mode</title>
99 When used in raw print through mode is will be necessary to use the printer
100 vendor's drivers in each Windows client PC.
105 When CUPS printers are configured for RAW print-through mode operation it is the
106 responsibility of the Samba client to fully render the print job (file) in a format
107 that is suitable for direct delivery to the printer. In this case CUPS will NOT
108 do any print file format conversion work.
112 The CUPS files that need to be correctly set for RAW mode printers to work are:
115 <listitem><para><filename>/etc/cups/mime.types</filename><para></listitem>
116 <listitem><para><filename>/etc/cups/mime.convs</filename><para></listitem>
119 Both contain entries that must be uncommented to allow <emphasis>RAW</emphasis> mode
124 Firstly, to enable CUPS based printing from Samba the following options must be
125 enabled in your smb.conf file [globals] section:
128 <listitem><para>printing = CUPS</para></listitem>
130 <listitem><para>printcap = CUPS</para></listitem>
133 When these parameters are specified the print directives in smb.conf (as well as in
134 samba itself) will be ignored because samba will directly interface with CUPS through
135 it's application program interface (API) - so long as Samba has been compiled with
136 CUPS library (libcups) support. If samba has NOT been compiled with CUPS support then
137 printing will use the System V AT&T command set with the <emphasis>-oraw</emphasis>
138 option automatically passing through.
142 Cupsomatic (an enhanced printing utility that is part of some CUPS implementations)
143 on the Samba/CUPS server does *not* add any features if a file is really
144 printed "raw". However, if you have loaded the driver for the Windows client from
145 the CUPS server, using the "cupsaddsmb" utility, and if this driver is one using
146 a "Foomatic" PPD, the PJL header in question is already added on the Windows client,
147 at the time when the driver initially generated the PostScript data and CUPS in true
148 "-oraw" manner doesn't remove this PJL header and passes the file "as is" to its
149 printer communication backend.
152 <note><para>NOTE: editing in the "mime.convs" and the "mime.types" file does not *enforce*
153 "raw" printing, it only *allows* it.</para></note>
156 Print files that arrive from MS Windows printing are "auto-typed" by CUPS. This aids
157 the process of determining proper treatment while in the print queue system.
161 Files generated by PCL drivers and directed at PCK printers get auto-typed as
162 <filename>application/octet-stream</filename>. Unknown file format types also
163 get auto-typed with this tag.
167 Files generated by a Postscript driver and directed at a Postscript printer
168 are auto-typed depending on the auto-detected most suitable MIME type as:
171 <listitem><para>* application/postscript</para></listitem>
172 <listitem><para>* application/vnd.cups-postscript</para></listitem>
180 "application/postscript" first goes thru the "pstops" filter (where the page counting
181 and accounting takes place). The outcome will be of MIME type
182 "application/vnd.cups-postscript". The pstopsfilter reads and uses information from
183 the PPD and inserts user-provided options into the PostScript file. As a consequence,
184 the filtered file could possibly have an unwanted PJL header.
188 "application/postscript" will be all files with a ".ps", ".ai", ".eps" suffix or which
189 have as their first character string one of "%!" or "<04>%".
193 "application/vnd.cups-postscript" will files which contain the string
194 "LANGUAGE=POSTSCRIPT" (or similar variations with different capitalization) in the
195 first 512 bytes, and also contain the "PJL super escape code" in the first 128 bytes
196 ("<1B>%-12345X"). Very likely, most PostScript files generated on Windows using a CUPS
197 or other PPD, will have to be auto-typed as "vnd.cups-postscript". A file produced
198 with a "Generic PostScript driver" will just be tagged "application/postscript".
202 Once the file is in "application/vnd.cups-postscript" format, either "pstoraster"
203 or "cupsomatic" will take over (depending on the printer configuration, as
204 determined by the PPD in use).
208 A printer queue with *no* PPD associated to it is a "raw" printer and all files
209 will go directly there as received by the spooler. The exeptions are file types
210 "application/octet-stream" which need "passthrough feature" enabled.
211 "Raw" queues don't do any filtering at all, they hand the file directly to the
212 CUPS backend. This backend is responsible for the sending of the data to the device
213 (as in the "device URI" notation as lpd://, socket://, smb://, ipp://, http://,
214 parallel:/, serial:/, usb:/ etc.)
218 "cupsomatic"/Foomatic are *not* native CUPS drivers and they don't ship with CUPS.
219 They are a Third Party add-on, developed at Linuxprinting.org. As such, they are
220 a brilliant hack to make all models (driven by Ghostscript drivers/filters in
221 traditional spoolers) also work via CUPS, with the same (good or bad!) quality
222 as in these other spoolers. "cupsomatic" is only a vehicle to execute a ghostscript
223 commandline at that stage in the CUPS filtering chain, where "normally" the native
224 CUPS "pstoraster" filter would kick in. cupsomatic by-passes pstoraster, "kidnaps"
225 the printfile from CUPS away and re-directs it to go through Ghostscipt. CUPS accepts this,
226 because the associated CUPS-O-Matic-/Foomatic-PPD specifies:
230 *cupsFilter: "application/vnd.cups-postscript 0 cupsomatic"
234 This line persuades CUPS to hand the file to cupsomatic, once it has successfully
235 converted it to the MIME type "application/vnd.cups-postscript". This conversion will not
236 happen for Jobs arriving from Windows which are auto-typed "application/octet-stream",
237 with the according changes in "/etc/cups/mime.types" in place.
241 CUPS is widely configurable and flexible, even regarding its filtering mechanism.
242 Another workaround in some situations would be to have
243 in "/etc/cups/mime.types" entries as follows:
247 application/postscript application/vnd.cups-raw 0 -
248 application/vnd.cups-postscript application/vnd.cups-raw 0 -
252 This would prevent all Postscript files from being filtered (rather, they will go
253 thru the virtual "nullfilter" denoted with "-"). This could only be useful for
254 PS printers. If you want to print PS code on non-PS printers an entry as follows
259 */* application/vnd.cups-raw 0 -
263 and would effectively send *all* files to the backend without further processing.
267 Lastly, you could have the following entry:
271 application/vnd.cups-postscript application/vnd.cups-raw 0 my_PJL_stripping_filter
275 You will need to write a "my_PJL_stripping_filter" (could be a shellscript) that
276 parses the PostScript and removes the unwanted PJL. This would need to conform to
277 CUPS filter design (mainly, receive and pass the parameters printername, job-id,
278 username, jobtitle, copies, print options and possibly the filename). It would
279 be installed as world executable into "/usr/lib/cups/filters/" and will be called
280 by CUPS if it encounters a MIME type "application/vnd.cups-postscript".
284 CUPS can handle "-o job-hold-until=indefinite". This keeps the job in the queue
285 "on hold". It will only be printed upon manual release by the printer operator.
286 This is a requirement in many "central reproduction departments", where a few
287 operators manage the jobs of hundreds of users on some big machine, where no
288 user is allowed to have direct access. (The operators often need to load the
289 proper paper type before running the 10.000 page job requested by marketing
290 for the mailing, etc.).
296 <title>CUPS as a network PostScript RIP -- CUPS drivers working on server, Adobe
297 PostScript driver with CUPS-PPDs downloaded to clients</title>
301 CUPS is perfectly able to use PPD files (PostScript
302 Printer Descriptions). PPDs can control all print device options. They
303 are usually provided by the manufacturer -- if you own a PostSript printer,
304 that is. PPD files are always a component of PostScript printer drivers on MS
305 Windows or Apple Mac OS systems. They are ASCII files containing
306 user-selectable print options, mapped to appropriate PostScript, PCL or PJL
307 commands for the target printer. Printer driver GUI dialogs translate these
308 options "on-the-fly" into buttons and drop-down lists for the user to
313 CUPS can load, without any conversions, the PPD file from
314 any Windows (NT is recommended) PostScript driver and handle the options.
315 There is a web browser interface to the print options (select
316 http://localhost:631/printers/ and click on one "Configure Printer" button
317 to see it), a commandline interface (see <command>man lpoptions</command> or
318 try if you have <command>lphelp</command> on your system) plus some different GUI frontends on Linux
319 UNIX, which can present PPD options to the users. PPD options are normally
320 meant to become evaluated by the PostScript RIP on the real PostScript
325 CUPS doesn't stop at "real" PostScript printers in its
326 usage of PPDs. The CUPS developers have extended the PPD concept, to also
327 describe available device and driver options for non-PostScript printers
332 This is logical, as CUPS includes a fully featured
333 PostScript interpreter (RIP). This RIP is based on Ghostscript. It can
334 process all received PostScript (and additionally many other file formats)
335 from clients. All CUPS-PPDs geared to non-PostScript printers contain an
336 additional line, starting with the keyword <parameter>*cupsFilter</parameter>.
338 tells the CUPS print system which printer-specific filter to use for the
339 interpretation of the accompanying PostScript. Thus CUPS lets all its
340 printers appear as PostScript devices to its clients, because it can act as a
341 PostScript RIP for those printers, processing the received PostScript code
342 into a proper raster print format.
346 CUPS-PPDs can also be used on Windows-Clients, on top of a
347 PostScript driver (recommended is the Adobe one).
351 This feature enables CUPS to do a few tricks no other
356 <listitem><para>act as a networked PostScript RIP (Raster Image Processor), handling
357 printfiles from all client platforms in a uniform way;</para></listitem>
358 <listitem><para>act as a central accounting and billing server, as all files are passed
359 through the <command>pstops</command> Filter and are therefor logged in
360 the CUPS <filename>page_log</filename>. - <emphasis>NOTE: </emphasis>this
361 can not happen with "raw" print jobs, which always remain unfiltered
362 per definition;</para></listitem>
363 <listitem><para>enable clients to consolidate on a single PostScript driver, even for
364 many different target printers.</para></listitem>
369 <title>Windows Terminal Servers (WTS) as CUPS clients</title>
372 This setup may be of special interest to people
373 experiencing major problems in WTS environments. WTS need often a multitude
374 of non-PostScript drivers installed to run their clients' variety of
375 different printer models. This often imposes the price of much increased
376 instability. In many cases, in an attempt to overcome this problem, site
377 administrators have resorted to restrict the allowed drivers installed on
378 their WTS to one generic PCL- and one PostScript driver. This however
379 restricts the clients in the amount of printer options available for them --
380 often they can't get out more then simplex prints from one standard paper
381 tray, while their devices could do much better, if driven by a different
386 Using an Adobe PostScript driver, enabled with a CUPS-PPD,
387 seems to be a very elegant way to overcome all these shortcomings. The
388 PostScript driver is not known to cause major stability problems on WTS (even
389 if used with many different PPDs). The clients will be able to (again) chose
390 paper trays, duplex printing and other settings. However, there is a certain
391 price for this too: a CUPS server acting as a PostScript RIP for its clients
392 requires more CPU and RAM than just to act as a "raw spooling" device. Plus,
393 this setup is not yet widely tested, although the first feedbacks look very
400 <title>Setting up CUPS for driver download</title>
403 The <command>cupsadsmb</command> utility (shipped with all current
404 CUPS versions) makes the sharing of any (or all) installed CUPS printers very
405 easy. Prior to using it, you need the following settings in smb.conf:
408 <para><programlisting>[global]
414 comment = All Printers
415 path = /var/spool/samba
424 comment = Printer Drivers
425 path = /etc/samba/drivers
430 </programlisting></para>
433 For licensing reasons the necessary files of the Adobe
434 Postscript driver can not be distributed with either Samba or CUPS. You need
435 to download them yourself from the Adobe website. Once extracted, create a
436 <filename>drivers</filename> directory in the CUPS data directory (usually
437 <filename>/usr/share/cups/</filename>). Copy the Adobe files using
438 UPPERCASE filenames, to this directory as follows:
441 <para><programlisting>
450 </programlisting></para>
453 Users of the ESP Print Pro software are able to install
454 their "Samba Drivers" package for this purpose with no problem.
461 <title>Sources of CUPS drivers / PPDs</title>
464 On the internet you can find now many thousand CUPS-PPD
465 files (with their companion filters), in many national languages,
466 supporting more than 1.000 non-PostScript models.
470 <listitem><para><ulink url="http://wwwl.easysw.com/printpro/">ESP PrintPro
471 (http://wwwl.easysw.com/printpro/)</ulink>
472 (commercial, non-Free) is packaged with more than 3.000 PPDs, ready for
473 successful usage "out of the box" on Linux, IBM-AIX, HP-UX, Sun-Solaris,
474 SGI-IRIX, Compaq Tru64, Digital Unix and some more commercial Unices (it
475 is written by the CUPS developers themselves and its sales help finance
476 the further development of CUPS, as they feed their creators)</para></listitem>
477 <listitem><para>the <ulink
478 url="http://gimp-print.sourceforge.net/">Gimp-Print-Project
479 (http://gimp-print.sourceforge.net/)</ulink>
480 (GPL, Free Software) provides around 120 PPDs (supporting nearly 300
481 printers, many driven to photo quality output), to be used alongside the
482 Gimp-Print CUPS filters;</para></listitem>
483 <listitem><para><ulink url="http://www.turboprint.com/">TurboPrint
484 (http://www.turboprint.com/)</ulink>
485 (Shareware, non-Freee) supports roughly the same amount of printers in
486 excellent quality;</para></listitem>
487 <listitem><para><ulink
488 url="http://www-124.ibm.com/developerworks/oss/linux/projects/omni/">OMNI
489 (http://www-124.ibm.com/developerworks/oss/linux/projects/omni/)</ulink>
490 (LPGL, Free) is a package made by IBM, now containing support for more
491 than 400 printers, stemming from the inheritance of IBM OS/2 KnowHow
492 ported over to Linux (CUPS support is in a Beta-stage at present);</para></listitem>
493 <listitem><para><ulink url="http://hpinkjet.sourceforge.net/">HPIJS
494 (http://hpinkjet.sourceforge.net/)</ulink>
495 (BSD-style licnes, Free) supports around 120 of HP's own printers and is
496 also providing excellent print quality now;</para></listitem>
497 <listitem><para><ulink
498 url="http://www.linuxprinting.org/">Foomatic/cupsomatic (http://www.linuxprinting.org/)</ulink>
499 (LPGL, Free) from Linuxprinting.org are providing PPDs for practically every
500 Ghostscript filter known to the world, now usable with CUPS.</para></listitem>
504 <emphasis>NOTE: </emphasis>the cupsomatic trick from Linuxprinting.org is
505 working different from the other drivers. While the other drivers take the
506 generic CUPS raster (produced by CUPS' own pstoraster PostScript RIP) as
507 their input, cupsomatic "kidnaps" the PostScript inside CUPS, before
508 RIP-ping, deviates it to an external Ghostscript installation (which now
509 becomes the RIP) and gives it back to a CUPS backend once Ghostscript is
510 finished. -- CUPS versions from 1.1.15 and later will provide their pstoraster
511 PostScript RIP function again inside a system-wide Ghostscript
512 installation rather than in "their own" pstoraster filter. (This
513 CUPS-enabling Ghostscript version may be installed either as a
514 patch to GNU or AFPL Ghostscript, or as a complete ESP Ghostscript package).
515 However, this will not change the cupsomatic approach of guiding the printjob
516 along a different path through the filtering system than the standard CUPS
521 Once you installed a printer inside CUPS with one of the
522 recommended methods (the lpadmin command, the web browser interface or one of
523 the available GUI wizards), you can use <command>cupsaddsmb</command> to share the
524 printer via Samba. <command>cupsaddsmb</command> prepares the driver files for
525 comfortable client download and installation upon their first contact with
532 <title><command>cupsaddsmb</command></title>
536 The <command>cupsaddsmb</command> command copies the needed files
537 for convenient Windows client installations from the previously prepared CUPS
538 data directory to your [print$] share. Additionally, the PPD
539 associated with this printer is copied from <filename>/etc/cups/ppd/</filename> to
543 <para><programlisting>
544 <prompt>root# </prompt> <command>cupsaddsmb -U root infotec_IS2027</command>
545 Password for root required to access localhost via SAMBA: <userinput>[type in password 'secret']</userinput>
546 </programlisting></para>
549 To share all printers and drivers, use the <parameter>-a</parameter>
550 parameter instead of a printer name.
555 Probably you want to see what's going on. Use the
556 <parameter>-v</parameter> parameter to get a more verbose output:
560 Probably you want to see what's going on. Use the
561 <parameter>-v</parameter> parameter to get a more verbose output:
564 <para><programlisting>
565 Note: The following line shave been wrapped so that information is not lost.
567 <prompt>root# </prompt> cupsaddsmb -v -U root infotec_IS2027
568 Password for root required to access localhost via SAMBA:
569 Running command: smbclient //localhost/print\$ -N -U'root%secret' -c 'mkdir W32X86;put
570 /var/spool/cups/tmp/3cd1cc66376c0 W32X86/infotec_IS2027.PPD;put /usr/share/cups/drivers/
571 ADOBEPS5.DLL W32X86/ADOBEPS5.DLL;put /usr/share/cups/drivers/ADOBEPSU.DLLr
572 W32X86/ADOBEPSU.DLL;put /usr/share/cups/drivers/ADOBEPSU.HLP W32X86/ADOBEPSU.HLP'
573 added interface ip=10.160.16.45 bcast=10.160.31.255 nmask=255.255.240.0
574 added interface ip=192.168.182.1 bcast=192.168.182.255 nmask=255.255.255.0
575 added interface ip=172.16.200.1 bcast=172.16.200.255 nmask=255.255.255.0
576 Domain=[TUX-NET] OS=[Unix] Server=[Samba 2.2.3a.200204262025cvs]
577 NT_STATUS_OBJECT_NAME_COLLISION making remote directory \W32X86
578 putting file /var/spool/cups/tmp/3cd1cc66376c0 as \W32X86/infotec_IS2027.PPD (17394.6 kb/s)
579 (average 17395.2 kb/s)
580 putting file /usr/share/cups/drivers/ADOBEPS5.DLL as \W32X86/ADOBEPS5.DLL (10877.4 kb/s)
581 (average 11343.0 kb/s)
582 putting file /usr/share/cups/drivers/ADOBEPSU.DLL as \W32X86/ADOBEPSU.DLL (5095.2 kb/s)
583 (average 9260.4 kb/s)
584 putting file /usr/share/cups/drivers/ADOBEPSU.HLP as \W32X86/ADOBEPSU.HLP (8828.7 kb/s)
585 (average 9247.1 kb/s)
587 Running command: smbclient //localhost/print\$ -N -U'root%secret' -c 'mkdir WIN40;put
588 /var/spool/cups/tmp/3cd1cc66376c0 WIN40/infotec_IS2027.PPD;put
589 /usr/share/cups/drivers/ADFONTS.MFM WIN40/ADFONTS.MFM;put
590 /usr/share/cups/drivers/ADOBEPS4.DRV WIN40/ADOBEPS4.DRV;put
591 /usr/share/cups/drivers/ADOBEPS4.HLP WIN40/ADOBEPS4.HLP;put
592 /usr/share/cups/drivers/DEFPRTR2.PPD WIN40/DEFPRTR2.PPD;put
593 /usr/share/cups/drivers/ICONLIB.DLL WIN40/ICONLIB.DLL;put
594 /usr/share/cups/drivers/PSMON.DLL WIN40/PSMON.DLL;'
595 added interface ip=10.160.16.45 bcast=10.160.31.255 nmask=255.255.240.0
596 added interface ip=192.168.182.1 bcast=192.168.182.255 nmask=255.255.255.0
597 added interface ip=172.16.200.1 bcast=172.16.200.255 nmask=255.255.255.0
598 Domain=[TUX-NET] OS=[Unix] Server=[Samba 2.2.3a.200204262025cvs]
599 NT_STATUS_OBJECT_NAME_COLLISION making remote directory \WIN40
600 putting file /var/spool/cups/tmp/3cd1cc66376c0 as \WIN40/infotec_IS2027.PPD (26091.5 kb/s)
601 (average 26092.8 kb/s)
602 putting file /usr/share/cups/drivers/ADFONTS.MFM as \WIN40/ADFONTS.MFM (11241.6 kb/s)
603 (average 11812.9 kb/s)
604 putting file /usr/share/cups/drivers/ADOBEPS4.DRV as \WIN40/ADOBEPS4.DRV (16640.6 kb/s)
605 (average 14679.3 kb/s)
606 putting file /usr/share/cups/drivers/ADOBEPS4.HLP as \WIN40/ADOBEPS4.HLP (11285.6 kb/s)
607 (average 14281.5 kb/s)
608 putting file /usr/share/cups/drivers/DEFPRTR2.PPD as \WIN40/DEFPRTR2.PPD (823.5 kb/s)
609 (average 12944.0 kb/s)
610 putting file /usr/share/cups/drivers/ICONLIB.DLL as \WIN40/ICONLIB.DLL (19226.2 kb/s)
611 (average 13169.7 kb/s)
612 putting file /usr/share/cups/drivers/PSMON.DLL as \WIN40/PSMON.DLL (18666.1 kb/s)
613 (average 13266.7 kb/s)
615 Running command: rpcclient localhost -N -U'root%secret' -c 'adddriver "Windows NT x86"
616 "infotec_IS2027:ADOBEPS5.DLL:infotec_IS2027.PPD:ADOBEPSU.DLL:ADOBEPSU.HLP:NULL:RAW:NULL"'
617 cmd = adddriver "Windows NT x86" "infotec_IS2027:ADOBEPS5.DLL:infotec_IS2027.PPD:ADOBEPSU.DLL:
618 ADOBEPSU.HLP:NULL:RAW:NULL"
619 Printer Driver infotec_IS2027 successfully installed.
621 Running command: rpcclient localhost -N -U'root%secret' -c 'adddriver "Windows 4.0"
622 "infotec_IS2027:ADOBEPS4.DRV:infotec_IS2027.PPD:NULL:ADOBEPS4.HLP:PSMON.DLL:RAW:
623 ADFONTS.MFM,DEFPRTR2.PPD,ICONLIB.DLL"'
624 cmd = adddriver "Windows 4.0" "infotec_IS2027:ADOBEPS4.DRV:infotec_IS2027.PPD:NULL:
625 ADOBEPS4.HLP:PSMON.DLL:RAW:ADFONTS.MFM,DEFPRTR2.PPD,ICONLIB.DLL"
626 Printer Driver infotec_IS2027 successfully installed.
628 Running command: rpcclient localhost -N -U'root%secret'
629 -c 'setdriver infotec_IS2027 infotec_IS2027'
630 cmd = setdriver infotec_IS2027 infotec_IS2027
631 Succesfully set infotec_IS2027 to driver infotec_IS2027.
633 <prompt>root# </prompt>
634 </programlisting></para>
637 If you look closely, you'll discover your root password was transfered unencrypted over
638 the wire, so beware! Also, if you look further her, you'll discover error messages like
639 <constant>NT_STATUS_OBJECT_NAME_COLLISION</constant> in between. They occur, because
640 the directories <filename>WIN40</filename> and <filename>W32X86</filename> already
641 existed in the [print$] driver download share (from a previous driver
642 installation). They are harmless here.
646 Now your printer is prepared for the clients to use. From
647 a client, browse to the CUPS/Samba server, open the "Printers"
648 share, right-click on this printer and select "Install..." or
649 "Connect..." (depending on the Windows version you use). Now their
650 should be a new printer in your client's local "Printers" folder,
651 named (in my case) "infotec_IS2027 on kdebitshop"
655 <emphasis>NOTE: </emphasis>
656 <command>cupsaddsmb</command> will only reliably work i
657 with CUPS version 1.1.15 or higher
658 and Samba from 2.2.4. If it doesn't work, or if the automatic printer
659 driver download to the clients doesn't succeed, you can still manually
660 install the CUPS printer PPD on top of the Adobe PostScript driver on
661 clients and then point the client's printer queue to the Samba printer
662 share for connection, should you desire to use the CUPS networked
663 PostScript RIP functions.
670 <title>The CUPS Filter Chains</title>
673 The following diagrams reveal how CUPS handles print jobs.
677 #########################################################################
679 # CUPS in and of itself has this (general) filter chain (CAPITAL
680 # letters are FILE-FORMATS or MIME types, other are filters (this is
681 # true for pre-1.1.15 of pre-4.3 versions of CUPS and ESP PrintPro):
683 # <replaceable>SOMETHNG</replaceable>-FILEFORMAT
687 # <replaceable>something</replaceable>tops
691 # APPLICATION/POSTSCRIPT
699 # APPLICATION/VND.CUPS-POSTSCRIPT
703 # pstoraster # as shipped with CUPS, independent from any Ghostscipt
704 # | # installation on the system
705 # | (= "postscipt interpreter")
708 # APPLICATION/VND.CUPS-RASTER
712 # rasterto<replaceable>something</replaceable> (f.e. Gimp-Print filters may be plugged in here)
713 # | (= "raster driver")
716 # SOMETHING-DEVICE-SPECIFIC
723 # ESP PrintPro has some enhanced "rasterto<replaceable>something</replaceable>" filters as compared to
724 # CUPS, and also a somewhat improved "pstoraster" filter.
726 # NOTE: Gimp-Print and some other 3rd-Party-Filters (like TurboPrint) to
727 # CUPS and ESP PrintPro plug-in where rasterto<replaceable>something</replaceable> is noted.
729 #########################################################################
733 #########################################################################
735 # This is how "cupsomatic" comes into play:
736 # =========================================
738 # <replaceable>SOMETHNG</replaceable>-FILEFORMAT
742 # <replaceable>something</replaceable>tops
746 # APPLICATION/POSTSCRIPT
754 # APPLICATION/VND.CUPS-POSTSCRIPT ----------------+
758 # pstoraster (constructs complicated
759 # | (= "postscipt interpreter") Ghostscript commandline
760 # | to let the file be
762 # APPLICATION/VND.CUPS-RASTER "-sDEVICE=<replaceable>s.th.</replaceable>"
766 # rasterto<replaceable>something</replaceable> V
767 # | (= "raster driver") +-------------------------+
768 # | | Ghostscript at work.... |
770 # SOMETHING-DEVICE-SPECIFIC *-------------------------+
774 # backend >------------------------------------+
781 # Note, that cupsomatic "kidnaps" the printfile after the
782 # "APPLICATION/VND.CUPS-POSTSCRPT" stage and deviates it through
783 # the CUPS-external, systemwide Ghostscript installation, bypassing the
784 # "pstoraster" filter (therefor also bypassing the CUPS-raster-drivers
785 # "rasterto<replaceable>something</replaceable>", and hands the rasterized file directly to the CUPS
788 # cupsomatic is not made by the CUPS developers. It is an independent
789 # contribution to printing development, made by people from
790 # Linuxprinting.org. (see also http://www.cups.org/cups-help.html)
792 # NOTE: Gimp-Print and some other 3rd-Party-Filters (like TurboPrint) to
793 # CUPS and ESP PrintPro plug-in where rasterto<replaceable>something</replaceable> is noted.
795 #########################################################################
799 #########################################################################
801 # And this is how it works for ESP PrintPro from 4.3:
802 # ===================================================
804 # <replaceable>SOMETHNG</replaceable>-FILEFORMAT
808 # <replaceable>something</replaceable>tops
812 # APPLICATION/POSTSCRIPT
820 # APPLICATION/VND.CUPS-POSTSCRIPT
825 # | (= "postscipt interpreter")
828 # APPLICATION/VND.CUPS-RASTER
832 # rasterto<replaceable>something</replaceable> (f.e. Gimp-Print filters may be plugged in here)
833 # | (= "raster driver")
836 # SOMETHING-DEVICE-SPECIFIC
842 # NOTE: Gimp-Print and some other 3rd-Party-Filters (like TurboPrint) to
843 # CUPS and ESP PrintPro plug-in where rasterto<replaceable>something</replaceable> is noted.
845 #########################################################################
849 #########################################################################
851 # This is how "cupsomatic" would come into play with ESP PrintPro:
852 # ================================================================
855 # <replaceable>SOMETHNG</replaceable>-FILEFORMAT
859 # <replaceable>something</replaceable>tops
863 # APPLICATION/POSTSCRIPT
871 # APPLICATION/VND.CUPS-POSTSCRIPT ----------------+
875 # gsrip (constructs complicated
876 # | (= "postscipt interpreter") Ghostscript commandline
877 # | to let the file be
879 # APPLICATION/VND.CUPS-RASTER "-sDEVICE=<replaceable>s.th.</replaceable>"
883 # rasterto<replaceable>something</replaceable> V
884 # | (= "raster driver") +-------------------------+
885 # | | Ghostscript at work.... |
887 # SOMETHING-DEVICE-SPECIFIC *-------------------------+
891 # backend >------------------------------------+
897 # NOTE: Gimp-Print and some other 3rd-Party-Filters (like TurboPrint) to
898 # CUPS and ESP PrintPro plug-in where rasterto<replaceable>something</replaceable> is noted.
900 #########################################################################
904 #########################################################################
906 # And this is how it works for CUPS from 1.1.15:
907 # ==============================================
909 # <replaceable>SOMETHNG</replaceable>-FILEFORMAT
913 # <replaceable>something</replaceable>tops
917 # APPLICATION/POSTSCRIPT
925 # APPLICATION/VND.CUPS-POSTSCRIPT-----+
927 # +------------------v------------------------------+
931 # | "-sDEVICE=cups") |
933 # | (= "postscipt interpreter") |
935 # +------------------v------------------------------+
938 # APPLICATION/VND.CUPS-RASTER >-------+
942 # rasterto<replaceable>something</replaceable>
943 # | (= "raster driver")
946 # SOMETHING-DEVICE-SPECIFIC
953 # NOTE: since version 1.1.15 CUPS "outsourced" the pstoraster process to
954 # Ghostscript. GNU Ghostscript needs to be patched to handle the
955 # CUPS requirement; ESP Ghostscript has this builtin. In any case,
956 # "gs -h" needs to show up a "cups" device. pstoraster is now a
957 # calling an appropriate "gs -sDEVICE=cups..." commandline to do
958 # the job. It will output "application/vnd.cup-raster", which will
959 # be finally processed by a CUPS raster driver "rasterto<replaceable>something</replaceable>"
960 # Note the difference to "cupsomatic", which will *not* output
961 # CUPS-raster, but a final version of the printfile, ready to be
962 # sent to the printer. cupsomatic also doesn't use the "cups"
963 # devicemode in Ghostscript, but one of the classical devicemodes....
965 # NOTE: Gimp-Print and some other 3rd-Party-Filters (like TurboPrint) to
966 # CUPS and ESP PrintPro plug-in where rasterto<replaceable>something</replaceable> is noted.
968 #########################################################################
972 #########################################################################
974 # And this is how it works for CUPS from 1.1.15, with cupsomatic included:
975 # ========================================================================
977 # <replaceable>SOMETHNG</replaceable>-FILEFORMAT
981 # <replaceable>something</replaceable>tops
985 # APPLICATION/POSTSCRIPT
993 # APPLICATION/VND.CUPS-POSTSCRIPT-----+
995 # +------------------v------------------------------+
996 # | Ghostscript . Ghostscript at work.... |
997 # | at work... . (with "-sDEVICE= |
998 # | (with . <replaceable>s.th.</replaceable>" |
999 # | "-sDEVICE=cups") . |
1001 # | (CUPS standard) . (cupsomatic) |
1003 # | (= "postscript interpreter") |
1005 # +------------------v--------------v---------------+
1008 # APPLICATION/VND.CUPS-RASTER >-------+ |
1012 # rasterto<replaceable>something</replaceable> |
1013 # | (= "raster driver") |
1016 # SOMETHING-DEVICE-SPECIFIC >------------------------+
1023 # NOTE: Gimp-Print and some other 3rd-Party-Filters (like TurboPrint) to
1024 # CUPS and ESP PrintPro plug-in where rasterto<replaceable>something</replaceable> is noted.
1026 ##########################################################################
1033 <title>CUPS Print Drivers and Devices</title>
1036 CUPS ships with good support for HP LaserJet type printers. You can install
1037 the driver as follows:
1041 lpadmin -p laserjet4plus -v parallel:/dev/lp0 -E -m laserjet.ppd
1045 (The "-m" switch will retrieve the "laserjet.ppd" from the standard repository
1046 for not-yet-installed-PPDs, which CUPS typically stores in
1047 <filename>/usr/share/cups/model</filename>. Alternatively, you may use
1048 "-P /absolute/filesystem/path/to/where/there/is/PPD/your.ppd").
1052 <title>Further printing steps</title>
1055 Always also consult the database on linuxprinting.org for all recommendations
1056 about which driver is best used for each printer:
1059 <para><ulink url="http://www.linuxprinting.org/printer_list.cgi">http://www.linuxprinting.org/printer_list.cgi</ulink></para>
1062 There select your model and click on "Show". You'll arrive at a page listing
1063 all drivers working with your model. There will always be *one*
1064 <emphasis>recommended</emphasis> one. Try this one first. In your case
1065 ("HP LaserJet 4 Plus"), you'll arrive here:
1068 <para><ulink url="http://www.linuxprinting.org/show_printer.cgi?recnum=75104">http://www.linuxprinting.org/show_printer.cgi?recnum=75104</ulink></para>
1071 The recommended driver is "ljet4". It has a link to the page for the ljet4
1075 <para><ulink url="http://www.linuxprinting.org/show_driver.cgi?driver=ljet4">http://www.linuxprinting.org/show_driver.cgi?driver=ljet4</ulink>
1078 On the driver's page, you'll find important and detailed info about how to use
1079 that driver within the various available spoolers. You can generate a PPD for
1080 CUPS. The PPD contains all the info about how to use your model and the driver;
1081 this is, once installed, working transparently for the user -- you'll only
1082 need to choose resolution, paper size etc. from the web-based menu or from
1083 the print dialog GUI or from the commandline...
1087 On the driver's page, choose to use the "PPD-O-Matic" online PPD generator
1088 program. Select your model and click "Generate PPD file". When you safe the
1089 appearing ASCII text file, don't use "cut'n'past" (as it could possiblly corrupt
1090 line endings and tabs), but use "Save as..." in your browser's menu. Save it
1091 at "/some/path/on/your/filesystem/somewhere/my-name-for-my-printer.ppd"
1095 Then install the printer:
1097 <para><programlisting>
1098 "lpadmin -p laserjet4plus -v parallel:/dev/lp0 -E \
1099 -P /some/path/on/your/filesystem/somewhere/my-name-for-my-printer.ppd"
1100 </programlisting></para>
1103 Note, that for all the "Foomatic-PPDs" from Linuxprinting.org, you also need
1104 a special "CUPS filter" named "cupsomatic". Get the latest version of
1108 <para><ulink url="http://www.linuxprinting.org/cupsomatic">http://www.linuxprinting.org/cupsomatic</ulink></para>
1111 This needs to be copied to <filename>/usr/lib/cups/filter/cupsomatic</filename>
1112 and be made world executable. This filter is needed to read and act upon the
1113 specially encoded Foomatic comments, embedded in the printfile, which in turn
1114 are used to construct (transparently for you, the user) the complicated
1115 ghostscript command line needed for your printer/driver combo.
1119 You can have a look at all the options for the Ghostscript commandline supported
1120 by your printer and the ljet4 driver by going to the section "Execution details",
1121 selecting your model (Laserjet 4 Plus) and clicking on "Show execution details".
1122 This will bring up this web page:
1125 <para><ulink url="http://www.linuxprinting.org/execution.cgi?driver=ljet4&printer=75104&.submit=Show+execution+details">http://www.linuxprinting.org/execution.cgi?driver=ljet4&printer=75104&.submit=Show+execution+details</ulink></para>
1128 The ingenious thing is that the database is kept current. If there
1129 is a bug fix and an improvement somewhere in the database, you will
1130 always get the most current and stable and feature-rich driver by following
1131 the steps described above.
1135 Till Kamppeter from MandrakeSoft is doing an excellent job here that too few
1136 people are aware of. (So if you use it often, please send him a note showing
1137 your appreciation).</para></note>
1140 The latest and greatest improvement now is support for "custom page sizes"
1141 for all those printers which support it.
1145 "cupsomatic" is documented here:
1148 <para><ulink url="http://www.linuxprinting.org/cups-doc.html">http://www.linuxprinting.org/cups-doc.html</ulink></para>
1151 More printing tutorial info may be found here:
1154 <para><ulink url="http://www.linuxprinting.org/kpfeifle/LinuxKongress2002/Tutorial/">http://www.linuxprinting.org/kpfeifle/LinuxKongress2002/Tutorial/</ulink></para>
1157 Note, that *all* the Foomatic drivers listed on Linuxprinting.org (now
1158 approaching the "all-time high" number of 1.000 for the supported models)
1159 are using a special filtering chain involving Ghostscript, as described
1170 <member>A "foomatic+<replaceable>something</replaceable>" PPD is not enough to print with CUPS (but it is *one* important component)</member>
1171 <member>The "cupsomatic" filter script (Perl) in <filename>/usr/lib/cups/filters/</filename></member>
1172 <member>Perl to make cupsomatic run</member>
1173 <member>Ghostscript (because it is called and controlled by the PPD/cupsomatic combo in a way to fit your printermodel/driver combo.</member>
1174 <member>Ghostscript *must*, depending on the driver/model, contain support for a certain "device" (as shown by "gs -h")</member>
1178 In the case of the "hpijs" driver, you need a Ghostscript version, which
1179 has "ijs" amongst its supported devices in "gs -h". In the case of
1180 "hpijs+foomatic", a valid ghostscript commandline would be reading like this:
1183 <para><programlisting>
1184 gs -q -dBATCH -dPARANOIDSAFER -dQUIET -dNOPAUSE -sDEVICE=ijs \
1185 -sIjsServer=hpijs<replaceable>PageSize</replaceable> -dDuplex=<replaceable>Duplex</replaceable> <replaceable>Model</replaceable> \
1186 -r<replaceable>Resolution</replaceable>,PS:MediaPosition=<replaceable>InputSlot</replaceable> -dIjsUseOutputFD \
1188 </programlisting></para>
1191 Note, that with CUPS and the "hpijs+foomatic" PPD (plus Perl and cupsomatic)
1192 you don't need to remember this. You can choose the available print options
1193 thru a GUI print command (like "glp" from ESP's commercially supported
1194 PrintPro software, or KDE's "kprinter", or GNOME's "gtklp" or the independent
1195 "xpp") or the CUPS web interface via human-readable drop-down selection
1200 If you use "ESP Ghostscript" (also under the GPL, provided by Easy Software
1201 Products, the makers of CUPS, downloadable from
1202 <ulink url="http://www.cups.org/software.html">http://www.cups.org/software.html</ulink>,
1203 co-maintained by the developers of linuxprinting.org), you are guaranteed to
1204 have in use the most uptodate, bug-fixed, enhanced and stable version of a Free
1205 Ghostscript. It contains support for ~300 devices, whereas plain vanilla
1206 GNU Ghostscript 7.05 only has ~200.
1210 If you print only one CUPS test page, from the web interface and when you try to
1211 print a windows test page, it acts like the job was never sent:
1214 <member>Can you print "standard" jobs from the CUPS machine?</member>
1215 <member>Are the jobs from Windows visible in the Web interface on CUPS (http://localhost:631/)?</member>
1216 <member><emphasis>Most important:</emphasis> What kind of printer driver are you using on the Windows clients?</member>
1219 You can try to get a more detailed debugging info by setting "LogLevel debug" in
1220 <filename>/etc/cups/cupsd.conf</filename>, re-start cupsd and investigate <filename>/var/log/cups/error_log</filename>
1221 for the whereabouts of your Windows-originating printjobs:
1225 <member>what does the "auto-typing" line say? which is the "MIME type" CUPS thinks is arriving from the Windows clients?</member>
1226 <member>are there "filter" available for this MIME type?</member>
1227 <member>are there "filter rules" defined in "/etc/cups/mime.convs" for this MIME type?</member>
1234 <title>Limiting the number of pages users can print</title>
1237 The feature you want is dependent on the real print subsystem you're using.
1238 Samba's part is always to receive the job files from the clients (filtered
1239 *or* unfiltered) and hand it over to this printing subsystem.
1243 Of course one could "hack" things with one's own scripts.
1247 But there is CUPS (Common Unix Printing System). CUPS supports "quotas".
1248 Quotas can be based on sizes of jobs or on the number of pages or both,
1249 and are spanning any time period you want.
1253 This is an example command how root would set a print quota in CUPS,
1254 assuming an existing printer named "quotaprinter":
1258 lpadmin -p quotaprinter -o job-quota-period=604800 -o job-k-limit=1024 \
1259 -o job-page-limit=100
1263 This would limit every single user to print 100 pages or 1024 KB of
1264 data (whichever comes first) within the last 604.800 seconds ( = 1 week).
1268 For CUPS to count correctly, the printfile needs to pass the CUPS "pstops" filter,
1269 otherwise it uses a "dummy" count of "1". Some printfiles don't pass it
1270 (eg: image files) but then those are mostly 1 page jobs anyway. This also means,
1271 proprietary drivers for the target printer running on the client computers and
1272 CUPS/Samba then spooling these files as "raw" (i.e. leaving them untouched, not
1273 filtering them), will be counted as "1-pagers" too!
1277 You need to send PostScript from the clients (i.e. run a PostScript driver there)
1278 for having the chance to get accounting done. If the printer is a non-PostScript model,
1279 you need to let CUPS do the job to convert the file to a print-ready format for the
1280 target printer. This will be working for currently ~1.000 different printer models, see
1284 http://www.linuxprinting.org/printer_list.cgi
1288 Before CUPS-1.1.16 your only option was to use the Adobe PostScript
1289 Driver on the Windows clients. The output of this driver was not always
1290 passed thru the "pstops" filter on the CUPS/Samba side, and therefor was
1291 not counted correctly (the reason is that it often --- depending on the
1292 "PPD" being used --- did write a "PJL"-header in front of the real
1293 PostScript which made CUPS to skip the pstops and go directy to
1294 the "pstoraster" stage).
1298 From CUPS-1.1.16 onward you can use the "CUPS PostScript Driver
1299 for Windows NT/2K/XP clients" (it is tagged in the download area of
1300 http://www.cups.org/ as the "cups-samba-1.1.16.tar.gz" package).
1301 It is *not* working for Win9x/ME clients. But it:
1305 <member>it guarantees to not write an PJL-header</member>
1306 <member>it guarantees to still read and support all PJL-options named in the driver PPD with its own means</member>
1307 <member>it guarantees the file going thru the "pstops" filter on the CUPS/Samba server</member>
1308 <member>it guarantees to page-count correctly the printfile</member>
1312 You can read more about the setup of this combination in the
1313 manpage for "cupsaddsmb" (only present with CUPS installed, only
1314 current with CUPS 1.1.16).
1318 These are the items CUPS logs in the "page_log" for every single *page* of a job:
1322 <member>Printer name</member>
1323 <member>User name</member>
1324 <member>Job ID</member>
1325 <member>Time of printing</member>
1326 <member>the page number</member>
1327 <member>the number of copies</member>
1328 <member>a billing info string (optional)</member>
1333 Here is an extract of my CUPS server's page_log file to illustrate
1334 the format and included items:
1337 <para><computeroutput>
1338 infotec_IS2027 kurt 40 [22/Nov/2002:13:18:03 +0100] 1 2 #marketing
1339 infotec_IS2027 kurt 40 [22/Nov/2002:13:18:03 +0100] 2 2 #marketing
1340 infotec_IS2027 kurt 40 [22/Nov/2002:13:18:03 +0100] 3 2 #marketing
1341 infotec_IS2027 kurt 40 [22/Nov/2002:13:18:03 +0100] 4 2 #marketing
1342 infotec_IS2027 kurt 40 [22/Nov/2002:13:18:03 +0100] 5 2 #marketing
1343 infotec_IS2027 kurt 40 [22/Nov/2002:13:18:03 +0100] 6 2 #marketing
1344 </computeroutput></para>
1347 This was Job ID "40", printed on "infotec_IS2027" by user "kurt", a 6-page job
1348 printed in 2 copies and billed to "#marketing"...
1352 What flaws or shortcomings are there?
1356 <member>the ones named above</member>
1359 CUPS really counts the job pages being *processsed in software*
1360 (going thru the "RIP") rather than the physical sheets successfully
1361 leaving the printing device -- if there is a jam while printing
1362 the 5th sheet out of 1000 and the job is aborted by the printer,
1363 the "page count" will still show the figure of 1000 for that job
1367 all quotas are the same for all users (no flexibility to give the
1368 boss a higher quota than the clerk) no support for groups
1372 no means to read out the current balance or "used-up" number of current quota
1376 a user having used up 99 sheets of 100 quota will still be able to send and print a 1.000 sheet job
1380 a user being denied a job because of a filled-up quota doesn't get a meaningful
1381 error message from CUPS other than "client-error-not-possible".
1386 But this is the best system out there currently. And there are
1387 huge improvements under development:
1391 <member>page counting will go into the "backends" (these talk
1392 directly to the printer and will increase the count in sync with the
1393 actual printing process -- a jam at the 5th sheet will lead to a stop in the counting)</member>
1395 <member>quotas will be handled more flexibly</member>
1397 <member>probably there will be support for users to inquire their "accounts" in advance</member>
1399 <member>probably there will be support for some other tools around this topic</member>
1403 Other than the current stage of the CUPS development, I don't
1404 know any other ready-to-use tool which you could consider.
1408 You can download the driver files from
1409 <ulink url="http://www.cups.org/software.html">http://www.cups.org/software.html</ulink>.
1410 It is a separate package from the CUPS base software files, tagged as "CUPS 1.1.16
1411 Windows NT/2k/XP Printer Driver for SAMBA (tar.gz, 192k)". The filename to
1412 download is "cups-samba-1.1.16.tar.gz". Upon untar-/unzip-ping it will reveal
1427 These have been packaged with the ESP meta packager software "EPM". The
1428 *.install and *.remove files are simple shell script, which untars the
1429 *.ss (which is nothing else than a tar-archive) and puts its contents
1430 into <filename>/usr/share/cups/drivers/</filename>. Its contents are 3 files:
1442 Due to a bug one CUPS release puts the <filename>cups.hlp</filename>
1443 into <filename>/usr/share/drivers/</filename> instead of
1444 <filename>/usr/share/cups/drivers/</filename>. To work around this, copy/move
1445 the file after running the "./cups-samba.install" script manually to the right place:
1449 <userinput> cp /usr/share/drivers/cups.hlp /usr/share/cups/drivers/
1455 This new CUPS PostScript driver is currently binary-only, but free
1456 no source code is provided (yet). The reason is this: it has
1457 been developed with the help of the Microsoft Driver Developer Kit (DDK)
1458 and compiled with Microsoft Visual Studio 6. It is not clear to the driver
1459 developers if they are allowed to distribute the whole of the source code
1460 as Free Software. However, they will likely release the "diff" in source
1461 code under the GPL, so anybody with a license of Visual Studio and a DDK
1462 will be able to compile for him/herself.
1466 Once you have run the install script (and possibly manually moved the
1467 "cups.hlp" file to "/usr/share/cups/drivers/"), the driver is ready to be
1468 put into Samba's [print$] share (which often maps to "/etc/samba/drivers/"
1469 and contains a subdir tree with WIN40 and W32X86 branches), by running
1470 "cupsaddsmb" (see also "man cupsaddsmb" for CUPS 1.1.16). [Don't forget to
1471 put root into the smbpasswd file by running "smbpasswd" should you run
1472 this whole procedure for the first time.] Once the driver files are in the
1473 [print$] share, they are ready to be downloaded and installed by the
1474 Win NT/2k/XP clients.
1479 Win 9x/ME clients won't work with this driver. For these you'd
1480 still need to use the ADOBE*.* drivers as previously.
1484 It is not harming if you've still the ADOBE*.* driver files from
1485 previous installations in the "/usr/share/cups/drivers/" directory.
1486 The new cupsaddsmb (from 1.1.16) will automatically use the
1487 "newest" installed driver (which here then is the CUPS drivers).
1491 Should your Win clients have had the old ADOBE*.* files and the
1492 Adobe PostScript drivers installed, the download and installation
1493 of the new CUPS PostScript driver for Windows NT/2k/XP will fail
1497 It is not enough to "delete" the printer (as the driver files
1498 will still be kept by the clients and re-used if you try to
1499 re-install the printer). To really get rid of the Adobe driver
1500 files on the clients, open the "Printers" folder (possibly via
1501 "Start --> Settings --> Control Panel --> Printers"), right-click
1502 onto the folder background and select "Server Properties". A
1503 new dialog opens; select the "Drivers" tab; on the list select
1504 the driver you want to delete and click on the "Delete" button.
1505 (This will only work if there is no single printer left which
1506 uses that particular driver -- you need to "delete" all printers
1507 using this driver in the "Printers" folder first.)
1512 Once you have successfully downloaded the CUPS PostScript driver
1513 to a client, you can easily switch all printers to this one
1514 by proceeding as described elsewhere in the "Samba HOWTO
1515 Collection" to change a driver for an existing printer.
1519 What are the benefits with the "CUPS PostScript driver for Windows NT/2k/XP"
1520 as compared to the Adobe drivers?
1526 no hassle with the Adobe EULA
1530 no hassle with the question "where do I get the ADOBE*.* driver files from?"
1534 the Adobe drivers (depending on the printer PPD associated with them)
1535 often put a PJL header in front of the core PostScript part of the print
1536 file (thus the file starts with "<replaceable>1B</replaceable>%-12345X" or "<replaceable>escape</replaceable>%-12345X"
1537 instead of "%!PS"). This leads to the CUPS daemon autotyping the
1538 arriving file as a print-ready file, not requiring a pass thru the
1539 "pstops" filter (to speak more technical, it is not regarded as the
1540 generic MIME type "application/postscript", but as the more special
1541 MIME type "application/cups.vnd-postscript"), which therefore also
1542 leads to the page accounting in "/var/log/cups/page_log" not receiving
1543 the exact mumber of pages; instead the dummy page number of "1" is
1544 logged in a standard setup)
1548 the Adobe driver has more options to "mis-configure" the PostScript
1549 generated by it (like setting it inadvertedly to "Optimize for Speed",
1550 instead of "Optimize for Portability", which could lead to CUPS being
1551 unable to process it)
1555 the CUPS PostScript driver output sent by Windows clients to the CUPS
1556 server will be guaranteed to be auto-typed as generic MIME type
1557 "application/postscript", thusly passing thru the CUPS "pstops" filter
1558 and logging the correct number of pages in the page_log for accounting
1563 the CUPS PostScript driver supports the sending of additional print
1564 options by the Win NT/2k/XP clients, such as naming the CUPS standard
1565 banner pages (or the custom ones, should they be installed at the time
1566 of driver download), using the CUPS "page-label" option, setting a
1567 job-priority and setting the scheduled time of printing (with the option
1568 to support additional useful IPP job attributes in the future).
1572 the CUPS PostScript driver supports the inclusion of the new
1573 "*cupsJobTicket" comments at the beginnig of the PostScript file (which
1574 could be used in the future for all sort of beneficial extensions on
1575 the CUPS side, but which will not disturb any other application as those
1576 will regard it as a comment and simply ignore it).
1580 the CUPS PostScript driver will be the heart of the fully fledged CUPS
1581 IPP client for Windows NT/2k/XP to be released soon (probably alongside
1582 the first Beta release for CUPS 1.2).
1590 <title>Advanced Postscript Printing from MS Windows</title>
1593 Let the Windows Clients use a PostScript driver to deliver poistscript to
1594 the samba print server (just like any Linux or Unix Client would also use
1595 PostScript to send to the server)
1599 Make the Unix printing subsystem to which Samba sends the job convert the
1600 incoming PostScript files to the native print format of the target printers
1601 (would be PCL if you have an HP printer)
1605 Now if you are afraid that this would just mean using a *Generic* PostScript
1606 driver for the clients that has no Simplex/Duplex selection, and no paper tray
1607 choice, but you need them to be able to set up print jobs, with all the bells
1608 and whistles of your printers:-
1612 <member>Not possible with traditional spooling systems</member>
1615 But perfectly supported by CUPS (which uses "PPD" files to
1616 describe how to control the print options for PostScript and
1617 non-PostScript devices alike...
1622 CUPS PPDs are working perfectly on Windows clients who use Adobe PostScript
1623 drivers (or the new CUPS PostScript driver for Windows NT/2K/XP). Clients can use
1624 them to setup the job to their liking and CUPS will use the received job options
1625 to make the (PCL-, ESC/P- or PostScript-) printer behave as required.
1629 If you want to have the additional benefit of page count logging and accounting
1630 then the CUPS PostScript driver is the best choice (better than the Adobe one).
1634 If you want to make the drivers downloadable for the clients then "cupsaddsmb" is
1635 your friend. It will setup the [print$] share on the Samba host to be ready to serve
1636 the clients for a "point and print" driver installation.
1640 <para>What strings are attached?</para></warning>
1643 There are some. But, given the sheer CPU power you can buy nowadays,
1644 these can be overcome easily. The strings:
1648 Well, if the CUPS/Samba side will have to print to many printers serving many users,
1649 you probably will need to set up a second server (which can do automatic load balancing
1650 with the first one, plus a degree of fail-over mechanism). Converting the incoming
1651 PostScript jobs, "interpreting" them for non-PostScript printers, amounts to the work
1652 of a "RIP" (Raster Image Processor) done in software. This requires more CPU and RAM
1653 than for the mere "raw spooling" task your current setup is solving. It all depends
1654 on the avarage and peak printing load the server should be able to handle.
1660 <title>Auto-Deletion of CUPS spool files</title>
1663 Samba print files pass thru two "spool" directories. One the incoming directory
1664 managed by Samba, (set eg: in the "path = /var/spool/samba" directive in the [printers]
1665 section of "smb.conf"). Second is the spool directory of your UNIX print subsystem.
1666 For CUPS it is normally "/var/spool/cups/", as set by the cupsd.conf directive
1667 "RequestRoot /var/spool/cups".
1671 I am not sure, which one of your directories keeps the files. From what you say,
1672 it is most likely the Samba part.
1676 For the CUPS part, you may want to consult:
1680 <member>http://localhost:631/sam.html#PreserveJobFiles</member>
1681 <member>http://localhost:631/sam.html#PreserveJobHistory</member>
1682 <member>http://localhost:631/sam.html#MaxJobs</member>
1686 There are the settings described for your CUPS daemon, which could lead to completed
1687 job files not being deleted.
1691 "PreserveJobHistory Yes" -- keeps some details of jobs in
1692 cupsd's mind (well it keeps the "c12345", "c12346" etc. files
1693 in the CUPS spool directory, which do a similar job as the
1694 old-fashioned BSD-LPD control files). This is set to "Yes"
1699 "PreserveJobFiles Yes" -- keeps the job files themselves in
1700 cupsd's mind (well it keeps the "d12345", "d12346" etc. files
1701 in the CUPS spool directory...). This is set to "No" as the
1706 "MaxJobs 500" -- this directive controls the maximum number
1707 of jobs that are kept in memory. Once the number of jobs
1708 reaches the limit, the oldest completed job is automatically
1709 purged from the system to make room for the new one. If all
1710 of the known jobs are still pending or active then the new
1711 job will be rejected. Setting the maximum to 0 disables this
1712 functionality. The default setting is 0.
1716 (There are also additional settings for "MaxJobsPerUser" and
1717 "MaxJobsPerPrinter"...)
1721 For everything to work as announced, you need to have three things:
1727 a Samba-smbd which is compiled against "libcups" (Check on Linux by running "ldd `which smbd`")
1731 a Samba-smb.conf setting of "printing = cups"
1735 another Samba-smb.conf setting of "printcap = cups"
1741 Note, that in this case all other manually set printing-related
1742 commands (like "print command", "lpq command", "lprm command",
1743 "lppause command" or "lpresume command") are ignored and they
1744 should normally have no influence what-so-ever on your printing.
1748 If you want to do things manually, replace the "printing = cups"
1749 by "printing = bsd". Then your manually set commands may work
1750 (haven't tested this), and a "print command = lp -d %P %s; rm %s"
1751 may do what you need.
1755 You forgot to mention the CUPS version you're using. If you did
1756 set things up as described in the man pages, then the Samba
1757 spool files should be deleted. Otherwise it may be a bug. On
1758 the CUPS side, you can control the behaviour as described
1763 If you have more problems, post the output of these commands:
1768 grep -v ^# /etc/cups/cupsd.conf | grep -v ^$
1769 grep -v ^# /etc/samba/smb.conf | grep -v ^$ | grep -v "^;"
1774 (adapt paths as needed). These commands sanitize the files
1775 and cut out the empty lines and lines with comments, providing
1776 the "naked settings" in a compact way.