I had the same issue a couple weeks ago and was finally able to devise a solution. Although it's not currently supported via the default cups-pdf installation, it's quite easy (IME) to manually build cups-pdf and specify the configuration file the queue will use.
Just download and extract the current source tar.gz from http://www.cups-pdf.de/download.shtml. Put it somewhere you can work on it (you'll copy the resulting file to where it needs to go after you compile).
Then modify the following line specifying the configuration file in cups-pdf.h to suit your needs:
Code:
#define CPCONFIG "/etc/cups/cups-pdf.conf"
Then modify cups-pdf.c to make each instance of "cups-pdf" distinct (I did it by changing them all to "cups-pdf-instance2"). So for the second instance of cups-pdf I wanted to run, I modified the following line (currently #584):
Code:
printf("file cups-pdf-instance2:/ \"Virtual PDF Printer\" \"CUPS-PDF-instance2\" \"MFG:Generic;MDL:CUPS-PDF-instance2 Printer;DES:Generic CUPS-PDF-instance2 Printer;CLS:PRINTER;CMD:POSTSCRIPT;\"\n");
I think all that really matters is changing the path where the "printer" is referenced, which is "cups-pdf:/", but I changed everything just for consistency's sake.
Then compile and copy the resulting binary to CUPS backend directory. To do that, all I did was run:
Code:
sudo gcc -O9 -s -o /usr/lib/cups/backend/cups-pdf-instance2 cups-pdf.c
from the directory where my cups-pdf.h and cups-pdf.c were located. (The details are all specified in http://www.cups-pdf.de/documentation.shtml.)
Then make the permissions right on the resulting binary and restart cups:
Code:
sudo chmod 700 /usr/lib/cups/backend/cups-pdf-instance2
sudo service cups restart
Be sure you have a cups-pdf.conf in the location you specified earlier in cups-pdf.h.
Like I said, I did this a couple weeks ago so I'm a little fuzzy on the details - but I think this was all I had to do to get it to work.
My reason for doing it was to configure multiple output directories, but also to then email the resulting file to a preconfigured email address. So a different email address would receive the PDF as an attachment, depending on the printer that was selected.
Bookmarks