Eu nunca tentei isso, mas há uma ferramenta chamada tea4cups
que parece que você poderia implementar um presaok para o seu script que faria a impressão. Você poderia ter essa impressão cancelada e não ir para uma impressora real via cups, permitindo que seu script faça a impressão.
trecho
The possibilities are endless :
- Send the same job to several printers at the same time, which is not possible with CUPS.
- Automate the PDF archiving of all print jobs.
- Forbid duplicate print jobs (a simple example is shown in the sample configuration file)
- Create a print accounting solution in 15 minutes ( YES, THIS IS FOR REAL )
- etc...
Tea4cups fornece os seguintes facilitadores:
Tea4CUPS provides three ways to launch commands :
- filters : A filter can modify the input datas before they are sent to the printer or made available to the pre and post hooks defined below. Currently a single filter can be defined per print queue.
- prehooks : these are guaranteed to be launched before the print job is sent to the real printer. Any prehook which exits -1 can cancel the print job. Any number of prehooks can be defined for a particular print queue.
- posthooks : these are guaranteed to be launched after the print job has been sent to the real printer, unless the job was previously cancelled by a prehook. Any number of posthooks can be defined for a particular print queue.