18.13 CUPS Print Drivers from Linuxprinting.org

CUPS ships with good support for HP LaserJet-type printers. You can install the generic driver as follows :

 root# lpadmin -p laserjet4plus -v parallel:/dev/lp0 -E -m laserjet.ppd 

The -m switch will retrieve the laserjet.ppd from the standard repository for not-yet-installed-PPDs, which CUPS typically stores in /usr/share/cups/model . Alternately, you may use -P / path /to/your.ppd .

The generic laserjet.ppd , however, does not support every special option for every LaserJet-compatible model. It constitutes a sort of " least common denominator " of all the models. If for some reason you must pay for the commercially available ESP Print Pro drivers, your first move should be to consult the database on http://www.linuxprinting.org/printer_list.cgi. Linuxprinting.org has excellent recommendations about which driver is best used for each printer. Its database is kept current by the tireless work of Till Kamppeter from MandrakeSoft, who is also the principal author of the foomatic-rip utility.



The former cupsomatic concept is now being replaced by the new successor, a much more powerful foomatic-rip. cupsomatic is no longer maintained . Here is the new URL to the Foomatic-3.0 database: http://www.linuxprinting.org/driver_list.cgi. If you upgrade to foomatic-rip , remember to also upgrade to the new-style PPDs for your Foomatic-driven printers. foomatic-rip will not work with PPDs generated for the old cupsomatic . The new-style PPDs are 100% compliant to the Adobe PPD specification. They are also intended to be used by Samba and the cupsaddsmb utility, to provide the driver files for the Windows clients !

18.13.1 foomatic-rip and Foomatic Explained

Nowadays, most Linux distributions rely on the utilities of Linuxprinting.org to create their printing- related software (which, by the way, works on all UNIXes and on Mac OS X or Darwin, too). It is not known as well as it should be, that it also has a very end- user -friendly interface that allows for an easy update of drivers and PPDs for all supported models, all spoolers, all operating systems, and all package formats (because there is none). Its history goes back a few years .

Recently, Foomatic has achieved the astonishing milestone of 1000 listed [12] printer models. Linuxprinting.org keeps all the important facts about printer drivers, supported models and which options are available for the various driver/printer combinations in its Foomatic [13] database. Currently there are 245 drivers [14] in the database. Many drivers support various models, and many models may be driven by different drivers ” its your choice!

[12] http://www.linuxprinting.org/printer_list.cgi?make=Anyone

[13] http://www.linuxprinting.org/foomatic.html

[14] http://www.linuxprinting.org/driver_list.cgi 690 " Perfect " Printers

At present, there are 690 devices dubbed as working perfectly, 181 mostly, 96 partially, and 46 are paperweights. Keeping in mind that most of these are non-PostScript models (PostScript printers are automatically supported by CUPS to perfection , by using their own manufacturer-provided Windows-PPD), and that a multifunctional device never qualifies as working perfectly if it does not also scan and copy and fax under GNU/Linux ” then this is a truly astonishing achievement! Three years ago the number was not more than 500, and Linux or UNIX printing at the time wasn't anywhere near the quality it is today. How the Printing HOWTO Started It All

A few years ago Grant Taylor [15] started it all. The roots of today's Linuxprinting.org are in the first Linux Printing HOWTO [16] that he authored . As a side-project to this document, which served many Linux users and admins to guide their first steps in this complicated and delicate setup (to a scientist, printing is " applying a structured deposition of distinct patterns of ink or toner particles on paper substrates ", he started to build in a little Postgres database with information about the hardware and driver zoo that made up Linux printing of the time. This database became the core component of today's Foomatic collection of tools and data. In the meantime, it has moved to an XML representation of the data.

[15] http://www2.picante.com:81/~gtaylor/

[16] http://www.linuxprinting.org/foomatic2.9/howto/ Foomatic's Strange Name

" Why the funny name? " you ask. When it really took off, around spring 2000, CUPS was far less popular than today, and most systems used LPD, LPRng or even PDQ to print. CUPS shipped with a few generic drivers (good for a few hundred different printer models). These didn't support many device-specific options. CUPS also shipped with its own builtin rasterization filter ( pstoraster , derived from Ghostscript). On the other hand, CUPS provided brilliant support for controlling all printer options through standardized and well-defined PPD files (PostScript Printers Description files). Plus, CUPS was designed to be easily extensible.

Taylor already had in his database a respectable compilation of facts about many more printers and the Ghostscript " drivers " they run with. His idea, to generate PPDs from the database information and use them to make standard Ghostscript filters work within CUPS, proved to work very well. It also killed several birds with one stone:

  • It made all current and future Ghostscript filter developments available for CUPS.

  • It made available a lot of additional printer models to CUPS users (because often the traditional Ghostscript way of printing was the only one available).

  • It gave all the advanced CUPS options (Web interface, GUI driver configurations) to users wanting (or needing) to use Ghostscript filters. cupsomatic, pdqomatic, lpdomatic, directomatic

CUPS worked through a quickly-hacked up filter script named cupsomatic. [17] cupsomatic ran the printfile through Ghostscript, constructing automatically the rather complicated command line needed. It just needed to be copied into the CUPS system to make it work. To configure the way cupsomatic controls the Ghostscript rendering process, it needs a CUPS-PPD. This PPD is generated directly from the contents of the database. For CUPS and the respective printer/filter combo, another Perl script named CUPS-O-Matic did the PPD generation. After that was working, Taylor implemented within a few days a similar thing for two other spoolers. Names chosen for the config-generator scripts were PDQ-O-Matic [18] (for PDQ) and LPD-O-Matic [19] (for ” you guessed it ” LPD); the configuration here didn't use PPDs but other spooler-specific files.

[17] http://www.linuxprinting.org/download.cgi?filename=cupsomatic&show=0

[18] http://www.linuxprinting.org/download.cgi?filename=lpdomatic&show=0

[19] http://www.linuxprinting.org/download.cgi?filename=lpdomatic&show=0

From late summer of that year, Till Kamppeter [20] started to put work into the database. Kamppeter had been newly employed by MandrakeSoft [21] to convert its printing system over to CUPS, after they had seen his FLTK [22] -based XPP [23] (a GUI frontend to the CUPS lp-command). He added a huge amount of new information and new printers. He also developed the support for other spoolers, like PPR [24] (via ppromatic), GNUIpr [25] and LPRng [26] (both via an extended lpdomatic) and spoolerless printing (directomatic [27] ).

[20] http://www.linuxprinting.org/till/

[21] http://www.mandrakesoft.com/

[22] http://www.fltk.org/

[23] http://cups. sourceforge .net/xpp/

[24] http://ppr.sourceforge.net/

[25] http://sourceforge.net/projects/lpr/

[26] http://www.lprng.org/

[27] http://www.linuxprinting.org/download.cgi?filename=directomatic&show=0

So, to answer your question: " Foomatic " is the general name for all the overlapping code and data behind the "* omatic " scripts. Foomatic, up to versions 2.0.x, required (ugly) Perl data structures attached to Linuxprinting.org PPDs for CUPS. It had a different " *omatic " script for every spooler, as well as different printer configuration files. The Grand Unification Achieved

This has all changed in Foomatic versions 2.9 (beta) and released as " stable " 3.0. It has now achieved the convergence of all *omatic scripts and is called the foomatic-rip. [28] This single script is the unification of the previously different spooler-specific *omatic scripts. foomatic-rip is used by all the different spoolers alike and because it can read PPDs (both the original PostScript printer PPDs and the Linuxprinting.org-generated ones), all of a sudden all supported spoolers can have the power of PPDs at their disposal. Users only need to plug foomatic-rip into their system. For users there is improved media type and source support ” paper sizes and trays are easier to configure.

[28] http://www.linuxprinting.org/foomatic2.9/download.cgi?filename=foomatic-rip&show=0

Also, the New Generation of Linuxprinting.org PPDs no longer contains Perl data structures. If you are a distro maintainer and have used the previous version of Foomatic, you may want to give the new one a spin, but remember to generate a new-version set of PPDs via the new foomatic-db-engine! [29] Individual users just need to generate a single new PPD specific to their model by following the steps [30] outlined in the Foomatic tutorial or in this chapter. This new development is truly amazing.

[29] http://www.linuxprinting.org/download/foomatic/foomatic-db-engine-3.0.0betal.tar.gz

[30] http://www.linuxprinting.org/kpfeifle/LinuxKongress2002/Tutorial/II.Foomatic-User/II.tutorial-handout-foomatic-user.html

foomatic-rip is a very clever wrapper around the need to run Ghostscript with a different syntax, options, device selections, and/or filters for each different printer or spooler. At the same time it can read the PPD associated with a print queue and modify the print job according to the user selections. Together with this comes the 100% compliance of the new Foomatic PPDs with the Adobe spec. Some innovative features of the Foomatic concept may surprise users. It will support custom paper sizes for many printers and will support printing on media drawn from different paper trays within the same job (in both cases, even where there is no support for this from Windows-based vendor printer drivers). Driver Development Outside

Most driver development itself does not happen within Linuxprinting.org. Drivers are written by independent maintainers. Linuxprinting.org just pools all the information and stores it in its database. In addition, it also provides the Foomatic glue to integrate the many drivers into any modern (or legacy) printing system known to the world.

Speaking of the different driver development groups, most of the work is currently done in three projects. These are:

  • Omni [31] a free software project by IBM that tries to convert their printer driver knowledge from good-ol' OS/2 times into a modern, modular, universal driver architecture for Linux/UNIX (still beta). This currently supports 437 models.

  • HPIJS [32] a free software project by HP to provide the support for their own range of models (very mature, printing in most cases is perfect and provides true photo quality). This currently supports 369 models.

  • Gimp-Print [33] a free software effort, started by Michael Sweet (also lead developer for CUPS), now directed by Robert Krawitz, which has achieved an amazing level of photo print quality (many Epson users swear that its quality is better than the vendor drivers provided by Epson for the Microsoft platforms). This currently supports 522 models. Forums, Downloads, Tutorials, Howtos ” also for Mac OS X and Commercial UNIX

Linuxprinting.org today is the one-stop shop to download printer drivers. Look for printer information and tutorials [34] or solve printing problems in its popular forums. [35] This forum it's not just for GNU/Linux users, but admins of commercial UNIX systems [36] are also going there, and the relatively new Mac OS X forum [37] has turned out to be one of the most frequented forums after only a few weeks.

[34] http://www.linuxprinting.org//kpfeifle/LinuxKongress2002/Tutorial/

[35] http://www.linuxprinting.org/newsportal/

[36] http://www.linuxprinting.org/macosx/

[37] http://www.linuxprinting.org/newsportal/thread.php3?name=linuxprinting.macosx.general

Linuxprinting.org and the Foomatic driver wrappers around Ghostscript are now a standard toolchain for printing on all the important distros. Most of them also have CUPS underneath. While in recent years most printer data had been added by Kamppeter (who works at Mandrake), many additional contributions came from engineers with SuSE, RedHat, Connectiva, Debian, and others. Vendor-neutrality is an important goal of the Foomatic project.



Till Kamppeter from MandrakeSoft is doing an excellent job in his spare time to maintain Linuxprinting.org and Foomatic. So if you use it often, please send him a note showing your appreciation Foomatic Database-Generated PPDs

The Foomatic database is an amazing piece of ingenuity in itself. Not only does it keep the printer and driver information, but it is organized in a way that it can generate PPD files on the fly from its internal XML-based datasets. While these PPDs are modelled to the Adobe specification of PostScript Printer Descriptions (PPDs), the Linuxprinting.org/Foomatic-PPDs do not normally drive PostScript printers. They are used to describe all the bells and whistles you could ring or blow on an Epson Stylus inkjet, or a HP Photosmart, or what-have-you. The main trick is one little additional line, not envisaged by the PPD specification, starting with the *cupsFilter keyword. It tells the CUPS daemon how to proceed with the PostScript print file (old-style Foomatic-PPDs named the cupsomatic filter script, while the new-style PPDs are now call foomatic-rip). This filter script calls Ghostscript on the host system (the recommended variant is ESP Ghostscript) to do the rendering work. foomaticrip knows which filter or internal device setting it should ask from Ghostscript to convert the PostScript printjob into a raster format ready for the target device. This usage of PPDs to describe the options of non-PS printers was the invention of the CUPS developers. The rest is easy. GUI tools (like KDE's marvelous kprinter, [38] or the GNOME gtklp, [39] xpp and the CUPS Web interface) read the PPD as well and use this information to present the available settings to the user as an intuitive menu selection.

[38] http://printing.kde.org/overview/kprinter. phtml

[39] http://gtklp.sourceforge.net/

18.13.2 foomatic-rip and Foomatic-PPD Download and Installation

Here are the steps to install a foomatic-rip driven LaserJet 4 Plus-compatible printer in CUPS (note that recent distributions of SuSE, UnitedLinux and Mandrake may ship with a complete package of Foomatic-PPDs plus the foomatic-rip utility. Going directly to Linuxprinting.org ensures that you get the latest driver/PPD files):

  • Open your browser at the Linuxprinting.org printer listpage. [40]

    [40] http://www.linuxprinting.org/printer_list.cgi

  • Check the complete list of printers in the database. [41]

    [41] http://www.linuxprinting.org/printer_list.cgi?make=Anyone

  • Select your model and click on the link.

  • You'll arrive at a page listing all drivers working with this model (for all printers, there will always be one recommended driver. Try this one first).

  • In our case (HP LaserJet 4 Plus), we'll arrive at the default driver for the HP-LaserJet 4 Plus. [42]

    [42] http://www.linuxprinting.org/show_printer.cgi?recnum=HP-LaserJet_4_Plus

  • The recommended driver is ljet4.

  • Several links are provided here. You should visit them all if you are not familiar with the Linuxprinting.org database.

  • There is a link to the database page for the ljet4. [43] On the driver's page, you'll find important and detailed information about how to use that driver within the various available spoolers.

    [43] http://www.linuxprinting.org/show_driver.cgi?driver=ljet4

  • Another link may lead you to the homepage of the driver author or the driver.

  • Important links are the ones that provide hints with setup instructions for CUPS, PDQ [44] , LPD, LPRng and GNUlpr [45] ) as well as PPR [46] or " spooler-less " printing. [47]

    [44] http://www.linuxprinting.org/pdq-doc.html

    [45] http://www.linuxprinting.org/lpd-doc.html

    [46] http://www.linuxprinting.org/ppr-doc.html

    [47] http://www.linuxprinting.org/direct-doc.html

  • You can view the PPD in your browser through this link: http://www.linuxprinting.org/ppd-o-matic.cgi?driver=ljet4&printer=HP-LaserJet_4_Plus&show=1

  • Most importantly, you can also generate and download the PPD. [48]

    [48] http://www.linuxprinting.org/ppd-o-matic.cgi?driver=ljet4&printer=HP-LaserJet_4_Plus&show=0

  • The PPD contains all the information needed to use our model and the driver; once installed, this works transparently for the user. Later you'll only need to choose resolution, paper size, and so on from the Web-based menu, or from the print dialog GUI, or from the command line.

  • If you ended up on the drivers page [49] you can choose to use the " PPD-O-Matic " online PPD generator program.

    [49] http://www.linuxprinting.org/show_driver.cgi?driver=ljet4

  • Select the exact model and check either Download or Display PPD file and click Generate PPD file .

  • If you save the PPD file from the browser view, please do not use cut and paste (since it could possibly damage line endings and tabs, which makes the PPD likely to fail its duty), but use Save as... in your browser's menu. (It is best to use the Download option directly from the Web page).

  • Another interesting part on each driver page is the Show execution details button. If you select your printer model and click on that button, a complete Ghostscript command line will be displayed, enumerating all options available for that combination of driver and printer model. This is a great way to " learn Ghostscript by doing ". It is also an excellent cheat sheet for all experienced users who need to re-construct a good command line for that damn printing script, but can't remember the exact syntax.

  • Some time during your visit to Linuxprinting.org, save the PPD to a suitable place on your harddisk, say /path/to/my-printer.ppd (if you prefer to install your printers with the help of the CUPS Web interface, save the PPD to the /usr/share/cups/model/ path and restart cupsd).

  • Then install the printer with a suitable command line, like this:

     root# lpadmin -p laserjet4plus -v parallel:/dev/lp0 -E \ -P path/to/my-printer.ppd 
  • For all the new-style " Foomatic-PPDs " from Linuxprinting.org, you also need a special CUPS filter named foomatic-rip.

  • The foomatic-rip Perlscript itself also makes some interesting reading [50] because it is well documented by Kamppeter's inline comments (even non-Perl hackers will learn quite a bit about printing by reading it).

    [50] http://www.linuxprinting.org/foomatic2.9/download.cgi?filename=foomatic-rip&show=1

  • Save foomatic-rip either directly in /usr/lib/cups/filter/foomatic-rip or somewhere in your $PATH (and remember to make it world-executable). Again, do not save by copy and paste but use the appropriate link or the Save as... menu item in your browser.

  • If you save foomatic-rip in your $PATH, create a symlink :

     root# cd /usr/lib/cups/filter/ ; ln -s 'which foomatic-rip' 

    CUPS will discover this new available filter at startup after restarting cupsd.

Once you print to a print queue set up with the Foomatic-PPD, CUPS will insert the appropriate commands and comments into the resulting PostScript jobfile. foomatic-rip is able to read and act upon these and uses some specially encoded Foomatic comments embedded in the jobfile. These in turn are used to construct (transparently for you, the user) the complicated Ghostscript command line telling the printer driver exactly how the resulting raster data should look and which printer commands to embed into the data stream. You need:

  • A " foomatic+something " PPD ” but this is not enough to print with CUPS (it is only one important component).

  • The foomatic-rip filter script (Perl) in /usr/lib/cups/filters/ .

  • Perl to make foomatic-rip run.

  • Ghostscript (because it is doing the main work, controlled by the PPD/foomatic-rip combo) to produce the raster data fit for your printer model's consumption.

  • Ghostscript must (depending on the driver/model) contain support for a certain device representing the selected driver for your model (as shown by gs -h ).

  • foomatic-rip needs a new version of PPDs (PPD versions produced for cupsomatic do not work with foomatic-rip).

Official Samba-3 HOWTO and Reference Guide
The Official Samba-3 HOWTO and Reference Guide, 2nd Edition
ISBN: 0131882228
EAN: 2147483647
Year: 2005
Pages: 297

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net