Comment 5 for bug 82674

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

There should be a special print queue for generating PDF files. Sending a job to this queue should generate a PDF file from the document sent into the queue. The PDF file should be easily accessible for the sender of the job, but other users should not be able to read it.

The package cups-pdf provides the special CUPS backend which converts incoming PostScript to PDF and puts the resulting PDF into the right place.

To make this grandmother-proof, the installation of the package should prepare everything to use this feature. Especially the mentioned print queue is needed. As the package does not make sense without the print queue and the print queue does not make sense without the package, the queue should be created when the package finishes to be installed (postinstall) and the queue should be removed when the package starts to be uninstalled (prerm).

Creating and taking down the queue in the postinstall and prerm scripts is easy. To create it do

lpadmin -p PDF -E -v cups-pdf:/ -m foomatic:Generic-PostScript_Printer-Postscript.ppd -o PageSize=A4

and to take it down

lpadmin -x PDF

This should be somewhat refined, once when creating the queue it should be checked whether the queue name already exists and if so, another queue name should be used (PDF1, PDF2, ...). If there is already a queue with a "cups-pdf:/" URI, no queue shoud be created.

On uninstallation of the package all queues with "cups-pdf:/" URIs should be taken down.

A script can also easily find out which local queues already exist and which URI they have:

lpstat -v | grep -v 'ipp://'

It should also be checked whether a default printer or class is set ("lpstat -d") and if not, the new PDF queue should be made the default.

Concerning the user's choice of the PPD file, he can always change it with any printer setup tool. More important is grandmother-proofness and this one reaches only by using a default PPD file.

The PPD file needed is one for a generic PostScript printer. Best is one which has no tray and duplex options (there is no printer), no resolution (both PostScript and PDF are vector formats and there is no raster-based printing engine). It should have only things like color/bw, quality vs. size, ... (see what options you can set when choosing "Export to PDF" in OpenOffice.org).