I've faced a task which contains several stages. One stage might be formulated as "catch every print job file before printing and save it in the specified place; print job file should contain information such as total pages for printing etc.".
As far as I understand, CUPS implements extensible pipeline which contains filter chain, backend and other parts.
During filter pipeline, generally PSTOPS or PDFTOPDF filters insert specific printjob information which i want to acquire.
I guess I have to implement custom filter which comes immediately after PSTOPS/PDFTOPDF and backups print job. In order to achieve it I am going to add
application/vnd.cups-postscript application/vnd.cups-postscript 0 customFIlterName
application/vnd.cups-pdf application/vnd.cups-pdf 0 customFilterName
to mime.convs (or local.convs).
Here come my questions:
- Will my custom filters be called? (they have zero cost, but I am not sure CUPS will add this step to pipeline)
- What should I do with queues which do not hit PSTOPS|PDFTOPDF filters?
- Earlier or later, pipeline reaches backend part which communicates directly to printer. Should I try to make a backup at this stage instead of filtering stage? If so, how could it be implemented?
Thank you very much for response!