How to Use Dynamic PPD's in CUPS
Posted: Tue 21 Apr 2009, 12:34
Users of CUPS 1.1.23 are familiar with the concept of a static PPD file. Just to be clear, a Postscript Printer Description file is not a printer driver. It is a text file that contains configuration data used by the corresponding driver to process a print job.
Printer drivers can be found in several places. The most basic drivers are compiled inside Ghostscript, which is the main engine of the Linux printing process. If your printer uses one of these drivers, you must get the matching PPD file from linuxprinting.org. You then save the file in /usr/share/cups/model and install the printer.
In Puppy 4.0, BarryK implemented Gutenprint drivers. The printer wizard /usr/sbin/cups_shell generates the set of Gutenprint PPD's and stores them in a subfolder of /usr/share/cups/model. Once a printer is installed, all the PPD's are deleted to save space. This works because the selected PPD is transfered to a permanent location in /etc/cups/ppd.
If a printer uses the HPIJS driver, the PET installer stores a large collection of PPD's in /usr/share/ppd. There is a symlink in /usr/share/cups/model that points to this folder so CUPS can find them.
When you add a printer, CUPS shows you two lists titled Make and Model. These lists are generated by CUPS from all the PPDs that it can find on your system. However, having an appropriate PPD does not guarantee that you also have the necessary driver required by your printer.
In CUPS 1.2, dynamic PPD's were introduced. These files are generated on-the-fly so there is no need to have a permanent store of static PPD's on your hard drive.
In Puppy 4.2, the Gutenprint PPD's are now dynamic. When CUPS is launched, it starts a daemon called cups-driverd. It looks for static PPD's in the usual places, then goes to /usr/lib/cups/driver and finds the Gutenprint PPD generating program. The individual PPD's are created from XML data located in /usr/share/gutenprint/5.2. If you look at the cups_shell script in Puppy 4.2, you will notice how the cups-genppd.5.x program is no longer invoked to make static PPD's.
This brings us to HPIJS. In addition to downloading its static PPD's, the HPIJS installer also saves the file /usr/share/cups/drv/hp/hpijs.drv. This is the database for building dynamic HPIJS PPD's. So in Puppy 4.2 with CUPS 1.4b, you can delete all the static PPD's in /usr/share/ppd and CUPS will still add a printer. But if you look in /usr/lib/cups/driver, there is no corresponding PPD generator program! This is because the 1.4b cups-driverd daemon contains the code needed to construct dynamic HPIJS PPD's.
But what if you want to downgrade to the stable CUPS 1.3.9? In that case, you need to manually install the HPIJS PPD generator. It comes from the CUPS Driver Development Kit and is contained in the cupsddk-1.2.3-i486.pet attached to this document. Here is how to get it working:
Go here and follow the steps for setting up CUPS 1.3.9. This will include installing the HPIJS PET from the Puppy Package Manager and applying the Foomatic -U patch.
Go to /usr/share/ppd and delete the hp folder containing the static PPD's.
Install the cupsddk-1.2.3-i486.pet. Now when you look in /usr/lib/cups/driver, you will see a program called "drv". This is the HPIJS PPD generator.
Go to the /tmp folder and check its properties. The permissions must be set to all-writable.
Restart CUPS and install a printer.
Printer drivers can be found in several places. The most basic drivers are compiled inside Ghostscript, which is the main engine of the Linux printing process. If your printer uses one of these drivers, you must get the matching PPD file from linuxprinting.org. You then save the file in /usr/share/cups/model and install the printer.
In Puppy 4.0, BarryK implemented Gutenprint drivers. The printer wizard /usr/sbin/cups_shell generates the set of Gutenprint PPD's and stores them in a subfolder of /usr/share/cups/model. Once a printer is installed, all the PPD's are deleted to save space. This works because the selected PPD is transfered to a permanent location in /etc/cups/ppd.
If a printer uses the HPIJS driver, the PET installer stores a large collection of PPD's in /usr/share/ppd. There is a symlink in /usr/share/cups/model that points to this folder so CUPS can find them.
When you add a printer, CUPS shows you two lists titled Make and Model. These lists are generated by CUPS from all the PPDs that it can find on your system. However, having an appropriate PPD does not guarantee that you also have the necessary driver required by your printer.
In CUPS 1.2, dynamic PPD's were introduced. These files are generated on-the-fly so there is no need to have a permanent store of static PPD's on your hard drive.
In Puppy 4.2, the Gutenprint PPD's are now dynamic. When CUPS is launched, it starts a daemon called cups-driverd. It looks for static PPD's in the usual places, then goes to /usr/lib/cups/driver and finds the Gutenprint PPD generating program. The individual PPD's are created from XML data located in /usr/share/gutenprint/5.2. If you look at the cups_shell script in Puppy 4.2, you will notice how the cups-genppd.5.x program is no longer invoked to make static PPD's.
This brings us to HPIJS. In addition to downloading its static PPD's, the HPIJS installer also saves the file /usr/share/cups/drv/hp/hpijs.drv. This is the database for building dynamic HPIJS PPD's. So in Puppy 4.2 with CUPS 1.4b, you can delete all the static PPD's in /usr/share/ppd and CUPS will still add a printer. But if you look in /usr/lib/cups/driver, there is no corresponding PPD generator program! This is because the 1.4b cups-driverd daemon contains the code needed to construct dynamic HPIJS PPD's.
But what if you want to downgrade to the stable CUPS 1.3.9? In that case, you need to manually install the HPIJS PPD generator. It comes from the CUPS Driver Development Kit and is contained in the cupsddk-1.2.3-i486.pet attached to this document. Here is how to get it working:
Go here and follow the steps for setting up CUPS 1.3.9. This will include installing the HPIJS PET from the Puppy Package Manager and applying the Foomatic -U patch.
Go to /usr/share/ppd and delete the hp folder containing the static PPD's.
Install the cupsddk-1.2.3-i486.pet. Now when you look in /usr/lib/cups/driver, you will see a program called "drv". This is the HPIJS PPD generator.
Go to the /tmp folder and check its properties. The permissions must be set to all-writable.
Restart CUPS and install a printer.