Date: Wed, 30 Mar 2005 10:46:06 -0500 From: Chuck Haines <chaines@gmail.com> Thanks to everyone's help, but I've figured out the backend stuff and written my own perl script that does the accounting using mysql. It's actually really neat and incredibly easy to use. I'm in the process of refinining it a bit now and if anyone is interested in it, I'd be more than happy to send it your way. It uses snmp to query the pages from the printer so it actually determines the number of pages printer and not just how many should have printed. So you have a network printer that can report that kind of thing. I guess I'm used to thinking of cheap, dumb inkjet printers. On Tue, 29 Mar 2005 19:46:57 -0500, Robert L Krawitz <rlk@alum.mit.edu> wrote:
Date: Tue, 29 Mar 2005 16:26:46 -0500 From: "John Stoffel" <john@stoffel.org>
Chuck> This is a question for those cups guru's out there. I'm Chuck> trying to write a custom perl script for cups that does Chuck> accounting. I have a database with users and quotas and I'm Chuck> writing a filter for cups that checks to make sure the user Chuck> has enough left on their balance before printing. I was Chuck> curious how I would go about sticking this into the cups Chuck> filtering chain. I've been reading up on the cups docs but Chuck> I'm still kinda confused on where to put it. Any help would Chuck> be much appreciated.
How are you going to count pages before you send them to the printer?
That was always the problem we had, esp when someone messed up and sent garbage to the laser printer at $0.10/page way back in the late 80s, and then came up to find a 1" thick stack waiting for them... with just one letter per page
Or are you going to pre-render, count the pages, then get the page counter on the printer, print, and read the page counter to see what actually got through?
I'd also google, since I can't imagine that you're the only one who's wanted something like this before...
I'd try the cups-devel@cups.org mailing list (you may need to subscribe).
This is actually a very hard problem if you don't have a printer that will do the accounting itself. Unless you can interpret the codes going to the printer, you can't even start to do this.