On Thu, 22 Feb 2001, Luke Bakken wrote:
> Hi all,
>
> I have a print accounting system successfully running using the hardware
> pagecounter on an HP4000N. What I'm curious about is how one could
> determine the number of pages in a print job through software to limit the
> maximum job size in the spool, before the job is sent to the printer?
>
> If the job is sent in postscript, for which code do you search the file
> (I'm not familiar with postscript code)? I've read the LPRng/ifhp FAQs
> thoroughly and have noted that counting pages in this way can be decieved
> using clever postscript coding, but I doubt that would happen in my
> situation.
I use the following method (only for estimation, accounting is done
by pagecounter):
#
# 1. Test with psselect
#
rm -f pageraw
SECOND=1
psselect -p_1-_1 $SCRATCH /dev/null 2>pageraw
if ANZRAW=`cat pageraw | grep Wrote`
then
ANZ=`echo $ANZRAW | cut -d " " -f1 | tr -d "[]"`
if [ "$ANZ" != "Wrote" -a "$ANZ" != "0" ]; then
SECOND=0
fi
fi
#
# 2. Test with ghostscript (at low resolution)
#
if [ $SECOND = 1 ]; then
gs -q -dNOPAUSE -dBATCH -dSAFER -sPAPERSIZE=a4 -r10 -sDEVICE=pgmraw
-sOutputFile=\|"catpage1 %d $SCRATCH2" $SCRATCH -c
fi
>
> Also, are there semi-reliable means for estimating PCL print jobs as well?
>
> Note that the actual page count will be determined with the hardware
> counter in this scenario - I'm just curious about estimates.
>
> Thanks,
> Luke Bakken
>
>
>
>
> -----------------------------------------------------------------------------
> YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
> The address you post from MUST be your subscription address
>
> If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
> or lprng-digest-requests) with the word 'help' in the body. For the impatient,
> to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED]
> with: | example:
> subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED]
> unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
>
> If you have major problems, send email to [EMAIL PROTECTED] with the word
> LPRNGLIST in the SUBJECT line.
> -----------------------------------------------------------------------------
>
Jörg
--------------------------------------------------------------------------
Freie Universität Berlin
Zentraleinrichtung fuer Datenverarbeitung
Jörg Bechlars
Fabeckstrasse 32
D-14195 Berlin
Tel: +49 30 838-56064 Fax: -56721
http://www.zedat.fu-berlin.de
e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------------
-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body. For the impatient,
to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED]
with: | example:
subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
If you have major problems, send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------