Adding a Virtual Printer to CUPS
Wednesday, 6th July 2011
Our print-to-fax setup is made up of a virtual network printer that accepts postscript input and runs it through a shell script that parses it for its destination address before shunting it to either the fax or email. Setting it up is relatively simple:
- Create a CUPS backend script like this one and place it into /usr/libexec/cups/backend. Make sure that it is executable.
- Restart CUPS and test that the backend is available by issuing the command:
sudo lpinfo -v
It should return a list of the backends of which ours (faxmail in this case) should be one. - Enter the CUPS administration page and add the new virtual printer. The device URI will be faxmail:/
The script currently just dumps the postscript files into the temporary directory for later work by a cron job. A much better example is pdf2email by George Notaras.