Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!SDD.HP.COM!tony From: tony@SDD.HP.COM (Tony Parkhurst) Newsgroups: comp.laser-printers Subject: Re: Counting pages on a HPLJ II Message-ID: <9104231655.AA11019@crayola.cs.UMD.EDU> Date: 19 Apr 91 23:06:57 GMT References: <9104171649.AA25809@crayola.cs.UMD.EDU> Sender: daemon@ucbvax.BERKELEY.EDU Organization: Hewlett-Packard, San Diego Division Lines: 30 Approved: laser-lovers@brillig.umd.edu In article <9104171649.AA25809@crayola.cs.UMD.EDU>, matt@EECS.NWU.EDU (Matt Larson) writes: |> I am interested in writing a filter that can count the number of pages |> printed to an HPLJ II. The input stream could be plain text or the HP |> graphics language. Counting pages of text is easy; counting pages of |> graphics (for example, output from Ghostscript, gnuplot, dvijep, etc.) |> is the part that has me stumped. What's this worth to you? :-) Basically, write a general purpose PCL parser (does nothing but pass thru data). I did this the other day, took me about an hour or two. You need to pass thru graphics and download data so they don't get interpreted as something else. Next, decide what needs to be kept track of: 1) FF (formfeeds are easy). 2) LF (but you have to know how many to the page, which can be changed by various escape sequences). 3) CR (if the line termination is changed from default) 4) E (reset, finishes and ejects a page, but only if it gets printed on). 5) CAP moves, which don't go to a new page, but may set the CAP to a lower position on the page which will mean less LF's to get to the next page. Seems like it should be a fun program to write. -- Tony