In an ideal world there would be no need to choose which printer driver to use, and all printers would use the same driver (or, say, one driver for raster images, and another for vectors). That’s the goal of IPP Everywhere. In the mean while, there is often a choice of different drivers to use. CUPS leaves this decidedly up to the user. The foomatic database contains a list of which drivers are “recommended” for each printer, although this is limited to old-style drivers that use the foomatic engine such as hpijs and built-in ghostscript drivers, and to PostScript PPD files. It cannot recommend native CUPS drivers such as those contained in Gutenprint and HPLIP (hpcups).
The Fedora printing configuration tool, system-config-printer, tries to make a best guess about which driver is likely to be the most useful, taking into account foomatic recommended drivers, native CUPS drivers, manufacturer-provided PPD files, and so on. It does this by having some rules of thumb hard-coded into the part that does driver selection. It isn’t very pretty, and it’s not very flexible. It isn’t very easy to modify because of its complexity.
To solve this problem I’ve been working on an XML-driven way of describing which drivers are “best”. It works across all drivers, not just the subset that foomatic knows about (although it can use foomatic’s knowledge of recommended drivers). It can have recommended drivers, and can blacklist drivers altogether for specific printers.
It works by classifying drivers into “driver types” based on regular expressions for the PPD attributes CUPS provides: its name, IEEE 1284 Device ID, make-and-model, product, etc. Printers can be matched by regular expressions for their make-and-model names and IEEE 1284 Device IDs.
See the source for a full explanation of how it works.
UPDATED: Explanation link now links to HEAD which includes some changes since this was written.
3 responses to “Choosing the best printer driver”
This looks interesting. How does one actually use that XML file to do its magic ?
I love the autoconfig. what I don’t like is the fact when adding a network printer there is no option not to allow the autoconfig. Wiith a canon network copier it sits there for 5 minutes and you then still have to select the one you want because it never detects them 😐
Alex: broadly speaking, the way the XML files work is that drivers are classified into types (e.g. gutenprint, hpcups, foomatic), and then there is a preference order for the various types of driver which can be tweaked on a per-printer basis.
Peter: you can always change the driver after adding the queue. I’m not sure exactly what you mean by “select the one you want because it never detects them”: select a driver?