Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Nov 2000 19:27:43 -0500
From:      Garance A Drosihn <drosih@rpi.edu>
To:        "Thomas L." <tmliaw@pc.jaring.my>, <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Count page in lpr output
Message-ID:  <p04330103b63634e4610c@[128.113.24.47]>
In-Reply-To: <001a01c04d9e$64b61540$0d01a8c0@mypc>
References:  <001a01c04d9e$64b61540$0d01a8c0@mypc>

next in thread | previous in thread | raw e-mail | index | archive | help
At 2:20 AM +0800 11/14/00, Thomas L. wrote:
>Hi!
>     It is possible to get the number of page of a print file
>for lpr from the print queue before the print file being printed
>out?  I am working on a project where I have to capture the
>printout submitted through lpr, count the number of page of the
>print job, show it to the end user on another workstation, only
>then print the submitted print job when the user press ok.

There is nothing in lpr itself.  Lpr & friends are really
pretty simple-minded.  They do not count pages (or even
understand anything about pages), they just copy files
around.

You would probably have to send the job through something
like apsfilter (that is in the ports collection).  First
you need to change the file from "whatever the user sent"
(which might be plain text) to "whatever the printer
really wants" (which is likely to be postscript or hpgl).

You would then need something to count pages in the
postscript or hpgl file.  I do not know what would be
best to do this, as I use a different strategy for
doing printer accounting.  It might be that apsfilter
itself can give you a page count.  If not, then
something like ghostscript could do it for postscript
files.  I have no idea what would do for hpgl files.

I think you'd want to have one print queue that users
actually send to, and which goes into some filter that you
will have to write to figure out the page-count. That filter
would then probably want to move the job into a separate
queue, one which sends jobs to the physical printer.

Your project sounds interesting.  As you work on it, please
let me (gad@freebsd.org) know what issues come up.
-- 

---
Garance Alistair Drosehn            =   gad@eclipse.acs.rpi.edu
Senior Systems Programmer           or  gad@freebsd.org
Rensselaer Polytechnic Institute    or  drosih@rpi.edu


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?p04330103b63634e4610c>