Applications Using PPD Files and the OpenPrinting Database
In a modern Linux distribution with CUPS most application's printing dialogs support CUPS directly (Qt (KDE), GTK (GNOME), OpenOffice.org, ...) and so they get the PPD options throgh the CUPS library, independent whether the printer is locally connected or remote. Here you do not need to do anything in the application. Once having set up a CUPS queue, and if desired shared it to clients, every user can just print with these applications. This is how it should be.
For other situations here are some tips:
There are many applications which use PPD files to know about the capabilities of printers, so that their printing dialogs can make available all options which the printer/its driver provide and also show additional information about the printer. In addition to applications as Star Office/OpenOffice.org (older versions or non-CUPS environments), GIMP (for printers not supported by Gutenprint), GPR, ... PPD files can also be used on Windows, Mac, or LPD clients to get access to the printer's capabilities and options.
This can be done with every type of PPD file: The ones generated from Foomatic data, the ones coming with PostScript printers, and those for cups-raster drivers like Gimp-Print or Turboprint.
Here we present tips how to obtain PPD files and how to use all kinds of PPD files with applications and on clients.
See also the tutorial chapter "Some Theoretical Background: CUPS, PPDs, PostScript, and GhostScript" (PDF) for detailed information about PostScript and PPD files.
How to obtain PPD files
Obtaining PPD files for PostScript printers
For every PostScript printer the manufacturers provide a PPD file which contains all printer-specific information about the particular printer model: Basic printer capabilities as whether the printer is a color printer, fonts, PostScript level, etc., and especially the user-adjustable options, as paper size, resolution, etc. For every option setting they contain PostScript code which, embedded in the PostScript file sent to the printer, applies the corresponding setting to the job. The PPDs were developed to give the printer-specific information to the generic Windows/MacOS PostScript drivers, but they can also be used on Unix-style operating systems. The printing system CUPS and PPR support them natively, with all other printing systems they can be used with the help of Foomatic.
Some manufacturers have already published their PPD files under a free (see http://www.gnu.org/) license. You can download them here on OpenPrinting. Also some non-free PPDs are available, at least from manufacturers who allow redistribution.
If your printer's PPD file is not there or if your printer is from another manufacturer, look for PPD files on the manufacturer's web site (probably in the "drivers" section), on the CDs with the Windows/MacOS drivers which came with the printer, or on a Windows machine where this printer is already configured. If you find several PPD files for different operating systems, use preferrably the ones for Windows NT. A source for PPD files of older printer models is also Adobe.
If the files on the printer's driver CDs or on the manufacturer's web site are compressed or packaged in certain Windows formats, use "unzip -L" (comes with every GNU/Linux distribution) for ".zip" and ".exe", or "cabextract" for ".cab", ".exe", and perhaps other formats.
Obtaining PPD files for non-PostScript printers
The CUPS and PPR printing systems use PPD files to get printer capability information for their print queues and to provide access to all printer features to the users. To be able to use non-PostScript printers with these spoolers PPD files for these printers used with Ghostscript or CUPS drivers were introduced. Principal source for these PPDs is the OpenPrinting database here on this site. It allows to set up print queues with PPD files for all known free software printing systems (CUPS, LPD/LPRng/GNUlpr, PDQ, PPR, No spooler) and many printer drivers. Another source are native CUPS drivers which always come with appropriate PPD files. Note that all PPD files for non-PostScript printers only work when the printers are set up with their corresponding filters and drivers.
Obtaining PPD files from existing print queues
If you have installed the Foomatic packages and set up your print queues with "foomatic-configure" you will always find the PPD files for your print queues as /etc/foomatic/<spooler>/<queue>.ppd. This is the case independent of whether the PPD file is generated from the Foomatic database ("-d ... -p ..." options of "foomatic-configure" or supplied as a file ("--ppd ..." option).
You will also find PPD files in print queues set up with Foomatic (CUPS, LPD/LPRng/GNUlpr, PDQ, PPR, No spooler) and in queues of the spoolers CUPS and PPR, as they support PPDs natively. Under CUPS the PPD files are usually stored as /etc/cups/ppd/<queue>.ppd and under PPR you find them normally in the /usr/share/ppr/PPDFiles/ directory. See also the documentation of your printing system.
If your printer is on a remote CUPS server, you can easily download the PPD file to your client with
wget http://<server name or IP>:631/printers/<printer queue name>.ppd
or by entering the web interface of CUPS (http://localhost:631/), clicking on "Manage Printers", and then clicking on the icon of the desired printer. Then click on the "Location" (internet address) field and add ".ppd" to the end of the line. After pressing <Enter> the PPD file will be displayed and you only need to save it on your local disk with "File"/"Save As ...".
Tip: If you want to use a PPD file of a local print queue for applications on the local machine, don't copy it. Simply specify its path in the application, or, if the application requires it in a certain directory, set a symbolic link from the original file to the directory of the application. So changes in the original file will get available to the application automatically.
How to set up application and clients
If you want to get all the options of your printer into the printing dialog of Star Office ("Properties" button), you can use your PPD files (PPD-O-Matic, native CUPS, or manufacturer-supplied) as Star Office "drivers" and this way fully support all printers for which you have a PPD file under Star Office.
To do so, start "spadmin", the printer setup program of Star Office (it is usually in /opt/office52/program or /usr/lib/office52/program) as "root". Click on "Install new driver ..." and in the dialog use the "Browse" button to navigate to the directory where you have stored the PPD file for your printer. Choose the file in the file list and click "OK". Now your printer has an entry in the list "Existing printer drivers". Choose it and click "Add new printer". Choose the new entry in "Installed printers" and click on "Connect". In the dialog choose the queue with the command pointing to your printer or enter a new, non-existing queue name, an "=" character, and the command to print PostScript files on your printer plus a perl one-liner to fix the bug of the Euro currency symbol not being printed, for example:
EpsonQueue=perl -p -e "s=16#80 /euro=16#80 /Euro=" | lpr -P Epson
Do not specify graphical frontends as "xpp", "kprinter", "gpr" ... as printing command. Click on "Configure" to adjust the default settings for your printer and on "Test page" to check whether all works. Now close "spadmin" and start Star Office. When you select "File"/"Print" you can choose your printer and with the "Properties" button all the options provided by the printer driver.
The printing environment of OpenOffice.org and Star Office 6.0 is very similar to the one of the old Star Office versions. As Star Office 6.0 is a snapshot of OpenOffice.org with some proprietary enhancements the way setting up printers for both programs is absolutely identical.
Start the printer setup program "spadmin" as "root" (in most cases you find it in /opt/openoffice/, /usr/lib/openoffice/, /opt/office60/, or /usr/lib/office60/). In its main window click on "New Printer...". A wizard opens and on its first page choose "Add a printer". The next page shows a list of printer models. These entries come from PPD files of native PostScript printers which were already shipped with OpenOffice.org or Star Office 6.0. Click "Import" to import your PPD file into the list. Then a "Driver Installation" dialog appears. There click on "Browse" to get to the directory with your PPD file or type in the path. If you did it correctly, the name of your printer model appears in the big field. Note that when you use the "Browse" button, the browsing dialog does not show any file name. So if you are sure you are in the correct directory press the "Select" button. Click on the entry with your printer's model name and then on OK. Now your printer is in the list of printer models in the wizard and you can choose it. The next step asks for the desired printing command. Choose the "lpr" command for your printer's queue in the list. Then add a Perl one-liner to it so that the bug of the Euro currency symbol not being printed gets fixed, as the following example shows:
perl -p -e "s=/euro /unused=/Euro /unused=" | lpr -P laserjet
Do not use graphical frontends as "xpp", "gpr", "kprinter" or similar as printing command. On the last page of the wizard you only need to give a name to the new printer and tell whether it should be the default printer (for OpenOffice.org/Star Office 6.0). Now you can print out of all applications of your office suite and access all the printer's/the driver's options via the "Properties" button in the printing dialog.
If you have OpenOffice.org 638 or earlier, either update to a newer version, or proceed as following:
Unfortunately, the older versions of OpenOffice.org do not include "spadmin". So you have to edit the config file manually to integrate your printer.
A note about directories: Depending on your installation the OpenOffice.org directory can be at different places: /usr/lib/OpenOffice.org638, /opt/OpenOffice.org638, /usr/local/lib/OpenOffice.org638, /home/<yourlogin>/OpenOffice.org638, ... for simplicity We will only refer to /usr/lib/OpenOffice.org638 in the following. Please use the directory according to your installation.
At first copy (or link) the PPD file into the /usr/lib/OpenOffice.org638/share/psprint/driver directory and rename the copy (or the link) to have the file name extension ".PS". Make the file world-readable ("chmod 644 <filename>"). When you have done so, edit the file /usr/lib/OpenOffice.org638/share/psprint/psprint.conf copying the part beginning with "[Generic Printer] up to the next expression in square brackets ("[...]") or, if there is no such expression, up to the end of the file. The copied dataset will be the dataset for your printer. Now edit this dataset: modify the name in the square brackets to a name which your printer should have in the menu, spaces are allowed. In the line starting with "Printer=" you have to provide two items, one before and one after the slash ("/"), before the slash you put the name of the PPD file which you have put into /usr/lib/OpenOffice.org638/share/psprint/driver, without the ".PS", after the slash you repeat the name which you have put into the square brackets, without the square brackets. Every printer dataset has a line beginning with "DefaultPrinter=", enter "1" in this line for the printer which should be the default printer, "0" in the others. "Location=" and "Comment=" are only comments shown in the printing dialog of OpenOffice.org, you don't need to fill them in. "Command=" should contain the command line command to print PostScript files on your printer plus a perl one-liner to fix the bug of the Euro currency symbol not being printed, for example:
perl -p -e "s=/euro /unused=/Euro /unused=" | lpr -P laserjet
Do not specify graphical frontends as "xpp", "kprinter", "gpr" ... here. Leave the default settings for all the remaining entries.
The entry for your printer could look like the following (Assuming the PPD file is copied/linked to /usr/lib/OpenOffice.org638/share/psprint/driver/Eps1290.PS and the printer queue name is "Epson", comments are not shown):
[Epson Stylus Photo 1290] Printer=Eps1290/Epson Stylus Photo 1290 DefaultPrinter=1 Location=Graphics Department, 2nd floor Comment=Photo-capable (6-ink) A3-format printer Command=perl -p -e "s=/euro /unused=/Euro /unused=" | lpr -P Epson PerformFontSubstitution=true SubstFont_Helmet= ... ...
After saving the configuration file you (re)start your OpenOffice.org applications and then printing works as in the other versions of Star Office and OpenOffice.org.
The GIMP does not only have its own CUPS-based printing dialog, but it also allows to print via the Gutenprint plug-in, an alternative printing dialog which makes available a lot of options for fine-tuning the printout. If it is installed you can click into the window with your image using the right mouse button (or use the menus at the top of the window) and then choose "File" and "Print with Gutenprint". In the printing dialog choose your printer queue (if it is not listed, click "New Printer ..." to create a list entry) and click on "Setup Printer ...". If your printer is listed, it is supported by Gutenprint and you do not need a PPD file for using it with GIMP. If it is not listed, choose "PostScript Level 2". Then an input field for a PPD file will appear. Enter the path and name under which you have saved your PPD file or choose it with the "Browse" button. Adapt the printing command to your spooler, especially remove the "-oraw" option if it is set in the default command line, because it is important that print jobs for non-PostScript printers are going through the filters of the print queue. After closing the dialog with "OK" the fields for the options ("Media Size", "Media Source", ...) will contain the choices according to your printer. Click "Save Settings" to make your setup permanent.
GPR is a graphical printing interface made for GNUlpr (VA-Linux LPD), LPRng, and stock LPD. The case that stock LPD does not provide passing of option settings is worked around by stuffing all settings into the PostScript (other files will be automatically converted with a2ps) file sent to the printer, GPR can also be used as frontend for CUPS. It probably also works with spooler-less printing when you set a symbolic link or rename it so that you can call it under the name lpr and set up a faked /etc/printcap with the base names of the PPD files in /etc/foomatic/direct/ (without path and without ".ppd"), each in one line followed by a colon (":").
Make sure that you are using version 0.9, older versions do not handle options with very many choices correctly.
When you have configured a printer on a GNU/Linux or Unix server with a PPD file, you can set up Windows clients using a generic PostScript printer driver (for CUPS servers from the CUPS site and for other printing systems from Adobe) and the PPD file. Then you don't need to install the Windows driver for your printer. On Epson inkjets driven by the current version of Gimp-Print you could even obtain a better printout quality than with the Windows driver. You can also do things as installing filters which parse the PostScript and count the pages on your server which is not possible when the client's Windows driver sends a data stream in a proprietary format. It also helps you when you have an old printer which works nicely under Windows 3.1 and under GNU/Linux or Unix with GhostScript, but not any more under Windows 98/ME/XP/2000.
To set this up you should configure the Samba on your server so that its printing command does not contain options for raw (unfiltered) printing ("-o raw", "-l"). The printing command you find in /etc/samba/smb.conf in the "[printers]" section in the "print command = ..." line. It is also convenient to make the PPD files downloadable for the Windows clients.
When you have CUPS 1.1.15 or newer and Samba 2.2.4 or newer on your server you can get it even easier by the "cupsaddsmb" tool. Set up your printer with a PPD file and then follow the instructions shown by "man cupsaddsmb".
Important: If you want to make your printer available for Windows clients and let your CUPS server render the jobs, use Adobe's PostScript driver to let the Windows clients generate PostScript. The CUPS PostScript driver for Windows has a bug when handling option names longer than 39 characters. If you want to use the CUPS PostScript driver anyway, you can obtain a mangled Foomatic PPD file with shortened names from the driver's database page (click the name of the driver on your printer's page) and in the "PPD-O-Matic" section check "GUI texts limited to 39 characters" before you click the button to generate the PPD file.