This is a question for those cups guru's out there. I'm trying to write a custom perl script for cups that does accounting. I have a database with users and quotas and I'm writing a filter for cups that checks to make sure the user has enough left on their balance before printing. I was curious how I would go about sticking this into the cups filtering chain. I've been reading up on the cups docs but I'm still kinda confused on where to put it. Any help would be much appreciated. Thanks, -- Chuck Haines chaines@gmail.com http://www.maxslack.com ------------------------------------------- Tau Kappa Epsilon Fraternity TKE-ZM Web Coordinator ECE Systems Administrator ------------------------------------------- AIM: CyberGrex YIM: CyberGrex_27 ICQ: 3707881 ------------------------------------------- GPG Fingerprint: 303A AB50 4EA9 70ED 2E30 2368 C9CD CCB5 4BD7 0989 GPG Key: http://www.maxslack.com/gpgkey.txt
Chuck> This is a question for those cups guru's out there. I'm trying Chuck> to write a custom perl script for cups that does accounting. I Chuck> have a database with users and quotas and I'm writing a filter Chuck> for cups that checks to make sure the user has enough left on Chuck> their balance before printing. I was curious how I would go Chuck> about sticking this into the cups filtering chain. I've been Chuck> reading up on the cups docs but I'm still kinda confused on Chuck> where to put it. Any help would 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... John
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. -- Robert Krawitz <rlk@alum.mit.edu> Tall Clubs International -- http://www.tall.org/ or 1-888-IM-TALL-2 Member of the League for Programming Freedom -- mail lpf@uunet.uu.net Project lead for Gimp Print -- http://gimp-print.sourceforge.net "Linux doesn't dictate how I work, I dictate how Linux works." --Eric Crampton
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. Chuck 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.
-- Robert Krawitz <rlk@alum.mit.edu>
Tall Clubs International -- http://www.tall.org/ or 1-888-IM-TALL-2 Member of the League for Programming Freedom -- mail lpf@uunet.uu.net Project lead for Gimp Print -- http://gimp-print.sourceforge.net
"Linux doesn't dictate how I work, I dictate how Linux works." --Eric Crampton
-- Chuck Haines chaines@gmail.com http://www.maxslack.com ------------------------------------------- Tau Kappa Epsilon Fraternity TKE-ZM Web Coordinator ECE Systems Administrator ------------------------------------------- AIM: CyberGrex YIM: CyberGrex_27 ICQ: 3707881 ------------------------------------------- GPG Fingerprint: 303A AB50 4EA9 70ED 2E30 2368 C9CD CCB5 4BD7 0989 GPG Key: http://www.maxslack.com/gpgkey.txt
Would it be useful to post it as the text of an email so that it gets archived in the normal manner and people can just grab it from the archives? -Jared On Wed, 30 Mar 2005 10:46:06 -0500, Chuck Haines <chaines@gmail.com> wrote:
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.
Chuck
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.
-- Robert Krawitz <rlk@alum.mit.edu>
Tall Clubs International -- http://www.tall.org/ or 1-888-IM-TALL-2 Member of the League for Programming Freedom -- mail lpf@uunet.uu.net Project lead for Gimp Print -- http://gimp-print.sourceforge.net
"Linux doesn't dictate how I work, I dictate how Linux works." --Eric Crampton
-- Chuck Haines chaines@gmail.com http://www.maxslack.com ------------------------------------------- Tau Kappa Epsilon Fraternity TKE-ZM Web Coordinator ECE Systems Administrator ------------------------------------------- AIM: CyberGrex YIM: CyberGrex_27 ICQ: 3707881 ------------------------------------------- GPG Fingerprint: 303A AB50 4EA9 70ED 2E30 2368 C9CD CCB5 4BD7 0989 GPG Key: http://www.maxslack.com/gpgkey.txt _______________________________________________ Wlug mailing list Wlug@mail.wlug.org http://mail.wlug.org/mailman/listinfo/wlug
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.
participants (4)
-
Chuck Haines
-
Jared Greenwald
-
John Stoffel
-
Robert L Krawitz