Setting up a print queue with a script that forwards to another CUPS printer

Helge Blischke h.blischke at acm.org
Fri Aug 17 02:28:51 PDT 2012


Kaelin Colclasure wrote:

> I am trying to configure a Mac OS X print queue so that a script can do
> some processing on each file printed before forwarding it on to another
> CUPS printer (on the same host).
> 
> I have been reading up on CUPS and have found an article describing how to
> use lpadmin to configure a queue with a "System V style interface script",
> but the caveat is that such a queue is seen as a "Generic Printer". I
> presume that means the user looses all ability to choose paper trays, etc.
> when submitting a job from the Print dialog. Is that correct?
> 
> [That makes this approach a non-starter for me, because the final
> [destination is a POS receipt printer with non-standard paper sizes and
> [print job options for cutting the paper roll, opening the cash drawer,
> [etc.]
> 
> Is there a better way to accomplish my goal, which is simply to run a
> script on each receipt printed through a particular queue?
> 
> TIA,
> 
> -- Kaelin

My suggenstion is to write a backend of your own (for simplicity, use a 
script language such as Perl or Python) that does your "some processing" and 
then forwards it to the final print queue just by executing an ordinary lp 
or lpr command (and specifying the original username by the "-U" switch).

Helge





More information about the cups mailing list