1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
5 >CUPS Printing Support</TITLE
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
10 TITLE="SAMBA Project Documentation"
11 HREF="samba-howto-collection.html"><LINK
13 TITLE="Advanced Configuration"
14 HREF="optional.html"><LINK
16 TITLE="Printing Support"
17 HREF="printing.html"><LINK
19 TITLE="Unified Logons between Windows NT and UNIX using Winbind"
20 HREF="winbind.html"></HEAD
31 SUMMARY="Header navigation table"
40 >SAMBA Project Documentation</TH
77 >Chapter 14. CUPS Printing Support</H1
87 HREF="cups-printing.html#AEN2034"
92 HREF="cups-printing.html#AEN2041"
100 HREF="cups-printing.html#AEN2061"
101 >CUPS - RAW Print Through Mode</A
105 HREF="cups-printing.html#AEN2118"
106 >CUPS as a network PostScript RIP -- CUPS drivers working on server, Adobe
107 PostScript driver with CUPS-PPDs downloaded to clients</A
111 HREF="cups-printing.html#AEN2139"
112 >Windows Terminal Servers (WTS) as CUPS clients</A
116 HREF="cups-printing.html#AEN2143"
117 >Setting up CUPS for driver download</A
121 HREF="cups-printing.html#AEN2156"
122 >Sources of CUPS drivers / PPDs</A
126 HREF="cups-printing.html#AEN2212"
127 >The CUPS Filter Chains</A
131 HREF="cups-printing.html#AEN2251"
132 >CUPS Print Drivers and Devices</A
136 HREF="cups-printing.html#AEN2328"
137 >Limiting the number of pages users can print</A
141 HREF="cups-printing.html#AEN2424"
142 >Advanced Postscript Printing from MS Windows</A
146 HREF="cups-printing.html#AEN2439"
147 >Auto-Deletion of CUPS spool files</A
157 >14.1. Introduction</A
160 >The Common Unix Print System (CUPS) has become very popular, but to many it is
161 a very mystical tool. There is a great deal of uncertainty regarding CUPS and how
162 it works. The result is seen in a large number of posting on the samba mailing lists
163 expressing frustration when MS Windows printers appear not to work with a CUPS
166 >This is a good time to point out how CUPS can be used and what it does. CUPS is more
167 than just a print spooling system - it is a complete printer management system that
168 complies with HTTP and IPP protocols. It can be managed remotely via a web browser
169 and it can print using http and ipp protocols.</P
171 >CUPS allows to creation of RAW printers (ie: NO file format translation) as well as
172 SMART printers (ie: CUPS does file format conversion as required for the printer). In
173 many ways this gives CUPS similar capabilities to the MS Windows print monitoring
174 system. Of course, if you are a CUPS advocate, you would agrue that CUPS is better!
175 In any case, let us now move on to explore how one may configure CUPS for interfacing
176 with MS Windows print clients via Samba.</P
179 HREF="http://www.cups.org/"
182 > is a newcomer in the UNIX printing scene,
183 which has convinced many people upon first trial already. However, it has quite a few
184 new features, which make it different from other, more traditional printing systems.</P
192 >14.2. Configuring <TT
198 >Printing with CUPS in the most basic <TT
202 setup in Samba-3 only needs two settings: <B
209 >. While CUPS itself doesn't need a printcap
213 > configuration file knows two directives
216 >Printcap /etc/printcap</B
221 >), which control if such a file should be created for the
222 convenience of third party applications. Make sure it is set! For details see
226 > and other CUPS-related documentation.</P
228 >If SAMBA is compiled against libcups, then <B
232 CUPS API to list printers, submit jobs, etc. Otherwise it maps to the System V commands
233 with an additional <VAR
236 > option for printing. On a Linux system,
240 > command to find out details (ldd may not be
241 present on other OS platforms, or its function may be embodied by a different command):</P
244 CLASS="PROGRAMLISTING"
245 >transmeta:/home/kurt # ldd `which smbd`
246 libssl.so.0.9.6 => /usr/lib/libssl.so.0.9.6 (0x4002d000)
247 libcrypto.so.0.9.6 => /usr/lib/libcrypto.so.0.9.6 (0x4005a000)
248 libcups.so.2 => /usr/lib/libcups.so.2 (0x40123000)
249 libdl.so.2 => /lib/libdl.so.2 (0x401e8000)
250 libnsl.so.1 => /lib/libnsl.so.1 (0x401ec000)
251 libpam.so.0 => /lib/libpam.so.0 (0x40202000)
252 libc.so.6 => /lib/libc.so.6 (0x4020b000)
253 /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)</PRE
256 >The line "libcups.so.2 => /usr/lib/libcups.so.2
257 (0x40123000)" shows there is CUPS support compiled into this version of
258 Samba. If this is the case, and <B
262 otherwise manually set print command in <TT
273 >14.3. CUPS - RAW Print Through Mode</A
289 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
296 >When used in raw print through mode is will be necessary to use the printer
297 vendor's drivers in each Windows client PC.</P
303 >When CUPS printers are configured for RAW print-through mode operation it is the
304 responsibility of the Samba client to fully render the print job (file) in a format
305 that is suitable for direct delivery to the printer. In this case CUPS will NOT
306 do any print file format conversion work.</P
308 >The CUPS files that need to be correctly set for RAW mode printers to work are:
317 >/etc/cups/mime.types</TT
324 >/etc/cups/mime.convs</TT
330 Both contain entries that must be uncommented to allow <SPAN
339 >Firstly, to enable CUPS based printing from Samba the following options must be
343 > file [globals] section:
359 When these parameters are specified the print directives in <TT
363 samba itself) will be ignored because samba will directly interface with CUPS through
364 it's application program interface (API) - so long as Samba has been compiled with
365 CUPS library (libcups) support. If samba has NOT been compiled with CUPS support then
366 printing will use the System V AT&T command set with the <SPAN
373 option automatically passing through.</P
375 >Cupsomatic (an enhanced printing utility that is part of some CUPS implementations)
376 on the Samba/CUPS server does *not* add any features if a file is really
377 printed "raw". However, if you have loaded the driver for the Windows client from
378 the CUPS server, using the "cupsaddsmb" utility, and if this driver is one using
379 a "Foomatic" PPD, the PJL header in question is already added on the Windows client,
380 at the time when the driver initially generated the PostScript data and CUPS in true
381 "-oraw" manner doesn't remove this PJL header and passes the file "as is" to its
382 printer communication backend.</P
397 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
404 >NOTE: editing in the "mime.convs" and the "mime.types" file does not *enforce*
405 "raw" printing, it only *allows* it.</P
411 >Print files that arrive from MS Windows printing are "auto-typed" by CUPS. This aids
412 the process of determining proper treatment while in the print queue system.
419 > Files generated by PCL drivers and directed at PCK printers get auto-typed as
422 >application/octet-stream</TT
423 >. Unknown file format types also
424 get auto-typed with this tag.
429 > Files generated by a Postscript driver and directed at a Postscript printer
430 are auto-typed depending on the auto-detected most suitable MIME type as:
437 >* application/postscript</P
441 >* application/vnd.cups-postscript</P
450 >"application/postscript" first goes thru the "pstops" filter (where the page counting
451 and accounting takes place). The outcome will be of MIME type
452 "application/vnd.cups-postscript". The pstopsfilter reads and uses information from
453 the PPD and inserts user-provided options into the PostScript file. As a consequence,
454 the filtered file could possibly have an unwanted PJL header.</P
456 >"application/postscript" will be all files with a ".ps", ".ai", ".eps" suffix or which
457 have as their first character string one of "%!" or ">04<%".</P
459 >"application/vnd.cups-postscript" will files which contain the string
460 "LANGUAGE=POSTSCRIPT" (or similar variations with different capitalization) in the
461 first 512 bytes, and also contain the "PJL super escape code" in the first 128 bytes
462 (">1B<%-12345X"). Very likely, most PostScript files generated on Windows using a CUPS
463 or other PPD, will have to be auto-typed as "vnd.cups-postscript". A file produced
464 with a "Generic PostScript driver" will just be tagged "application/postscript".</P
466 >Once the file is in "application/vnd.cups-postscript" format, either "pstoraster"
467 or "cupsomatic" will take over (depending on the printer configuration, as
468 determined by the PPD in use).</P
483 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
490 >A printer queue with *no* PPD associated to it is a "raw" printer and all files
491 will go directly there as received by the spooler. The exeptions are file types
492 "application/octet-stream" which need "passthrough feature" enabled.
493 "Raw" queues don't do any filtering at all, they hand the file directly to the
494 CUPS backend. This backend is responsible for the sending of the data to the device
495 (as in the "device URI" notation as lpd://, socket://, smb://, ipp://, http://,
496 parallel:/, serial:/, usb:/ etc.)</P
515 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
522 >"cupsomatic"/Foomatic are *not* native CUPS drivers and they don't ship with CUPS.
523 They are a Third Party add-on, developed at Linuxprinting.org. As such, they are
524 a brilliant hack to make all models (driven by Ghostscript drivers/filters in
525 traditional spoolers) also work via CUPS, with the same (good or bad!) quality
526 as in these other spoolers. "cupsomatic" is only a vehicle to execute a ghostscript
527 commandline at that stage in the CUPS filtering chain, where "normally" the native
528 CUPS "pstoraster" filter would kick in. cupsomatic by-passes pstoraster, "kidnaps"
529 the printfile from CUPS away and re-directs it to go through Ghostscipt. CUPS accepts this,
530 because the associated CUPS-O-Matic-/Foomatic-PPD specifies:</P
532 CLASS="PROGRAMLISTING"
533 > *cupsFilter: "application/vnd.cups-postscript 0 cupsomatic"</PRE
535 >This line persuades CUPS to hand the file to cupsomatic, once it has successfully
536 converted it to the MIME type "application/vnd.cups-postscript". This conversion will not
537 happen for Jobs arriving from Windows which are auto-typed "application/octet-stream",
538 with the according changes in "/etc/cups/mime.types" in place.</P
544 >CUPS is widely configurable and flexible, even regarding its filtering mechanism.
545 Another workaround in some situations would be to have
546 in "/etc/cups/mime.types" entries as follows:</P
548 CLASS="PROGRAMLISTING"
549 > application/postscript application/vnd.cups-raw 0 -
550 application/vnd.cups-postscript application/vnd.cups-raw 0 -</PRE
552 >This would prevent all Postscript files from being filtered (rather, they will go
553 thru the virtual "nullfilter" denoted with "-"). This could only be useful for
554 PS printers. If you want to print PS code on non-PS printers an entry as follows
557 CLASS="PROGRAMLISTING"
558 > */* application/vnd.cups-raw 0 -</PRE
560 >and would effectively send *all* files to the backend without further processing.</P
562 >Lastly, you could have the following entry:</P
564 CLASS="PROGRAMLISTING"
565 > application/vnd.cups-postscript application/vnd.cups-raw 0 my_PJL_stripping_filter</PRE
567 >You will need to write a "my_PJL_stripping_filter" (could be a shellscript) that
568 parses the PostScript and removes the unwanted PJL. This would need to conform to
569 CUPS filter design (mainly, receive and pass the parameters printername, job-id,
570 username, jobtitle, copies, print options and possibly the filename). It would
571 be installed as world executable into "/usr/lib/cups/filters/" and will be called
572 by CUPS if it encounters a MIME type "application/vnd.cups-postscript".</P
574 >CUPS can handle "-o job-hold-until=indefinite". This keeps the job in the queue
575 "on hold". It will only be printed upon manual release by the printer operator.
576 This is a requirement in many "central reproduction departments", where a few
577 operators manage the jobs of hundreds of users on some big machine, where no
578 user is allowed to have direct access. (The operators often need to load the
579 proper paper type before running the 10.000 page job requested by marketing
580 for the mailing, etc.).</P
588 >14.4. CUPS as a network PostScript RIP -- CUPS drivers working on server, Adobe
589 PostScript driver with CUPS-PPDs downloaded to clients</A
592 >CUPS is perfectly able to use PPD files (PostScript
593 Printer Descriptions). PPDs can control all print device options. They
594 are usually provided by the manufacturer -- if you own a PostSript printer,
595 that is. PPD files are always a component of PostScript printer drivers on MS
596 Windows or Apple Mac OS systems. They are ASCII files containing
597 user-selectable print options, mapped to appropriate PostScript, PCL or PJL
598 commands for the target printer. Printer driver GUI dialogs translate these
599 options "on-the-fly" into buttons and drop-down lists for the user to
602 >CUPS can load, without any conversions, the PPD file from
603 any Windows (NT is recommended) PostScript driver and handle the options.
604 There is a web browser interface to the print options (select
605 http://localhost:631/printers/ and click on one "Configure Printer" button
606 to see it), a commandline interface (see <B
613 > on your system) plus some different GUI frontends on Linux
614 UNIX, which can present PPD options to the users. PPD options are normally
615 meant to become evaluated by the PostScript RIP on the real PostScript
618 >CUPS doesn't stop at "real" PostScript printers in its
619 usage of PPDs. The CUPS developers have extended the PPD concept, to also
620 describe available device and driver options for non-PostScript printers
621 through CUPS-PPDs.</P
623 >This is logical, as CUPS includes a fully featured
624 PostScript interpreter (RIP). This RIP is based on Ghostscript. It can
625 process all received PostScript (and additionally many other file formats)
626 from clients. All CUPS-PPDs geared to non-PostScript printers contain an
627 additional line, starting with the keyword <VAR
632 tells the CUPS print system which printer-specific filter to use for the
633 interpretation of the accompanying PostScript. Thus CUPS lets all its
634 printers appear as PostScript devices to its clients, because it can act as a
635 PostScript RIP for those printers, processing the received PostScript code
636 into a proper raster print format.</P
638 >CUPS-PPDs can also be used on Windows-Clients, on top of a
639 PostScript driver (recommended is the Adobe one).</P
641 >This feature enables CUPS to do a few tricks no other
648 >act as a networked PostScript RIP (Raster Image Processor), handling
649 printfiles from all client platforms in a uniform way;</P
653 >act as a central accounting and billing server, as all files are passed
657 > Filter and are therefor logged in
668 can not happen with "raw" print jobs, which always remain unfiltered
673 >enable clients to consolidate on a single PostScript driver, even for
674 many different target printers.</P
684 >14.5. Windows Terminal Servers (WTS) as CUPS clients</A
687 >This setup may be of special interest to people
688 experiencing major problems in WTS environments. WTS need often a multitude
689 of non-PostScript drivers installed to run their clients' variety of
690 different printer models. This often imposes the price of much increased
691 instability. In many cases, in an attempt to overcome this problem, site
692 administrators have resorted to restrict the allowed drivers installed on
693 their WTS to one generic PCL- and one PostScript driver. This however
694 restricts the clients in the amount of printer options available for them --
695 often they can't get out more then simplex prints from one standard paper
696 tray, while their devices could do much better, if driven by a different
699 >Using an Adobe PostScript driver, enabled with a CUPS-PPD,
700 seems to be a very elegant way to overcome all these shortcomings. The
701 PostScript driver is not known to cause major stability problems on WTS (even
702 if used with many different PPDs). The clients will be able to (again) chose
703 paper trays, duplex printing and other settings. However, there is a certain
704 price for this too: a CUPS server acting as a PostScript RIP for its clients
705 requires more CPU and RAM than just to act as a "raw spooling" device. Plus,
706 this setup is not yet widely tested, although the first feedbacks look very
715 >14.6. Setting up CUPS for driver download</A
721 > utility (shipped with all current
722 CUPS versions) makes the sharing of any (or all) installed CUPS printers very
723 easy. Prior to using it, you need the following settings in <TT
729 CLASS="PROGRAMLISTING"
736 comment = All Printers
737 path = /var/spool/samba
746 comment = Printer Drivers
747 path = /etc/samba/drivers
755 >For licensing reasons the necessary files of the Adobe
756 Postscript driver can not be distributed with either Samba or CUPS. You need
757 to download them yourself from the Adobe website. Once extracted, create a
761 > directory in the CUPS data directory (usually
764 >/usr/share/cups/</TT
765 >). Copy the Adobe files using
766 UPPERCASE filenames, to this directory as follows:</P
769 CLASS="PROGRAMLISTING"
781 >Users of the ESP Print Pro software are able to install
782 their "Samba Drivers" package for this purpose with no problem.</P
790 >14.7. Sources of CUPS drivers / PPDs</A
793 >On the internet you can find now many thousand CUPS-PPD
794 files (with their companion filters), in many national languages,
795 supporting more than 1.000 non-PostScript models.</P
802 HREF="http://wwwl.easysw.com/printpro/"
805 (http://wwwl.easysw.com/printpro/)</A
807 (commercial, non-Free) is packaged with more than 3.000 PPDs, ready for
808 successful usage "out of the box" on Linux, IBM-AIX, HP-UX, Sun-Solaris,
809 SGI-IRIX, Compaq Tru64, Digital Unix and some more commercial Unices (it
810 is written by the CUPS developers themselves and its sales help finance
811 the further development of CUPS, as they feed their creators)</P
816 HREF="http://gimp-print.sourceforge.net/"
819 (http://gimp-print.sourceforge.net/)</A
821 (GPL, Free Software) provides around 120 PPDs (supporting nearly 300
822 printers, many driven to photo quality output), to be used alongside the
823 Gimp-Print CUPS filters;</P
828 HREF="http://www.turboprint.com/"
831 (http://www.turboprint.com/)</A
833 (Shareware, non-Freee) supports roughly the same amount of printers in
834 excellent quality;</P
839 HREF="http://www-124.ibm.com/developerworks/oss/linux/projects/omni/"
842 (http://www-124.ibm.com/developerworks/oss/linux/projects/omni/)</A
844 (LPGL, Free) is a package made by IBM, now containing support for more
845 than 400 printers, stemming from the inheritance of IBM OS/2 KnowHow
846 ported over to Linux (CUPS support is in a Beta-stage at present);</P
851 HREF="http://hpinkjet.sourceforge.net/"
854 (http://hpinkjet.sourceforge.net/)</A
856 (BSD-style licnes, Free) supports around 120 of HP's own printers and is
857 also providing excellent print quality now;</P
862 HREF="http://www.linuxprinting.org/"
864 >Foomatic/cupsomatic (http://www.linuxprinting.org/)</A
866 (LPGL, Free) from Linuxprinting.org are providing PPDs for practically every
867 Ghostscript filter known to the world, now usable with CUPS.</P
877 >the cupsomatic trick from Linuxprinting.org is
878 working different from the other drivers. While the other drivers take the
879 generic CUPS raster (produced by CUPS' own pstoraster PostScript RIP) as
880 their input, cupsomatic "kidnaps" the PostScript inside CUPS, before
881 RIP-ping, deviates it to an external Ghostscript installation (which now
882 becomes the RIP) and gives it back to a CUPS backend once Ghostscript is
883 finished. -- CUPS versions from 1.1.15 and later will provide their pstoraster
884 PostScript RIP function again inside a system-wide Ghostscript
885 installation rather than in "their own" pstoraster filter. (This
886 CUPS-enabling Ghostscript version may be installed either as a
887 patch to GNU or AFPL Ghostscript, or as a complete ESP Ghostscript package).
888 However, this will not change the cupsomatic approach of guiding the printjob
889 along a different path through the filtering system than the standard CUPS
892 >Once you installed a printer inside CUPS with one of the
893 recommended methods (the lpadmin command, the web browser interface or one of
894 the available GUI wizards), you can use <B
898 printer via Samba. <B
901 > prepares the driver files for
902 comfortable client download and installation upon their first contact with
903 this printer share.</P
919 > command copies the needed files
920 for convenient Windows client installations from the previously prepared CUPS
921 data directory to your [print$] share. Additionally, the PPD
922 associated with this printer is copied from <TT
929 CLASS="PROGRAMLISTING"
935 >cupsaddsmb -U root infotec_IS2027</B
937 Password for root required to access localhost via SAMBA: <KBD
939 >[type in password 'secret']</KBD
943 >To share all printers and drivers, use the <VAR
947 parameter instead of a printer name.</P
949 >Probably you want to see what's going on. Use the
953 > parameter to get a more verbose output:</P
955 >Probably you want to see what's going on. Use the
959 > parameter to get a more verbose output:</P
962 CLASS="PROGRAMLISTING"
963 >Note: The following line shave been wrapped so that information is not lost.
968 > cupsaddsmb -v -U root infotec_IS2027
969 Password for root required to access localhost via SAMBA:
970 Running command: smbclient //localhost/print\$ -N -U'root%secret' -c 'mkdir W32X86;put
971 /var/spool/cups/tmp/3cd1cc66376c0 W32X86/infotec_IS2027.PPD;put /usr/share/cups/drivers/
972 ADOBEPS5.DLL W32X86/ADOBEPS5.DLL;put /usr/share/cups/drivers/ADOBEPSU.DLLr
973 W32X86/ADOBEPSU.DLL;put /usr/share/cups/drivers/ADOBEPSU.HLP W32X86/ADOBEPSU.HLP'
974 added interface ip=10.160.16.45 bcast=10.160.31.255 nmask=255.255.240.0
975 added interface ip=192.168.182.1 bcast=192.168.182.255 nmask=255.255.255.0
976 added interface ip=172.16.200.1 bcast=172.16.200.255 nmask=255.255.255.0
977 Domain=[TUX-NET] OS=[Unix] Server=[Samba 2.2.3a.200204262025cvs]
978 NT_STATUS_OBJECT_NAME_COLLISION making remote directory \W32X86
979 putting file /var/spool/cups/tmp/3cd1cc66376c0 as \W32X86/infotec_IS2027.PPD (17394.6 kb/s)
980 (average 17395.2 kb/s)
981 putting file /usr/share/cups/drivers/ADOBEPS5.DLL as \W32X86/ADOBEPS5.DLL (10877.4 kb/s)
982 (average 11343.0 kb/s)
983 putting file /usr/share/cups/drivers/ADOBEPSU.DLL as \W32X86/ADOBEPSU.DLL (5095.2 kb/s)
984 (average 9260.4 kb/s)
985 putting file /usr/share/cups/drivers/ADOBEPSU.HLP as \W32X86/ADOBEPSU.HLP (8828.7 kb/s)
986 (average 9247.1 kb/s)
988 Running command: smbclient //localhost/print\$ -N -U'root%secret' -c 'mkdir WIN40;put
989 /var/spool/cups/tmp/3cd1cc66376c0 WIN40/infotec_IS2027.PPD;put
990 /usr/share/cups/drivers/ADFONTS.MFM WIN40/ADFONTS.MFM;put
991 /usr/share/cups/drivers/ADOBEPS4.DRV WIN40/ADOBEPS4.DRV;put
992 /usr/share/cups/drivers/ADOBEPS4.HLP WIN40/ADOBEPS4.HLP;put
993 /usr/share/cups/drivers/DEFPRTR2.PPD WIN40/DEFPRTR2.PPD;put
994 /usr/share/cups/drivers/ICONLIB.DLL WIN40/ICONLIB.DLL;put
995 /usr/share/cups/drivers/PSMON.DLL WIN40/PSMON.DLL;'
996 added interface ip=10.160.16.45 bcast=10.160.31.255 nmask=255.255.240.0
997 added interface ip=192.168.182.1 bcast=192.168.182.255 nmask=255.255.255.0
998 added interface ip=172.16.200.1 bcast=172.16.200.255 nmask=255.255.255.0
999 Domain=[TUX-NET] OS=[Unix] Server=[Samba 2.2.3a.200204262025cvs]
1000 NT_STATUS_OBJECT_NAME_COLLISION making remote directory \WIN40
1001 putting file /var/spool/cups/tmp/3cd1cc66376c0 as \WIN40/infotec_IS2027.PPD (26091.5 kb/s)
1002 (average 26092.8 kb/s)
1003 putting file /usr/share/cups/drivers/ADFONTS.MFM as \WIN40/ADFONTS.MFM (11241.6 kb/s)
1004 (average 11812.9 kb/s)
1005 putting file /usr/share/cups/drivers/ADOBEPS4.DRV as \WIN40/ADOBEPS4.DRV (16640.6 kb/s)
1006 (average 14679.3 kb/s)
1007 putting file /usr/share/cups/drivers/ADOBEPS4.HLP as \WIN40/ADOBEPS4.HLP (11285.6 kb/s)
1008 (average 14281.5 kb/s)
1009 putting file /usr/share/cups/drivers/DEFPRTR2.PPD as \WIN40/DEFPRTR2.PPD (823.5 kb/s)
1010 (average 12944.0 kb/s)
1011 putting file /usr/share/cups/drivers/ICONLIB.DLL as \WIN40/ICONLIB.DLL (19226.2 kb/s)
1012 (average 13169.7 kb/s)
1013 putting file /usr/share/cups/drivers/PSMON.DLL as \WIN40/PSMON.DLL (18666.1 kb/s)
1014 (average 13266.7 kb/s)
1016 Running command: rpcclient localhost -N -U'root%secret' -c 'adddriver "Windows NT x86"
1017 "infotec_IS2027:ADOBEPS5.DLL:infotec_IS2027.PPD:ADOBEPSU.DLL:ADOBEPSU.HLP:NULL:RAW:NULL"'
1018 cmd = adddriver "Windows NT x86" "infotec_IS2027:ADOBEPS5.DLL:infotec_IS2027.PPD:ADOBEPSU.DLL:
1019 ADOBEPSU.HLP:NULL:RAW:NULL"
1020 Printer Driver infotec_IS2027 successfully installed.
1022 Running command: rpcclient localhost -N -U'root%secret' -c 'adddriver "Windows 4.0"
1023 "infotec_IS2027:ADOBEPS4.DRV:infotec_IS2027.PPD:NULL:ADOBEPS4.HLP:PSMON.DLL:RAW:
1024 ADFONTS.MFM,DEFPRTR2.PPD,ICONLIB.DLL"'
1025 cmd = adddriver "Windows 4.0" "infotec_IS2027:ADOBEPS4.DRV:infotec_IS2027.PPD:NULL:
1026 ADOBEPS4.HLP:PSMON.DLL:RAW:ADFONTS.MFM,DEFPRTR2.PPD,ICONLIB.DLL"
1027 Printer Driver infotec_IS2027 successfully installed.
1029 Running command: rpcclient localhost -N -U'root%secret'
1030 -c 'setdriver infotec_IS2027 infotec_IS2027'
1031 cmd = setdriver infotec_IS2027 infotec_IS2027
1032 Succesfully set infotec_IS2027 to driver infotec_IS2027.
1040 >If you look closely, you'll discover your root password was transfered unencrypted over
1041 the wire, so beware! Also, if you look further her, you'll discover error messages like
1044 >NT_STATUS_OBJECT_NAME_COLLISION</CODE
1045 > in between. They occur, because
1053 existed in the [print$] driver download share (from a previous driver
1054 installation). They are harmless here.</P
1056 >Now your printer is prepared for the clients to use. From
1057 a client, browse to the CUPS/Samba server, open the "Printers"
1058 share, right-click on this printer and select "Install..." or
1059 "Connect..." (depending on the Windows version you use). Now their
1060 should be a new printer in your client's local "Printers" folder,
1061 named (in my case) "infotec_IS2027 on kdebitshop"</P
1073 > will only reliably work i
1074 with CUPS version 1.1.15 or higher
1075 and Samba from 2.2.4. If it doesn't work, or if the automatic printer
1076 driver download to the clients doesn't succeed, you can still manually
1077 install the CUPS printer PPD on top of the Adobe PostScript driver on
1078 clients and then point the client's printer queue to the Samba printer
1079 share for connection, should you desire to use the CUPS networked
1080 PostScript RIP functions.</P
1089 >14.8. The CUPS Filter Chains</A
1092 >The following diagrams reveal how CUPS handles print jobs.</P
1094 CLASS="PROGRAMLISTING"
1095 >#########################################################################
1097 # CUPS in and of itself has this (general) filter chain (CAPITAL
1098 # letters are FILE-FORMATS or MIME types, other are filters (this is
1099 # true for pre-1.1.15 of pre-4.3 versions of CUPS and ESP PrintPro):
1115 # APPLICATION/POSTSCRIPT
1123 # APPLICATION/VND.CUPS-POSTSCRIPT
1127 # pstoraster # as shipped with CUPS, independent from any Ghostscipt
1128 # | # installation on the system
1129 # | (= "postscipt interpreter")
1132 # APPLICATION/VND.CUPS-RASTER
1139 > (f.e. Gimp-Print filters may be plugged in here)
1140 # | (= "raster driver")
1143 # SOMETHING-DEVICE-SPECIFIC
1150 # ESP PrintPro has some enhanced "rasterto<VAR
1153 >" filters as compared to
1154 # CUPS, and also a somewhat improved "pstoraster" filter.
1156 # NOTE: Gimp-Print and some other 3rd-Party-Filters (like TurboPrint) to
1157 # CUPS and ESP PrintPro plug-in where rasterto<VAR
1162 #########################################################################</PRE
1164 CLASS="PROGRAMLISTING"
1165 >#########################################################################
1167 # This is how "cupsomatic" comes into play:
1168 # =========================================
1184 # APPLICATION/POSTSCRIPT
1192 # APPLICATION/VND.CUPS-POSTSCRIPT ----------------+
1196 # pstoraster (constructs complicated
1197 # | (= "postscipt interpreter") Ghostscript commandline
1198 # | to let the file be
1200 # APPLICATION/VND.CUPS-RASTER "-sDEVICE=<VAR
1211 # | (= "raster driver") +-------------------------+
1212 # | | Ghostscript at work.... |
1214 # SOMETHING-DEVICE-SPECIFIC *-------------------------+
1218 # backend >------------------------------------+
1225 # Note, that cupsomatic "kidnaps" the printfile after the
1226 # "APPLICATION/VND.CUPS-POSTSCRPT" stage and deviates it through
1227 # the CUPS-external, systemwide Ghostscript installation, bypassing the
1228 # "pstoraster" filter (therefor also bypassing the CUPS-raster-drivers
1232 >", and hands the rasterized file directly to the CUPS
1235 # cupsomatic is not made by the CUPS developers. It is an independent
1236 # contribution to printing development, made by people from
1237 # Linuxprinting.org. (see also http://www.cups.org/cups-help.html)
1239 # NOTE: Gimp-Print and some other 3rd-Party-Filters (like TurboPrint) to
1240 # CUPS and ESP PrintPro plug-in where rasterto<VAR
1245 #########################################################################</PRE
1247 CLASS="PROGRAMLISTING"
1248 >#########################################################################
1250 # And this is how it works for ESP PrintPro from 4.3:
1251 # ===================================================
1267 # APPLICATION/POSTSCRIPT
1275 # APPLICATION/VND.CUPS-POSTSCRIPT
1280 # | (= "postscipt interpreter")
1283 # APPLICATION/VND.CUPS-RASTER
1290 > (f.e. Gimp-Print filters may be plugged in here)
1291 # | (= "raster driver")
1294 # SOMETHING-DEVICE-SPECIFIC
1300 # NOTE: Gimp-Print and some other 3rd-Party-Filters (like TurboPrint) to
1301 # CUPS and ESP PrintPro plug-in where rasterto<VAR
1306 #########################################################################</PRE
1308 CLASS="PROGRAMLISTING"
1309 >#########################################################################
1311 # This is how "cupsomatic" would come into play with ESP PrintPro:
1312 # ================================================================
1329 # APPLICATION/POSTSCRIPT
1337 # APPLICATION/VND.CUPS-POSTSCRIPT ----------------+
1341 # gsrip (constructs complicated
1342 # | (= "postscipt interpreter") Ghostscript commandline
1343 # | to let the file be
1345 # APPLICATION/VND.CUPS-RASTER "-sDEVICE=<VAR
1356 # | (= "raster driver") +-------------------------+
1357 # | | Ghostscript at work.... |
1359 # SOMETHING-DEVICE-SPECIFIC *-------------------------+
1363 # backend >------------------------------------+
1369 # NOTE: Gimp-Print and some other 3rd-Party-Filters (like TurboPrint) to
1370 # CUPS and ESP PrintPro plug-in where rasterto<VAR
1375 #########################################################################</PRE
1377 CLASS="PROGRAMLISTING"
1378 >#########################################################################
1380 # And this is how it works for CUPS from 1.1.15:
1381 # ==============================================
1397 # APPLICATION/POSTSCRIPT
1405 # APPLICATION/VND.CUPS-POSTSCRIPT-----+
1407 # +------------------v------------------------------+
1411 # | "-sDEVICE=cups") |
1413 # | (= "postscipt interpreter") |
1415 # +------------------v------------------------------+
1418 # APPLICATION/VND.CUPS-RASTER >-------+
1426 # | (= "raster driver")
1429 # SOMETHING-DEVICE-SPECIFIC
1436 # NOTE: since version 1.1.15 CUPS "outsourced" the pstoraster process to
1437 # Ghostscript. GNU Ghostscript needs to be patched to handle the
1438 # CUPS requirement; ESP Ghostscript has this builtin. In any case,
1439 # "gs -h" needs to show up a "cups" device. pstoraster is now a
1440 # calling an appropriate "gs -sDEVICE=cups..." commandline to do
1441 # the job. It will output "application/vnd.cup-raster", which will
1442 # be finally processed by a CUPS raster driver "rasterto<VAR
1446 # Note the difference to "cupsomatic", which will *not* output
1447 # CUPS-raster, but a final version of the printfile, ready to be
1448 # sent to the printer. cupsomatic also doesn't use the "cups"
1449 # devicemode in Ghostscript, but one of the classical devicemodes....
1451 # NOTE: Gimp-Print and some other 3rd-Party-Filters (like TurboPrint) to
1452 # CUPS and ESP PrintPro plug-in where rasterto<VAR
1457 #########################################################################</PRE
1459 CLASS="PROGRAMLISTING"
1460 >#########################################################################
1462 # And this is how it works for CUPS from 1.1.15, with cupsomatic included:
1463 # ========================================================================
1479 # APPLICATION/POSTSCRIPT
1487 # APPLICATION/VND.CUPS-POSTSCRIPT-----+
1489 # +------------------v------------------------------+
1490 # | Ghostscript . Ghostscript at work.... |
1491 # | at work... . (with "-sDEVICE= |
1496 # | "-sDEVICE=cups") . |
1498 # | (CUPS standard) . (cupsomatic) |
1500 # | (= "postscript interpreter") |
1502 # +------------------v--------------v---------------+
1505 # APPLICATION/VND.CUPS-RASTER >-------+ |
1513 # | (= "raster driver") |
1516 # SOMETHING-DEVICE-SPECIFIC >------------------------+
1523 # NOTE: Gimp-Print and some other 3rd-Party-Filters (like TurboPrint) to
1524 # CUPS and ESP PrintPro plug-in where rasterto<VAR
1529 ##########################################################################</PRE
1537 >14.9. CUPS Print Drivers and Devices</A
1540 >CUPS ships with good support for HP LaserJet type printers. You can install
1541 the driver as follows:
1548 > lpadmin -p laserjet4plus -v parallel:/dev/lp0 -E -m laserjet.ppd
1554 (The "-m" switch will retrieve the "laserjet.ppd" from the standard repository
1555 for not-yet-installed-PPDs, which CUPS typically stores in
1558 >/usr/share/cups/model</TT
1559 >. Alternatively, you may use
1560 "-P /absolute/filesystem/path/to/where/there/is/PPD/your.ppd").</P
1567 >14.9.1. Further printing steps</A
1570 >Always also consult the database on linuxprinting.org for all recommendations
1571 about which driver is best used for each printer:</P
1574 HREF="http://www.linuxprinting.org/printer_list.cgi"
1576 >http://www.linuxprinting.org/printer_list.cgi</A
1579 >There select your model and click on "Show". You'll arrive at a page listing
1580 all drivers working with your model. There will always be *one*
1587 > one. Try this one first. In your case
1588 ("HP LaserJet 4 Plus"), you'll arrive here:</P
1591 HREF="http://www.linuxprinting.org/show_printer.cgi?recnum=75104"
1593 >http://www.linuxprinting.org/show_printer.cgi?recnum=75104</A
1596 >The recommended driver is "ljet4". It has a link to the page for the ljet4
1600 HREF="http://www.linuxprinting.org/show_driver.cgi?driver=ljet4"
1602 >http://www.linuxprinting.org/show_driver.cgi?driver=ljet4</A
1605 >On the driver's page, you'll find important and detailed info about how to use
1606 that driver within the various available spoolers. You can generate a PPD for
1607 CUPS. The PPD contains all the info about how to use your model and the driver;
1608 this is, once installed, working transparently for the user -- you'll only
1609 need to choose resolution, paper size etc. from the web-based menu or from
1610 the print dialog GUI or from the commandline...</P
1612 >On the driver's page, choose to use the "PPD-O-Matic" online PPD generator
1613 program. Select your model and click "Generate PPD file". When you safe the
1614 appearing ASCII text file, don't use "cut'n'past" (as it could possiblly corrupt
1615 line endings and tabs), but use "Save as..." in your browser's menu. Save it
1616 at "/some/path/on/your/filesystem/somewhere/my-name-for-my-printer.ppd"</P
1618 >Then install the printer:</P
1621 CLASS="PROGRAMLISTING"
1622 > "lpadmin -p laserjet4plus -v parallel:/dev/lp0 -E \
1623 -P /some/path/on/your/filesystem/somewhere/my-name-for-my-printer.ppd"</PRE
1626 >Note, that for all the "Foomatic-PPDs" from Linuxprinting.org, you also need
1627 a special "CUPS filter" named "cupsomatic". Get the latest version of
1628 "cupsomatic" from:</P
1631 HREF="http://www.linuxprinting.org/cupsomatic"
1633 >http://www.linuxprinting.org/cupsomatic</A
1636 >This needs to be copied to <TT
1638 >/usr/lib/cups/filter/cupsomatic</TT
1640 and be made world executable. This filter is needed to read and act upon the
1641 specially encoded Foomatic comments, embedded in the printfile, which in turn
1642 are used to construct (transparently for you, the user) the complicated
1643 ghostscript command line needed for your printer/driver combo.</P
1645 >You can have a look at all the options for the Ghostscript commandline supported
1646 by your printer and the ljet4 driver by going to the section "Execution details",
1647 selecting your model (Laserjet 4 Plus) and clicking on "Show execution details".
1648 This will bring up this web page:</P
1651 HREF="http://www.linuxprinting.org/execution.cgi?driver=ljet4&printer=75104&.submit=Show+execution+details"
1653 >http://www.linuxprinting.org/execution.cgi?driver=ljet4&printer=75104&.submit=Show+execution+details</A
1656 >The ingenious thing is that the database is kept current. If there
1657 is a bug fix and an improvement somewhere in the database, you will
1658 always get the most current and stable and feature-rich driver by following
1659 the steps described above.</P
1674 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
1681 >Till Kamppeter from MandrakeSoft is doing an excellent job here that too few
1682 people are aware of. (So if you use it often, please send him a note showing
1683 your appreciation).</P
1689 >The latest and greatest improvement now is support for "custom page sizes"
1690 for all those printers which support it.</P
1692 >"cupsomatic" is documented here:</P
1695 HREF="http://www.linuxprinting.org/cups-doc.html"
1697 >http://www.linuxprinting.org/cups-doc.html</A
1700 >More printing tutorial info may be found here:</P
1703 HREF="http://www.linuxprinting.org/kpfeifle/LinuxKongress2002/Tutorial/"
1705 >http://www.linuxprinting.org/kpfeifle/LinuxKongress2002/Tutorial/</A
1708 >Note, that *all* the Foomatic drivers listed on Linuxprinting.org (now
1709 approaching the "all-time high" number of 1.000 for the supported models)
1710 are using a special filtering chain involving Ghostscript, as described
1711 in this document.</P
1713 >Summary - You need:</P
1725 >" PPD is not enough to print with CUPS (but it is *one* important component)</TD
1729 >The "cupsomatic" filter script (Perl) in <TT
1731 >/usr/lib/cups/filters/</TT
1736 >Perl to make cupsomatic run</TD
1740 >Ghostscript (because it is called and controlled by the PPD/cupsomatic combo in a way to fit your printermodel/driver combo.</TD
1744 >Ghostscript *must*, depending on the driver/model, contain support for a certain "device" (as shown by "gs -h")</TD
1752 >In the case of the "hpijs" driver, you need a Ghostscript version, which
1753 has "ijs" amongst its supported devices in "gs -h". In the case of
1754 "hpijs+foomatic", a valid ghostscript commandline would be reading like this:</P
1757 CLASS="PROGRAMLISTING"
1758 > gs -q -dBATCH -dPARANOIDSAFER -dQUIET -dNOPAUSE -sDEVICE=ijs \
1759 -sIjsServer=hpijs<VAR
1772 >,PS:MediaPosition=<VAR
1775 > -dIjsUseOutputFD \
1776 -sOutputFile=- -</PRE
1792 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
1799 >Note, that with CUPS and the "hpijs+foomatic" PPD (plus Perl and cupsomatic)
1800 you don't need to remember this. You can choose the available print options
1801 thru a GUI print command (like "glp" from ESP's commercially supported
1802 PrintPro software, or KDE's "kprinter", or GNOME's "gtklp" or the independent
1803 "xpp") or the CUPS web interface via human-readable drop-down selection
1810 >If you use "ESP Ghostscript" (also under the GPL, provided by Easy Software
1811 Products, the makers of CUPS, downloadable from
1813 HREF="http://www.cups.org/software.html"
1815 >http://www.cups.org/software.html</A
1817 co-maintained by the developers of linuxprinting.org), you are guaranteed to
1818 have in use the most uptodate, bug-fixed, enhanced and stable version of a Free
1819 Ghostscript. It contains support for ~300 devices, whereas plain vanilla
1820 GNU Ghostscript 7.05 only has ~200.</P
1822 >If you print only one CUPS test page, from the web interface and when you try to
1823 print a windows test page, it acts like the job was never sent:
1832 >Can you print "standard" jobs from the CUPS machine?</TD
1836 >Are the jobs from Windows visible in the Web interface on CUPS (http://localhost:631/)?</TD
1846 > What kind of printer driver are you using on the Windows clients?</TD
1854 You can try to get a more detailed debugging info by setting "LogLevel debug" in
1857 >/etc/cups/cupsd.conf</TT
1858 >, re-start cupsd and investigate <TT
1860 >/var/log/cups/error_log</TT
1862 for the whereabouts of your Windows-originating printjobs:</P
1870 >what does the "auto-typing" line say? which is the "MIME type" CUPS thinks is arriving from the Windows clients?</TD
1874 >are there "filter" available for this MIME type?</TD
1878 >are there "filter rules" defined in "/etc/cups/mime.convs" for this MIME type?</TD
1892 >14.10. Limiting the number of pages users can print</A
1895 >The feature you want is dependent on the real print subsystem you're using.
1896 Samba's part is always to receive the job files from the clients (filtered
1897 *or* unfiltered) and hand it over to this printing subsystem.</P
1899 >Of course one could "hack" things with one's own scripts.</P
1901 >But there is CUPS (Common Unix Printing System). CUPS supports "quotas".
1902 Quotas can be based on sizes of jobs or on the number of pages or both,
1903 and are spanning any time period you want.</P
1905 >This is an example command how root would set a print quota in CUPS,
1906 assuming an existing printer named "quotaprinter":</P
1908 CLASS="PROGRAMLISTING"
1909 > lpadmin -p quotaprinter -o job-quota-period=604800 -o job-k-limit=1024 \
1910 -o job-page-limit=100</PRE
1912 >This would limit every single user to print 100 pages or 1024 KB of
1913 data (whichever comes first) within the last 604.800 seconds ( = 1 week).</P
1915 >For CUPS to count correctly, the printfile needs to pass the CUPS "pstops" filter,
1916 otherwise it uses a "dummy" count of "1". Some printfiles don't pass it
1917 (eg: image files) but then those are mostly 1 page jobs anyway. This also means,
1918 proprietary drivers for the target printer running on the client computers and
1919 CUPS/Samba then spooling these files as "raw" (i.e. leaving them untouched, not
1920 filtering them), will be counted as "1-pagers" too!</P
1922 >You need to send PostScript from the clients (i.e. run a PostScript driver there)
1923 for having the chance to get accounting done. If the printer is a non-PostScript model,
1924 you need to let CUPS do the job to convert the file to a print-ready format for the
1925 target printer. This will be working for currently ~1.000 different printer models, see</P
1927 CLASS="PROGRAMLISTING"
1928 > http://www.linuxprinting.org/printer_list.cgi</PRE
1930 >Before CUPS-1.1.16 your only option was to use the Adobe PostScript
1931 Driver on the Windows clients. The output of this driver was not always
1932 passed thru the "pstops" filter on the CUPS/Samba side, and therefor was
1933 not counted correctly (the reason is that it often --- depending on the
1934 "PPD" being used --- did write a "PJL"-header in front of the real
1935 PostScript which made CUPS to skip the pstops and go directy to
1936 the "pstoraster" stage).</P
1938 >From CUPS-1.1.16 onward you can use the "CUPS PostScript Driver
1939 for Windows NT/2K/XP clients" (it is tagged in the download area of
1940 http://www.cups.org/ as the "cups-samba-1.1.16.tar.gz" package).
1941 It is *not* working for Win9x/ME clients. But it:</P
1949 >it guarantees to not write an PJL-header</TD
1953 >it guarantees to still read and support all PJL-options named in the driver PPD with its own means</TD
1957 >it guarantees the file going thru the "pstops" filter on the CUPS/Samba server</TD
1961 >it guarantees to page-count correctly the printfile</TD
1968 >You can read more about the setup of this combination in the
1969 manpage for "cupsaddsmb" (only present with CUPS installed, only
1970 current with CUPS 1.1.16).</P
1972 >These are the items CUPS logs in the "page_log" for every single *page* of a job:</P
1993 >Time of printing</TD
1997 >the page number</TD
2001 >the number of copies</TD
2005 >a billing info string (optional)</TD
2013 >Here is an extract of my CUPS server's page_log file to illustrate
2014 the format and included items:</P
2017 CLASS="COMPUTEROUTPUT"
2018 > infotec_IS2027 kurt 40 [22/Nov/2002:13:18:03 +0100] 1 2 #marketing
2019 infotec_IS2027 kurt 40 [22/Nov/2002:13:18:03 +0100] 2 2 #marketing
2020 infotec_IS2027 kurt 40 [22/Nov/2002:13:18:03 +0100] 3 2 #marketing
2021 infotec_IS2027 kurt 40 [22/Nov/2002:13:18:03 +0100] 4 2 #marketing
2022 infotec_IS2027 kurt 40 [22/Nov/2002:13:18:03 +0100] 5 2 #marketing
2023 infotec_IS2027 kurt 40 [22/Nov/2002:13:18:03 +0100] 6 2 #marketing</SAMP
2026 >This was Job ID "40", printed on "infotec_IS2027" by user "kurt", a 6-page job
2027 printed in 2 copies and billed to "#marketing"...</P
2029 >What flaws or shortcomings are there?</P
2037 >the ones named above</TD
2041 > CUPS really counts the job pages being *processsed in software*
2042 (going thru the "RIP") rather than the physical sheets successfully
2043 leaving the printing device -- if there is a jam while printing
2044 the 5th sheet out of 1000 and the job is aborted by the printer,
2045 the "page count" will still show the figure of 1000 for that job
2050 > all quotas are the same for all users (no flexibility to give the
2051 boss a higher quota than the clerk) no support for groups
2056 > no means to read out the current balance or "used-up" number of current quota
2061 > a user having used up 99 sheets of 100 quota will still be able to send and print a 1.000 sheet job
2066 > a user being denied a job because of a filled-up quota doesn't get a meaningful
2067 error message from CUPS other than "client-error-not-possible".
2075 >But this is the best system out there currently. And there are
2076 huge improvements under development:</P
2084 >page counting will go into the "backends" (these talk
2085 directly to the printer and will increase the count in sync with the
2086 actual printing process -- a jam at the 5th sheet will lead to a stop in the counting)</TD
2090 >quotas will be handled more flexibly</TD
2094 >probably there will be support for users to inquire their "accounts" in advance</TD
2098 >probably there will be support for some other tools around this topic</TD
2105 >Other than the current stage of the CUPS development, I don't
2106 know any other ready-to-use tool which you could consider.</P
2108 >You can download the driver files from
2110 HREF="http://www.cups.org/software.html"
2112 >http://www.cups.org/software.html</A
2114 It is a separate package from the CUPS base software files, tagged as "CUPS 1.1.16
2115 Windows NT/2k/XP Printer Driver for SAMBA (tar.gz, 192k)". The filename to
2116 download is "cups-samba-1.1.16.tar.gz". Upon untar-/unzip-ping it will reveal
2120 CLASS="COMPUTEROUTPUT"
2121 > cups-samba.install
2130 >These have been packaged with the ESP meta packager software "EPM". The
2131 *.install and *.remove files are simple shell script, which untars the
2132 *.ss (which is nothing else than a tar-archive) and puts its contents
2135 >/usr/share/cups/drivers/</TT
2136 >. Its contents are 3 files:</P
2139 CLASS="COMPUTEROUTPUT"
2160 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/caution.gif"
2167 >Due to a bug one CUPS release puts the <TT
2173 >/usr/share/drivers/</TT
2177 >/usr/share/cups/drivers/</TT
2178 >. To work around this, copy/move
2179 the file after running the "./cups-samba.install" script manually to the right place:</P
2183 > cp /usr/share/drivers/cups.hlp /usr/share/cups/drivers/
2205 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
2212 >This new CUPS PostScript driver is currently binary-only, but free
2213 no source code is provided (yet). The reason is this: it has
2214 been developed with the help of the Microsoft Driver Developer Kit (DDK)
2215 and compiled with Microsoft Visual Studio 6. It is not clear to the driver
2216 developers if they are allowed to distribute the whole of the source code
2217 as Free Software. However, they will likely release the "diff" in source
2218 code under the GPL, so anybody with a license of Visual Studio and a DDK
2219 will be able to compile for him/herself.</P
2221 >Once you have run the install script (and possibly manually moved the
2222 "cups.hlp" file to "/usr/share/cups/drivers/"), the driver is ready to be
2223 put into Samba's [print$] share (which often maps to "/etc/samba/drivers/"
2224 and contains a subdir tree with WIN40 and W32X86 branches), by running
2225 "cupsaddsmb" (see also "man cupsaddsmb" for CUPS 1.1.16). [Don't forget to
2226 put root into the smbpasswd file by running "smbpasswd" should you run
2227 this whole procedure for the first time.] Once the driver files are in the
2228 [print$] share, they are ready to be downloaded and installed by the
2229 Win NT/2k/XP clients.</P
2248 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
2255 > Win 9x/ME clients won't work with this driver. For these you'd
2256 still need to use the ADOBE*.* drivers as previously.
2276 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
2283 > It is not harming if you've still the ADOBE*.* driver files from
2284 previous installations in the "/usr/share/cups/drivers/" directory.
2285 The new cupsaddsmb (from 1.1.16) will automatically use the
2286 "newest" installed driver (which here then is the CUPS drivers).
2306 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
2313 > Should your Win clients have had the old ADOBE*.* files and the
2314 Adobe PostScript drivers installed, the download and installation
2315 of the new CUPS PostScript driver for Windows NT/2k/XP will fail
2319 > It is not enough to "delete" the printer (as the driver files
2320 will still be kept by the clients and re-used if you try to
2321 re-install the printer). To really get rid of the Adobe driver
2322 files on the clients, open the "Printers" folder (possibly via
2323 "Start --> Settings --> Control Panel --> Printers"), right-click
2324 onto the folder background and select "Server Properties". A
2325 new dialog opens; select the "Drivers" tab; on the list select
2326 the driver you want to delete and click on the "Delete" button.
2327 (This will only work if there is no single printer left which
2328 uses that particular driver -- you need to "delete" all printers
2329 using this driver in the "Printers" folder first.)
2349 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
2356 > Once you have successfully downloaded the CUPS PostScript driver
2357 to a client, you can easily switch all printers to this one
2358 by proceeding as described elsewhere in the "Samba HOWTO
2359 Collection" to change a driver for an existing printer.
2366 >What are the benefits with the "CUPS PostScript driver for Windows NT/2k/XP"
2367 as compared to the Adobe drivers?</P
2374 > no hassle with the Adobe EULA
2379 > no hassle with the question "where do I get the ADOBE*.* driver files from?"
2384 > the Adobe drivers (depending on the printer PPD associated with them)
2385 often put a PJL header in front of the core PostScript part of the print
2386 file (thus the file starts with "<VAR
2393 instead of "%!PS"). This leads to the CUPS daemon autotyping the
2394 arriving file as a print-ready file, not requiring a pass thru the
2395 "pstops" filter (to speak more technical, it is not regarded as the
2396 generic MIME type "application/postscript", but as the more special
2397 MIME type "application/cups.vnd-postscript"), which therefore also
2398 leads to the page accounting in "/var/log/cups/page_log" not receiving
2399 the exact mumber of pages; instead the dummy page number of "1" is
2400 logged in a standard setup)
2405 > the Adobe driver has more options to "mis-configure" the PostScript
2406 generated by it (like setting it inadvertedly to "Optimize for Speed",
2407 instead of "Optimize for Portability", which could lead to CUPS being
2408 unable to process it)
2413 > the CUPS PostScript driver output sent by Windows clients to the CUPS
2414 server will be guaranteed to be auto-typed as generic MIME type
2415 "application/postscript", thusly passing thru the CUPS "pstops" filter
2416 and logging the correct number of pages in the page_log for accounting
2422 > the CUPS PostScript driver supports the sending of additional print
2423 options by the Win NT/2k/XP clients, such as naming the CUPS standard
2424 banner pages (or the custom ones, should they be installed at the time
2425 of driver download), using the CUPS "page-label" option, setting a
2426 job-priority and setting the scheduled time of printing (with the option
2427 to support additional useful IPP job attributes in the future).
2432 > the CUPS PostScript driver supports the inclusion of the new
2433 "*cupsJobTicket" comments at the beginnig of the PostScript file (which
2434 could be used in the future for all sort of beneficial extensions on
2435 the CUPS side, but which will not disturb any other application as those
2436 will regard it as a comment and simply ignore it).
2441 > the CUPS PostScript driver will be the heart of the fully fledged CUPS
2442 IPP client for Windows NT/2k/XP to be released soon (probably alongside
2443 the first Beta release for CUPS 1.2).
2455 >14.11. Advanced Postscript Printing from MS Windows</A
2458 >Let the Windows Clients use a PostScript driver to deliver poistscript to
2459 the samba print server (just like any Linux or Unix Client would also use
2460 PostScript to send to the server)</P
2462 >Make the Unix printing subsystem to which Samba sends the job convert the
2463 incoming PostScript files to the native print format of the target printers
2464 (would be PCL if you have an HP printer)</P
2466 >Now if you are afraid that this would just mean using a *Generic* PostScript
2467 driver for the clients that has no Simplex/Duplex selection, and no paper tray
2468 choice, but you need them to be able to set up print jobs, with all the bells
2469 and whistles of your printers:-</P
2477 >Not possible with traditional spooling systems</TD
2481 > But perfectly supported by CUPS (which uses "PPD" files to
2482 describe how to control the print options for PostScript and
2483 non-PostScript devices alike...
2491 >CUPS PPDs are working perfectly on Windows clients who use Adobe PostScript
2492 drivers (or the new CUPS PostScript driver for Windows NT/2K/XP). Clients can use
2493 them to setup the job to their liking and CUPS will use the received job options
2494 to make the (PCL-, ESC/P- or PostScript-) printer behave as required.</P
2496 >If you want to have the additional benefit of page count logging and accounting
2497 then the CUPS PostScript driver is the best choice (better than the Adobe one).</P
2499 >If you want to make the drivers downloadable for the clients then "cupsaddsmb" is
2500 your friend. It will setup the [print$] share on the Samba host to be ready to serve
2501 the clients for a "point and print" driver installation.</P
2516 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/warning.gif"
2523 >What strings are attached?</P
2529 >There are some. But, given the sheer CPU power you can buy nowadays,
2530 these can be overcome easily. The strings:</P
2532 >Well, if the CUPS/Samba side will have to print to many printers serving many users,
2533 you probably will need to set up a second server (which can do automatic load balancing
2534 with the first one, plus a degree of fail-over mechanism). Converting the incoming
2535 PostScript jobs, "interpreting" them for non-PostScript printers, amounts to the work
2536 of a "RIP" (Raster Image Processor) done in software. This requires more CPU and RAM
2537 than for the mere "raw spooling" task your current setup is solving. It all depends
2538 on the avarage and peak printing load the server should be able to handle.</P
2546 >14.12. Auto-Deletion of CUPS spool files</A
2549 >Samba print files pass thru two "spool" directories. One the incoming directory
2550 managed by Samba, (set eg: in the <B
2552 >path = /var/spool/samba</B
2553 > directive in the [printers]
2557 >). Second is the spool directory of your UNIX print subsystem.
2558 For CUPS it is normally "/var/spool/cups/", as set by the cupsd.conf directive
2559 "RequestRoot /var/spool/cups".</P
2561 >I am not sure, which one of your directories keeps the files. From what you say,
2562 it is most likely the Samba part.</P
2564 >For the CUPS part, you may want to consult:</P
2572 >http://localhost:631/sam.html#PreserveJobFiles</TD
2576 >http://localhost:631/sam.html#PreserveJobHistory</TD
2580 >http://localhost:631/sam.html#MaxJobs</TD
2587 >There are the settings described for your CUPS daemon, which could lead to completed
2588 job files not being deleted.</P
2590 >"PreserveJobHistory Yes" -- keeps some details of jobs in
2591 cupsd's mind (well it keeps the "c12345", "c12346" etc. files
2592 in the CUPS spool directory, which do a similar job as the
2593 old-fashioned BSD-LPD control files). This is set to "Yes"
2596 >"PreserveJobFiles Yes" -- keeps the job files themselves in
2597 cupsd's mind (well it keeps the "d12345", "d12346" etc. files
2598 in the CUPS spool directory...). This is set to "No" as the
2601 >"MaxJobs 500" -- this directive controls the maximum number
2602 of jobs that are kept in memory. Once the number of jobs
2603 reaches the limit, the oldest completed job is automatically
2604 purged from the system to make room for the new one. If all
2605 of the known jobs are still pending or active then the new
2606 job will be rejected. Setting the maximum to 0 disables this
2607 functionality. The default setting is 0.</P
2609 >(There are also additional settings for "MaxJobsPerUser" and
2610 "MaxJobsPerPrinter"...)</P
2612 >For everything to work as announced, you need to have three things:</P
2623 > which is compiled against "libcups" (Check on Linux by running <KBD
2625 >ldd `which smbd`</KBD
2669 SRC="/usr/share/sgml/docbook/stylesheet/dsssl/modular/images/note.gif"
2676 >Note, that in this case all other manually set printing-related
2677 commands (like "print command", "lpq command", "lprm command",
2678 "lppause command" or "lpresume command") are ignored and they
2679 should normally have no influence what-so-ever on your printing.</P
2685 >If you want to do things manually, replace the "printing = cups"
2686 by "printing = bsd". Then your manually set commands may work
2687 (haven't tested this), and a "print command = lp -d %P %s; rm %s"
2688 may do what you need.</P
2690 >You forgot to mention the CUPS version you're using. If you did
2691 set things up as described in the man pages, then the Samba
2692 spool files should be deleted. Otherwise it may be a bug. On
2693 the CUPS side, you can control the behaviour as described
2696 >If you have more problems, post the output of these commands:</P
2700 > grep -v ^# /etc/cups/cupsd.conf | grep -v ^$
2701 grep -v ^# /etc/samba/smb.conf | grep -v ^$ | grep -v "^;"</KBD
2704 >(adapt paths as needed). These commands sanitize the files
2705 and cut out the empty lines and lines with comments, providing
2706 the "naked settings" in a compact way.</P
2714 SUMMARY="Footer navigation table"
2725 HREF="printing.html"
2734 HREF="samba-howto-collection.html"
2753 >Printing Support</TD
2759 HREF="optional.html"
2767 >Unified Logons between Windows NT and UNIX using Winbind</TD