Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't find when a page is ejected PCL5

Status
Not open for further replies.

templarrush

Programmer
Feb 27, 2012
11
BE
Hi,

In most cases the page is ejected when the cursor moves beyond the printable area, am I right?
I have a .prn file with PCL5 and the cursor moves to halfway the page, then HPGL is used to move the cursus further down, but not beyond the printable area...

How do I know when the paga is ejected?

 
The page is ejected when the printer receives a ctrl-L (page-feed, X0C) Also, if there are any data on the page, when it receives a reset (esc E), the page orientation is changed (esc &lnO) or, as you suggested, when the cursor moves below the last printable line on the page.
 
>> ... In most cases the page is ejected when the cursor moves beyond the printable area, am I right? ...

Not as such.

If the print stream contains absolute cursor positioning sequences (such as <Esc>*p#X and <esc>*p#Y), then data following such sequences which place the cursor outside of the printable area will just not be visible - but it won't cause a page eject.

If however, your data consists just (or mainly) of LineFeed-terminated text lines (without each of these lines being preceded by cursor positioning sequences), then I think that once the lines reach the bottom margin, the printer will automatically eject the page and start a new one.


>> ... I have a .prn file with PCL5 and the cursor moves to halfway the page, then HPGL is used to move the cursus
>> further down, but not beyond the printable area...
>> How do I know when the paga is ejected?

Not really sure what you are asking here; you need to provide a sample print stream to illustrate what you mean.


... and bear in mind that a number of PCL sequences will cause an implicit page eject in certain situations; for example, the 'set orientation' sequence (<esc>&l#O) will cause a page eject on most (all?) LaserJet printers, if the current page has a different orientation, and there are already text or raster objects within the printable area of the page.
 
What is it you are trying to do or why?

I only find 3 page ejects in the file.

The software is simply using a formfeed (^L or 0x0C) to cause the page to eject. I will just call it FF, a formfeed.

Logically, if you found those characters you would have it. Unfortunately there are countless FF characters included in binary data in the file, false positives as it were. Your search needs to avoid these.

When it is time for a page to be ejected, we may be in HP-GL/2 mode or in PCL mode. If in HP-GL it the software jumps back to PCL and then issues the FF. You have a sequence ^[%1A^L

There are two of those in the file. The other possibility of course is that you are already in PCL mode. In this case, almost certainly the character that follows the ^L will be an escape ^[ or 0x1B. That final point is also true when we have just come from HP-GL. So if we do a search for...

^L^[ or 0x0C 0x1B we should have it covered.

It's certainly not bulletproof but a place to start.

Jim Asman
 
... but other print streams may use methods other than FormFeed control code characters to start a new page or side.
 
Thanks for the help. I didn't think of the form feed control codes. It works now.

@jlasman: I'm making a PCL Viewer like PageTech, RedTitan, SwiftView. With more possibilities.
 
... and this is a (brief) analysis of the contents of that print file:

Code:
<Esc>%-12345X     Universal Exit Language (UEL)
@PJL Enter Language = PCL[0d][0a]
<Esc>E            Printer Reset
<Esc>&u600D       Unit-of-Measure (600 PCL units per inch)
<Esc>&f1025y      Macro Control ID (identifer = 1025)
       0X         Macro Control: Start Macro Definition
 ... macro contents not shown ...
<Esc>&f1X         Macro Control: Stop Macro Definition
<Esc>&f32766y     Macro Control ID (identifer = 32766)
       0X         Macro Control: Start Macro Definition
 ... macro contents not shown ...
<Esc>&f1X         Macro Control: Stop Macro Definition
<Esc>&l26a        Page Size: A4
       0o         Orientation: Portrait
       1s         Simplex/Duplex: Duplex Long-Edge Bind
       1l         Perforation Skip: Enable
       0E         Top Margin (0 lines)
<Esc>&a0L         Left Margin (column 0)
<Esc>&f1025y      Macro Control ID (identifer = 1025)
       3X         Macro Control: Call Macro
<Esc>(19U         Primary Font: Symbol Set (identifier = 19U)
<Esc>(s0p         Primary Font: Spacing: Fixed
       6h         Primary Font: Pitch (6 characters per inch)
       0s         Primary Font: Style (Upright, solid)
       3b         Primary Font: Stroke Weight: Bold
       4099T      Primary Font: Typeface (identifier = 4099)
<Esc>*p2258x      Cursor Position Horizontal (2258 PCL units)
       1350Y      Cursor Position Vertical   (1350 PCL units)
 ... data ...     1 of 3
<Esc>(19U         Primary Font: Symbol Set (identifier = 19U)
<Esc>(s0p         Primary Font: Spacing: Fixed
       12h        Primary Font: Pitch (12 characters per inch)
       0s         Primary Font: Style (Upright, solid)
       0b         Primary Font: Stroke Weight: Medium
       4099T      Primary Font: Typeface (identifier = 4099)
<Esc>*p458x       Cursor Position Horizontal (458 PCL units)
       1500Y      Cursor Position Vertical   (1500 PCL units)
 ... data ...     PaperSize:
<Esc>*p458x       Cursor Position Horizontal (458 PCL units)
       1650Y      Cursor Position Vertical   (1650 PCL units)
 ... data ...     PaperType:
<Esc>*p458x       Cursor Position Horizontal (458 PCL units)
       1800Y      Cursor Position Vertical   (1800 PCL units)
 ... data ...     Plex Mode:
<Esc>*p458x       Cursor Position Horizontal (458 PCL units)
       1950Y      Cursor Position Vertical   (1950 PCL units)
 ... data ...     Method:
<Esc>*p458x       Cursor Position Horizontal (458 PCL units)
       2100Y      Cursor Position Vertical   (2100 PCL units)
 ... data ...     Orientation:
<Esc>*p458x       Cursor Position Horizontal (458 PCL units)
       2250Y      Cursor Position Vertical   (2250 PCL units)
 ... data ...     Rear Orientation:
<Esc>*p458x       Cursor Position Horizontal (458 PCL units)
       2400Y      Cursor Position Vertical   (2400 PCL units)
 ... data ...     Main Form:
<Esc>*p458x       Cursor Position Horizontal (458 PCL units)
       2550Y      Cursor Position Vertical   (2550 PCL units)
 ... data ...     Rear Boilerplate:
<Esc>(19U         Primary Font: Symbol Set (identifier = 19U)
<Esc>(s0p         Primary Font: Spacing: Fixed
       12h        Primary Font: Pitch (12 characters per inch)
       0s         Primary Font: Style (Upright, solid)
       3b         Primary Font: Stroke Weight: Bold
       4099T      Primary Font: Typeface (identifier = 4099)
<Esc>*p1658x      Cursor Position Horizontal (1658 PCL units)
       1500Y      Cursor Position Vertical   (1500 PCL units)
 ... data ...     A4
<Esc>*p1658x      Cursor Position Horizontal (1658 PCL units)
       1650Y      Cursor Position Vertical   (1650 PCL units)
 ... data ...     <not set>
<Esc>*p1658x      Cursor Position Horizontal (1658 PCL units)
       1800Y      Cursor Position Vertical   (1800 PCL units)
 ... data ...     Duplex Long-edge binding
<Esc>*p1658x      Cursor Position Horizontal (1658 PCL units)
       1950Y      Cursor Position Vertical   (1950 PCL units)
 ... data ...     CallBegin
<Esc>*p1658x      Cursor Position Horizontal (1658 PCL units)
       2100Y      Cursor Position Vertical   (2100 PCL units)
 ... data ...     Portrait
<Esc>*p1658x      Cursor Position Horizontal (1658 PCL units)
       2250Y      Cursor Position Vertical   (2250 PCL units)
 ... data ...     <not set>
<Esc>*p1658x      Cursor Position Horizontal (1658 PCL units)
       2400Y      Cursor Position Vertical   (2400 PCL units)
 ... data ...     D:\PCLTestData\TestForms\PCL5\Id1025_PortRuled.ovl
<Esc>*p1658x      Cursor Position Horizontal (1658 PCL units)
       2550Y      Cursor Position Vertical   (2550 PCL units)
 ... data ...     D:\PCLTestData\TestForms\PCL5\PortFramex2.ovl
<Esc>&a2G         Duplex Page Side Selection: Back Side
<Esc>&f32766y     Macro Control ID (identifer = 32766)
       3X         Macro Control: Call Macro
<Esc>&a1G         Duplex Page Side Selection: Front Side
<Esc>&f1025y      Macro Control ID (identifer = 1025)
       3X         Macro Control: Call Macro
<Esc>(19U         Primary Font: Symbol Set (identifier = 19U)
<Esc>(s0p         Primary Font: Spacing: Fixed
       6h         Primary Font: Pitch (6 characters per inch)
       0s         Primary Font: Style (Upright, solid)
       3b         Primary Font: Stroke Weight: Bold
       4099T      Primary Font: Typeface (identifier = 4099)
<Esc>*p2258x      Cursor Position Horizontal (2258 PCL units)
       1350Y      Cursor Position Vertical   (1350 PCL units)
 ... data ...     2 of 3
<Esc>&a2G         Duplex Page Side Selection: Back Side
<Esc>&f32766y     Macro Control ID (identifer = 32766)
       3X         Macro Control: Call Macro
<Esc>&a1G         Duplex Page Side Selection: Front Side
<Esc>&f1025y      Macro Control ID (identifer = 1025)
       3X         Macro Control: Call Macro
<Esc>(19U         Primary Font: Symbol Set (identifier = 19U)
<Esc>(s0p         Primary Font: Spacing: Fixed
       6h         Primary Font: Pitch (6 characters per inch)
       0s         Primary Font: Style (Upright, solid)
       3b         Primary Font: Stroke Weight: Bold
       4099T      Primary Font: Typeface (identifier = 4099)
<Esc>*p2258x      Cursor Position Horizontal (2258 PCL units)
       1350Y      Cursor Position Vertical   (1350 PCL units)
 ... data ...     3 of 3
<Esc>&a2G         Duplex Page Side Selection: Back Side
<Esc>&f32766y     Macro Control ID (identifer = 32766)
       3X         Macro Control: Call Macro
<Esc>&f1025y      Macro Control ID (identifer = 1025)
       8X         Macro Control: Delete Macro
<Esc>&f32766y     Macro Control ID (identifer = 32766)
       8X         Macro Control: Delete Macro
<Esc>E            Printer Reset
<Esc>%-12345X     Universal Exit Language (UEL)
 
... and here's the analysis:

Code:
<Esc>%-12345X     Universal Exit Language (UEL)
@PJL Enter Language = PCL[0d][0a]
<Esc>E            Printer Reset
<Esc>&u600D       Unit-of-Measure (600 PCL units per inch)
<Esc>&l26a        Page Size: A4
       0o         Orientation: Portrait
       1s         Simplex/Duplex: Duplex Long-Edge Bind
       1l         Perforation Skip: Enable
       0E         Top Margin (0 lines)
<Esc>&a0L         Left Margin (column 0)
<Esc>(19U         Primary Font: Symbol Set (identifier = 19U)
<Esc>(s0p         Primary Font: Spacing: Fixed
       6h         Primary Font: Pitch (6 characters per inch)
       0s         Primary Font: Style (Upright, solid)
       3b         Primary Font: Stroke Weight: Bold
       4099T      Primary Font: Typeface (identifier = 4099)
<Esc>*p2258x      Cursor Position Horizontal (2258 PCL units)
       1350Y      Cursor Position Vertical   (1350 PCL units)
 ... data ...     1 of 3
<Esc>(19U         Primary Font: Symbol Set (identifier = 19U)
<Esc>(s0p         Primary Font: Spacing: Fixed
       12h        Primary Font: Pitch (12 characters per inch)
       0s         Primary Font: Style (Upright, solid)
       0b         Primary Font: Stroke Weight: Medium
       4099T      Primary Font: Typeface (identifier = 4099)
<Esc>*p458x       Cursor Position Horizontal (458 PCL units)
       1500Y      Cursor Position Vertical   (1500 PCL units)
 ... data ...     PaperSize:
<Esc>*p458x       Cursor Position Horizontal (458 PCL units)
       1650Y      Cursor Position Vertical   (1650 PCL units)
 ... data ...     PaperType:
<Esc>*p458x       Cursor Position Horizontal (458 PCL units)
       1800Y      Cursor Position Vertical   (1800 PCL units)
 ... data ...     Plex Mode:
<Esc>*p458x       Cursor Position Horizontal (458 PCL units)
       1950Y      Cursor Position Vertical   (1950 PCL units)
 ... data ...     Method:
<Esc>*p458x       Cursor Position Horizontal (458 PCL units)
       2100Y      Cursor Position Vertical   (2100 PCL units)
 ... data ...     Orientation:
<Esc>*p458x       Cursor Position Horizontal (458 PCL units)
       2250Y      Cursor Position Vertical   (2250 PCL units)
 ... data ...     Rear Orientation:
<Esc>*p458x       Cursor Position Horizontal (458 PCL units)
       2400Y      Cursor Position Vertical   (2400 PCL units)
 ... data ...     Main Form:
<Esc>*p458x       Cursor Position Horizontal (458 PCL units)
       2550Y      Cursor Position Vertical   (2550 PCL units)
 ... data ...     Rear Boilerplate:
<Esc>(19U         Primary Font: Symbol Set (identifier = 19U)
<Esc>(s0p         Primary Font: Spacing: Fixed
       12h        Primary Font: Pitch (12 characters per inch)
       0s         Primary Font: Style (Upright, solid)
       3b         Primary Font: Stroke Weight: Bold
       4099T      Primary Font: Typeface (identifier = 4099)
<Esc>*p1658x      Cursor Position Horizontal (1658 PCL units)
       1500Y      Cursor Position Vertical   (1500 PCL units)
 ... data ...     A4
<Esc>*p1658x      Cursor Position Horizontal (1658 PCL units)
       1650Y      Cursor Position Vertical   (1650 PCL units)
 ... data ...     <not set>
<Esc>*p1658x      Cursor Position Horizontal (1658 PCL units)
       1800Y      Cursor Position Vertical   (1800 PCL units)
 ... data ...     Duplex Long-edge binding
<Esc>*p1658x      Cursor Position Horizontal (1658 PCL units)
       1950Y      Cursor Position Vertical   (1950 PCL units)
 ... data ...     CallBegin
<Esc>*p1658x      Cursor Position Horizontal (1658 PCL units)
       2100Y      Cursor Position Vertical   (2100 PCL units)
 ... data ...     Portrait
<Esc>*p1658x      Cursor Position Horizontal (1658 PCL units)
       2250Y      Cursor Position Vertical   (2250 PCL units)
 ... data ...     <not set>
<Esc>*p1658x      Cursor Position Horizontal (1658 PCL units)
       2400Y      Cursor Position Vertical   (2400 PCL units)
<Esc>*p1658x      Cursor Position Horizontal (1658 PCL units)
       2550Y      Cursor Position Vertical   (2550 PCL units)
<Esc>&a2G         Duplex Page Side Selection: Back Side
<Esc>*p600x       Cursor Position Horizontal (600 PCL units)
       600Y       Cursor Position Vertical   (600 PCL units)
 ... data ...     rear face
<Esc>&a1G         Duplex Page Side Selection: Front Side
<Esc>(19U         Primary Font: Symbol Set (identifier = 19U)
<Esc>(s0p         Primary Font: Spacing: Fixed
       6h         Primary Font: Pitch (6 characters per inch)
       0s         Primary Font: Style (Upright, solid)
       3b         Primary Font: Stroke Weight: Bold
       4099T      Primary Font: Typeface (identifier = 4099)
<Esc>*p2258x      Cursor Position Horizontal (2258 PCL units)
       1350Y      Cursor Position Vertical   (1350 PCL units)
 ... data ...     2 of 3
<Esc>&a2G         Duplex Page Side Selection: Back Side
<Esc>*p600x       Cursor Position Horizontal (600 PCL units)
       600Y       Cursor Position Vertical   (600 PCL units)
 ... data ...     rear face
<Esc>&a1G         Duplex Page Side Selection: Front Side
<Esc>(19U         Primary Font: Symbol Set (identifier = 19U)
<Esc>(s0p         Primary Font: Spacing: Fixed
       6h         Primary Font: Pitch (6 characters per inch)
       0s         Primary Font: Style (Upright, solid)
       3b         Primary Font: Stroke Weight: Bold
       4099T      Primary Font: Typeface (identifier = 4099)
<Esc>*p2258x      Cursor Position Horizontal (2258 PCL units)
       1350Y      Cursor Position Vertical   (1350 PCL units)
 ... data ...     3 of 3
<Esc>&a2G         Duplex Page Side Selection: Back Side
<Esc>*p600x       Cursor Position Horizontal (600 PCL units)
       600Y       Cursor Position Vertical   (600 PCL units)
 ... data ...     rear face
<Esc>E            Printer Reset
<Esc>%-12345X     Universal Exit Language (UEL)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top