[comp.lang.postscript] postscript accounting

yxoc@cs.uni-sb.de (Ralf Treinen) (03/08/91)

Sorry if this is a dumb question, I do not (yet) know anything about
postscript (crazy, but true).

We are going to buy a postscript printer and would like to monitor the
usage of the printer. For this purpose we would like to have a tool that
is able to count the pages of a postscript file. Does this make any sense
to you? Can you tell me how to write/get such a thing?

Thanks a lot, Ralf


--
 Ralf Treinen                         | email: treinen@cs.uni-sb.de          
 FB 14 - Informatik (Dept. of CS)     |
 Universitaet des Saarlandes          | phone: +49 681 302 2065
 W-6600 Saarbruecken , Germany        | fax:   +49 681 302 4421

brown@vidiot.UUCP (Vidiot) (03/09/91)

In article <YXOC.91Mar8143905@fb14vax.cs.uni-sb.de> yxoc@cs.uni-sb.de (Ralf Treinen) writes:
<Sorry if this is a dumb question, I do not (yet) know anything about
<postscript (crazy, but true).
<
<We are going to buy a postscript printer and would like to monitor the
<usage of the printer. For this purpose we would like to have a tool that
<is able to count the pages of a postscript file. Does this make any sense
<to you? Can you tell me how to write/get such a thing?

Unless I am missing something here, you can't always know the number of
pages that will be printed just by looking at the PostScript file.  The
program could easily have repeat and for loops that could print many, many
pages with only a single line of PostScript code.

What you will have to do is send out a piece of code that will determine the
numbers of pages printed so far, send the PostScript file and ask the printer
the same question again.  Subtract the two numbers and you are all set.
This information is available in the statusdict.  See the manual for the
printer to determine the PostScript procedures available to pull the number
of pages printed so far.  I don't have the QMS PS-810 manual here at home
and the LaserWriter IINT manual doesn't contain this info, otherwise I
post a little piece of code to fetch the page number.
-- 
      harvard\     att!nicmad\          spool.cs.wisc.edu!astroatc!vidiot!brown
Vidiot  ucbvax!uwvax..........!astroatc!vidiot!brown
      rutgers/  decvax!nicmad/ INTERNET:vidiot!brown%astroatc@spool.cs.wisc.edu

tneff@bfmny0.BFM.COM (Tom Neff) (03/10/91)

In article <YXOC.91Mar8143905@fb14vax.cs.uni-sb.de> yxoc@cs.uni-sb.de (Ralf Treinen) writes:
>We are going to buy a postscript printer and would like to monitor the
>usage of the printer. For this purpose we would like to have a tool that
>is able to count the pages of a postscript file. Does this make any sense
>to you? Can you tell me how to write/get such a thing?

If the goal is to monitor _over-all_ use of the printer, then just buy
something that prints a page count as part of its self-test status
report.  The latest generation of laser printers mostly do this.

If you need to do it _per user_, it's a tougher task.  If the printer interface
is serial or bidirectional parallel, you could hack the spooler to
actually ask the printer for its pagecount after every job.

jjwcmp@isc.rit.edu (Jeff Wasilko) (03/13/91)

In article <YXOC.91Mar8143905@fb14vax.cs.uni-sb.de> yxoc@cs.uni-sb.de (Ralf Treinen) writes:
>Sorry if this is a dumb question, I do not (yet) know anything about
>postscript (crazy, but true).
>
>We are going to buy a postscript printer and would like to monitor the
>usage of the printer. For this purpose we would like to have a tool that
>is able to count the pages of a postscript file. Does this make any sense
>to you? Can you tell me how to write/get such a thing?
>


If you are only accessing your printer from Macs (or any other system that
can include a chooser name in the file), I have a perfect solution.
 
We use a Product called NetCounter to keep unauthorized people from
using our L300/RIP 4. NetCounter installs as RIP resident software, and
starts up on its own each time the RIP is rebooted.
 
With NetCounter, you can either make a list of authorized users, or make
a list of people to barr from using the printer. Unauthorized users get
a message back from the printer to the effect of 'You are not authorized
to use this printer.' NetCounter also keeps a per user accounting log,
listing # of pages per user. Unfortunatly, it doesn't keep track of page
size...
 
We had a bit of a problem with NetCounter conflicting with RIPMaster
(another piece of RIP resident software), and Herb was very quick to fix
it.
 
As I recall, RIPMaster cost around $70 USD, and it is licesnsed for all
printers in a zone. Quite a deal!
 
Here's a blurb Herb (the author) sent me...
 
For controlling access to the LaserWriter(s) you probably want
NetCounter (TM).  This software will allow you to restrict access
to the printers, and it will automatically reload itself (if you
install a patched LaserPrep on all machines).  In addition, it
will keep track of the number of pages printed by each user (but
this count will NOT be saved if the power fails, unless you have
a hard disk on the printer).  Also, it will protect your printer
from the Trojan Horse that changes the password.
 
NetCounter is distributed by Prism Enterprises (301) 604-6611.
 
If you have any further questions that Prism can not answer for
you, feel free to contact me.
 
Disclaimer: I am the author of NetCounter.
 
Herb Weiner (herbw@wiskit.pdx.com)
 
 
 
Jeff (Just a happy customer)


-- 
| RIT VAX/VMS Systems: |     Jeff Wasilko     |     RIT Ultrix Systems:     |
|BITNET: jjwcmp@ritvax +----------------------+ INET:jjwcmp@ultb.isc.rit.edu|
|INTERNET: jjwcmp@ritvax.rit.edu              |____UUCP:jjwcmp@ultb.UUCP____|
|Ask me about the Desktop Publishing Mailing list -- All platforms welcome. |
-- 
| RIT VAX/VMS Systems: |     Jeff Wasilko     |     RIT Ultrix Systems:     |
|BITNET: jjwcmp@ritvax +----------------------+ INET:jjwcmp@ultb.isc.rit.edu|
|INTERNET: jjwcmp@ritvax.rit.edu              |____UUCP:jjwcmp@ultb.UUCP____|
|Ask me about the Desktop Publishing Mailing list -- All platforms welcome. |

wjw@eba.eb.ele.tue.nl (Willem Jan Withagen) (03/19/91)

In article <1475@vidiot.UUCP> brown@vidiot.UUCP (Vidiot) writes:
=>In article <YXOC.91Mar8143905@fb14vax.cs.uni-sb.de> yxoc@cs.uni-sb.de (Ralf Treinen) writes:
=><We are going to buy a postscript printer and would like to monitor the
=><usage of the printer. For this purpose we would like to have a tool that
=><is able to count the pages of a postscript file. Does this make any sense
=><to you? Can you tell me how to write/get such a thing?
=>
=>What you will have to do is send out a piece of code that will determine the
=>numbers of pages printed so far, send the PostScript file and ask the printer
=>the same question again.  Subtract the two numbers and you are all set.
=>This information is available in the statusdict.  See the manual for the
=>printer to determine the PostScript procedures available to pull the number
=>of pages printed so far.  I don't have the QMS PS-810 manual here at home
=>and the LaserWriter IINT manual doesn't contain this info, otherwise I
=>post a little piece of code to fetch the page number.

Well here you've got a little problem. I'm planing to hook a HP-LJ II with
PS-cartridge to an Apollo-workstation. And this through the parallel port.
This'll get me some performance for those wanting to use PCL and bitmaps.

This make it imposible to get info from the printer. I know that this is
stupid, since the printer could return info on print jobs. But then this
is the way it's going to be.

Knowing this, is there an Unix accounting filter for PS.

Regards,
		Willem jan Withagen.

Eindhoven University of Technology   DomainName:  wjw@eb.ele.tue.nl    
Digital Systems Group, Room EH 10.10 
P.O. 513                             Tel: +31-40-473401
5600 MB Eindhoven                    The Netherlands

brown@vidiot.UUCP (Vidiot) (03/20/91)

In article <1111@eba.eb.ele.tue.nl> wjw@eba.eb.ele.tue.nl (Willem Jan Withagen) writes:
<
<Well here you've got a little problem. I'm planing to hook a HP-LJ II with
<PS-cartridge to an Apollo-workstation. And this through the parallel port.
<This'll get me some performance for those wanting to use PCL and bitmaps.
<
<This make it imposible to get info from the printer. I know that this is
<stupid, since the printer could return info on print jobs. But then this
<is the way it's going to be.
<
<Knowing this, is there an Unix accounting filter for PS.

Actually, you have the problem.  Without being able to get at the number of
pages printed you are not going to be able to determine how many pages were
printed.

Here is the reason why.  With PostScript and a single line of PostScript
code, thousands of pages could be printed and you would have a hard time
determining that.  The code could look at some specific value in the printer
and use that a seed for a for loop.  If you were to look at the code you
wouldn't have the slightest idea of how many pages were printed.  You just
can't count on one showpage printing a single page.

Worse yet, the showpage operator is part of another definition for printing
the page, which is standard for many PostScript prologues.

The cure is to have a full PostScript interpreter that actually runs the
PostScript code and keeps track of the number of pages printed, at least
what it thinks are printed.  This will really get your users mad because now
there is this delay in getting the printout because you have to run the job
twice; once to count the pages and second to have the printer do it all over
again.

The cure: make sure that a banner page is printed and have someone physically
count the pages and charge the department.  Not exactly what you were looking
for.  The other cure is just as bad...get a real PostScript printer that
uses the serial port so that you can ask it how many pages were printed.  A
printer with a TCP/IP connection should also handle questions.

The above is, of course, personal opinion.
-- 
      harvard\     att!nicmad\          spool.cs.wisc.edu!astroatc!vidiot!brown
Vidiot  ucbvax!uwvax..........!astroatc!vidiot!brown
      rutgers/  decvax!nicmad/ INTERNET:vidiot!brown%astroatc@spool.cs.wisc.edu

clewis@ferret.ocunix.on.ca (Chris Lewis) (03/21/91)

In article <1111@eba.eb.ele.tue.nl> wjw@eba.eb.ele.tue.nl (Willem Jan Withagen) writes:
>Well here you've got a little problem. I'm planing to hook a HP-LJ II with
>PS-cartridge to an Apollo-workstation. And this through the parallel port.
>This'll get me some performance for those wanting to use PCL and bitmaps.

>This make it imposible to get info from the printer. I know that this is
>stupid, since the printer could return info on print jobs. But then this
>is the way it's going to be.

If the things you're printing use the Document Structuring Convention,
you could simply do a
	grep "%%Page:" <file> | wc
to find out the page count.  Of course, this isn't generally applicable - if
the file isn't DSC-compliant.  But will work with a lot of things (like psroff,
groff and probably Transcript)

(psroff has an option to feed the page count back up the serial line too)
-- 
Chris Lewis,
clewis@ferret.ocunix.on.ca or ...uunet!mitel!cunews!latour!ecicrl!clewis
Psroff support: psroff-request@eci386.uucp, or call 613-832-0541 (Canada)
**** somebody's mailer is appending .bitnet to my From: address.  If you
see this, please use the address in the signature, and send me a copy
of the headers of the mail message with the .bitnet return address.  Thanks!