Law firms go thru lots of paper which costs a small fortune every year. I was asked to write a Printer Dialog Extension for the MacOSX printing system to let users specify a matter number that would be passed to our high volume printers and then processed by the billing department to help recoup printing costs. It works by registering a view to be displayed in the print dialog. The view has a simple combo box for entering a matter number, but it also uses the low level preferences system to store the most recent matter numbers. When a matter number is entered, it is passed to the CUPS system in a print ticket where another custom filter, written in C, extracts the matter number and then injects it into the raw postscript.
Our high volume printers would process the print jobs and the inserted postscript with the matter number would cause the printer to log that print job along with other information like number of pages printed, document name, and requesting user to a log file. The billing department would then fetch those print logs and process them for billing nightly. I also wrote the scripts for fetching the printer log files.
This was a pretty good solution and allowed the law firm to recoup quite a bit.