Foomatic 3.0.2 ============== foomatic-db-engine ------------------ Foomatic's database engine generates PPD files from the data in Foomatic's XML database. It also contains scripts to directly generate print queues and handle jobs. Till Kamppeter http://www.openprinting.org/ This usage documentation file is written by Till Kamppeter Intro ----- Foomatic is a database providing information about the usage of printers with free operating systems and free printer drivers, where "free" is meant as free software in the sense of the Free Software Foundation (http://www.gnu.org). Therefore the database only contains information about printer drivers which are free software. The technology of this database can also be used for non-free drivers, but the database entries have to be published in separate packages then. The database can also be run under non-free operating systems (as commercial Unixes) as they often use GhostScript and free printer drivers. Since most free operating systems (GNU/Linux, *BSD, ...) are compatible to Unix, their applications send PostScript to the printer queues. Therefore one usually hands over the PostScript directly to a PostScript printer (sometimes with some prepended PostScript commands for options) or uses GhostScript for generating the data format the printer needs. This is done by the printer spooler which also stores the data in a spool directory when the printer is still occupied by another job, transmits the data to a print server in the network, and so on. The printer drivers for non-PostScript printers are either compiled into GhostScript, a plug-in for GhostScript (e. g. IJS drivers), or they are an extra filter which converts a generic bitmap generated by GhostScript into the printer's data format. For this the spooler has to call complicated command lines of GhostScript and the extra filter (if needed). The user of a free operating system normally does not see these command lines because an installation program takes appropriate filter scripts and/or description files from a database and assigns them to the printer queue. Widely used databases were the RHS-Printfilters and the APS filters. Their disadvantages were that they only supported one spooler (LPD/LPRng) and only a small part of the driver's options (mostly page size and resolution). Foomatic supports all options of the drivers and all known spoolers (LPD, LPRng, GNUlpr, CUPS, PPR, PDQ, CPS, direct spooler-less printing). In addition, all known free software printer drivers are supported. Foomatic also supports printing of various non-PostScript file types for spoolers which do not support this by themselves (LPD, LPRng, GNUlpr, spooler-less printing). To enable this feature you need to have "a2ps", "enscript", or "mpage" installed. Another problem is that the way how to install queues, to print files, and to handle jobs is very different with different spoolers. LPD for example requires editing of configuration files for adding a queue, whereas CUPS and PPR have specialized command line utilities. Foomatic puts a layer between the applications and the spoolers so that one has a common, spooler-independent command line interface for all spoolers, so that switching of spoolers or administration of a network with different spoolers gets much easier, because for the same operations there are the same commands, independent of the spooler. This command line interface can also be used as a base for spooler-independent graphical frontends. Installation ------------ Foomatic runs on all systems where one can run the Perl interpreter. Besides Perl and a C compiler with its standard libraries you will need the libxml C library for XML handling and one of the tools "wget"/"curl". In addition, you need the Foomatic database ("foomatic-db") and the Foomatic filters ("foomatic-filters"). It is recommended to install these packages before you install this package. Then the paths to its components get auto-detected during the build of this package. "wget" is really a standard tool which nearly every distribution includes. If yours does not include it, you find "wget" on http://www.gnu.org/software/wget/wget.html and "curl" is located on http://curl.haxx.se/ Because libxml is also used by GNOME, it is probably also part of every distribution of GNU/Linux or *BSD and one can also easily build it on any Unix-like operating system. If you distribution does not provide libxml you can get libxml from http://www.xmlsoft.org/ If your distribution contains libxml, note that besides the "libxml" or "libxml2" package you must install also a package with a name "libxml-devel" or "libxml2-devel" to be able to compile programs which use libxml. This additional package contains the needed header files and "xml(2)-config", which tells the C compiler where it finds the header files. If "xml(2)-config" or some header files in the packages of your distribution are missing, compile libxml from source. Till has tested with the versions 1.8.17 and 2.4.19 of libxml, both work, but 1.8.17 requires that the XML files do not have leading blank lines. Use foomatic-fix-xml if you have such XML files (old or third-party files). libxml 1.8.9 and earlier do not work. Using libxml 2.x is highly recommended. For Foomatic making sense one also needs GhostScript (5.50 or newer, ESP GhostScript 7.05.4 or newer highly recommended) if one has a non-PostScript printer. In addition, the appropriate driver for a non-PostScript printer must be installed. After installing the libxml package, Foomatic can be installed using the commands (if you have downloaded this package from CVS, run "./make_configure" at first, for that you will also need libxml 2.x, the "autoconf" and "aclocal" utilities, "aclocal" is in the "automake" package in some distributions): ./configure make make install "make install" must be run as "root", the other commands can be run as a normal user. The "configure" script will auto-detect where the libxml is installed and which version and also where relevant programs, files, and directories of your printer spooler are located. In addition, it is made sure that Perl will find the Perl libraries of Foomatic. If "configure" fails because of something not being installed, do rm -rf config.cache autom*.cache before you run "configure" again (after installing the missing parts). By default, Foomatic is installed into subdirectories of /usr/local (e. g. /usr/local/bin/foomatic-configure), to get it into subdirectories of /usr (/usr/bin/foomatic-configure), enter: ./configure --prefix=/usr make make install There are other things which can be adjusted by options on the "configure" command line, enter "./configure --help" for more info. You can also modify variables in the beginning of the "Makefile" after running "configure", but note that every run of "configure" re-creates the "Makefile". If "configure" did not auto-detect where you have placed the database (or if you intend to install the database afterwards), do export LIBDIR=/path/to/the/database ./configure make make install You have specified the path correctly, when /path/to/the/database/db/source/driver/ljet4.xml exists. You can also run Foomatic out of its source directory (for example when you want to try it out, or when you don't have root access). Therefore enter (can be done as a normal user): ./configure make inplace and enter the commands with "./" in the beginning (e. g. "./foomatic-ppdfile ..."). This also works on a machine where a system-wide Foomatic is already installed. This way you can develop XML files for the database and test them in your local database without messing up the system-wide one. To have the local database you need to put the "foomatic-db" tarball into the main directory of this package or into the directory where you have also put this package for unpacking. Simply unpack the database package. You do not need to build or install it. You can use Foomatic databases from wherever you want, edit the "$libdir" line in lib/Foomatic/Defaults.pm to point to the desired database. To use the system-wide one, let the line look like: ... # Library directory; typically /usr/share/foomatic or somesuch. $libdir = '/usr/share/foomatic'; ... In addition, you should install a utility to make PostScript out of non-PostScript files, so that you can print those non-PostScript files and also a list of available options using the "docs" option. The supported utilities are "a2ps", "enscript", and "mpage". Recommended is "a2ps" because it detects many file types (text, PDF, most image formats) and together with ImageMagick (for images) and GNU GhostScript 6.51 or newer (for PDF) it converts them to PostScript. The other tools convert only text files. The tool you have installed is auto-detected by the filter script for your spooler and used automatically if necessary. CUPS and PPR need this tool only for printing the option list, they use internal filters for printing non-PostScript files. The PDQ configuration files only supports "mpage", with LPD, GNUlpr, LPRng, or direct, spooler-less printing you can use all tools. A default spooler can be set by putting its name into an /etc/foomatic/defaultspooler file or into ~/.defaultspooler If you have a printer or multi-function device from HP, install HPLIP from http://hpinkjet.sourceforge.net/ before starting to set up printer queues with Foomatic. This gives you the possibility to access all extra functions of your HP device, independent whether it is connected via parallel port, USB, or ethernet. This gives you, depending on the device, functionality, as ink/toner level check, nozzle check and cleaning, color adjustment, head alignement, scanning, memory card access, and even sending faxes. Printing through the MTink daemon from the MTink package (http://xwtools.automatix.de/) is also supported. When CUPS is the spooler the special "mtink" backend (included in the MTink package) will be used. Using the MTink daemon it is possible to check the ink levels while printing. The MTink daemon supports only Epson inkjets from the Epson Stylus Color 740 on to the current models. Easy printer setup with CUPS 1.2 -------------------------------- If you have CUPS 1.2 or newer, you do not need the command line to set up printers with Foomatic. Simply fire up the web interface entering http://localhost:631/ and click the "Administration" tab. Then click the "Add this printer" at the entry of an auto-detected printer (parallel, USB, ethernet) or click "Add printer" at the top. Follow the instructions on the following pages. If the printers of the Foomatic database do not appear, check whether the link to foomatic-ppdfile is in /usr/lib/cups/driver: lrwxrwxrwx 1 root root 25 Apr 19 18:13 foomatic -> /usr/bin/foomatic-ppdfile If not, create it manually. If you want the web interface only list entries for the recommended driver for each printer, create a file /etc/cups/foomatic.conf containing the line OnlyRecommended Yes Note: CUPS paths may be different on your system. Adding a queue -------------- To add a printer queue you use the queue administration tool foomatic-configure. You call it this way: foomatic-configure [-q] [-f] [-w] [-s ] -n -c [-p -d ] [ --ppd ] [-o