Article View: comp.laser-printers
Article #553Re: Counting pages on a HPLJ II
From: Andrea K. Frankel
Date: Fri, 19 Apr 1991 01:20
Date: Fri, 19 Apr 1991 01:20
34 lines
2412 bytes
2412 bytes
In article <9104171649.AA25809@crayola.cs.UMD.EDU> matt@EECS.NWU.EDU (Matt Larson) writes:
>Is there a sequence that always means, ``End of the page; print it''?
>I thought that's what the formfeed character (ASCII 12) did. I tried
>counting formfeed characters, but that doesn't seem to work: there are
>way too many. My current guess is that the formfeed character really
>means what I think it means, but that it is also possible for
>formfeeds to be part of other commands or in some sort of "quoted
>string." If I am on the right track, then the question is: How do I
>tell the real formfeeds that mean end of page from the other ones?
You will have to put together a mini escape-sequence parser. Graphics
commands such as <esc>*b#W write a block of raster data out (the #
stands for the numeric parameter specifying how many bytes of data
follow). Anything that looks like a formfeed that is part of raster
data should obviously not count as a page end!
Also, the sequence <esc>E (reset PCL command) will close and print
a page IF there was anything on it. It's possible that the last page
in a multipage file might not end with a formfeed if they're using
<esc>E.
Information on all of this is in the Technical Reference Manual that
comes with your printer. If you don't have one, get one!
Disclaimer: I use LaserJets, I don't write their code ;@)
Andrea Frankel, Hewlett Packard, San Diego Technical Graphics Div., R&D Lab
"wake now! Discover that you are the song that the morning brings..."
______________________________________________________________________________
Internet : andrea@sdd.hp.com (or andrea%hp-sdd@nosc.mil or @ucsd.edu)
UUCP : {hplabs|nosc|hpfcla|ucsd}!hp-sdd!andrea
CSNET : andrea%hp-sdd@hplabs.csnet
USnail : 16399 W. Bernardo Drive - Mailstop 61U65, San Diego CA 92127-1899
Voice : (619) 592-4664
Technical Details
Message-ID:
<9104191550.AA03507@crayola.cs.UMD.EDU>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!linac!att!ucbvax!SDD.HP.COM!andreaReferences:
<9104171649.AA25809@crayola.cs.UMD.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!linac!att!ucbvax!SDD.HP.COM!andrea From: andrea@SDD.HP.COM (Andrea K. Frankel) Newsgroups: comp.laser-printers Subject: Re: Counting pages on a HPLJ II Message-ID: <9104191550.AA03507@crayola.cs.UMD.EDU> Date: 19 Apr 91 01:20:02 GMT References: <9104171649.AA25809@crayola.cs.UMD.EDU> Sender: daemon@ucbvax.BERKELEY.EDU Organization: Hewlett-Packard, San Diego Technical Graphics Division Lines: 34 Approved: laser-lovers@brillig.umd.edu