# Print quota management in Ruby?

**URL:** <https://www.ruby-forum.com/t/print-quota-management-in-ruby/94909>\
**Category:** Ruby\
**Created:** [May 17, 2006, 4:23pm UTC](https://www.ruby-forum.com/t/print-quota-management-in-ruby/94909 "2006-05-17T16:23:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ohad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/f04885/32.png) [@ohad](https://www.ruby-forum.com/u/ohad)\
**Post date:** [May 17, 2006, 4:23pm UTC](https://www.ruby-forum.com/t/print-quota-management-in-ruby/94909/1 "2006-05-17T16:23:12Z")

</div>

I’m a unix admin at a lab, and we use Pykota to manage print quotas  
(essentially, each user has a ‘balance’, each printer has a ‘cost per  
page’, and Pykota manages that). I’ve grown to hate Pykota (it was  
installed before my time), and so have the other admins. Unable to find  
alternatives, I thought I might be able to write my own.

Requirements:

- Per-user granular modifications - ability to precisely set a user’s  
quota,  
or give him unlimited quota.
- One printer will be enough.
- Printable from Windows workstations over Samba (this is what makes  
it tricky,  
otherwise I’d just hack up an alternative lpr)
- Users need to be able to see how much quota they have left

Bonus points:

- Web-based interface for administration (simple if data is kept in  
SQL, then  
I can use Rails)
- Web-based queue-view (much less important)
- Error message when out of queue displayed on the Windows box while  
attempting  
the print.

It would be nice if I could just have an “upload your file, we’ll print  
it”  
solution, but since people want to print Powerpoint slides (in Hebrew,  
which  
Openoffice doesn’t properly convert), that’s not possible. (Adobe  
Acrobat isn’t  
installed on the workstations, so we can’t make people upload PDFs.

The big questions are these:

- Do I ‘spoof’ a printer for the queue? Or do I ‘block’ other printers  
like Pykota does? Something else perhaps?
- How do I count pages? Will postscript be able to do that?

Any input would be appreciated.

---

<div class="post-metadata">

**Author:** ![ohad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/f04885/32.png) [@ohad](https://www.ruby-forum.com/u/ohad)\
**Post date:** [May 17, 2006, 9:43pm UTC](https://www.ruby-forum.com/t/print-quota-management-in-ruby/94909/2 "2006-05-17T21:43:53Z")

</div>

On May 17, 2006, at 10:23 AM, Ohad L. wrote:

> - Do I ‘spoof’ a printer for the queue? Or do I ‘block’ other  
> printers  
> like Pykota does? Something else perhaps?
> - How do I count pages? Will postscript be able to do that?
> 
> Any input would be appreciated.

Oh but you can. Don’t share a real printer. Install ghostscript, and  
use that to produce .ps in some directory when people “print”, which  
you can then convert to pdf if you want (ps2pdf) or send off as is to  
the real printer. They still get to click on file \> print, and you  
still get the benefits of upload your file and we’ll print it scenario.

As far as displaying a message on the windows box, I believe you can  
use samba to send ‘net send msg’ style messages.
