A plot file that a plotter driver sends to a LaserJet is a PCL job in which the drawing is the HP-GL/2 between Esc%0B and Esc%0A. This page is from HP’s
PCL 5 Printer Language Technical Reference Manual: chapters 17 and 18 of Part II, and the logical page tables of Part I, chapter 2.
The usual sequence
Esc E reset the printer
Esc&l2A Esc&l0O Letter, portrait
Esc*c3060x3960Y a 4.25 by 5.5 inch picture frame (decipoints)
Esc*p565x600Y move to where the frame’s upper left corner goes
Esc*c0T the anchor point is the cursor
Esc*c8.5k11L the drawing is 8.5 by 11 inches: scale it by 1/2 into the frame
Esc%1B enter HP-GL/2, the pen at the PCL cursor
IN;SP1;PU50,50;... the drawing
Esc%1A back to PCL, the cursor at the pen
Esc E end the job
The picture frame
| Command | Meaning |
|---|---|
Esc*c#X, Esc*c#Y | Frame width and height in decipoints (0 to 32767, 4 decimal places). The default is the logical page width and the distance between the top and bottom margins (the default text length); 0, a reset, UEL, page length, paper size and orientation commands restore the default. They put P1 at the frame’s lower left corner and P2 at its upper right, reset the soft-clip window, clear the polygon buffer and move the pen to P1. |
Esc*c0T | The anchor point is the cursor: it is the frame’s upper left corner (the corner with the smallest X and Y at print direction 0). Other values are ignored. By default it is the left edge of the logical page at the default top margin. The print direction does not move the frame or the anchor. |
Esc*c#K, Esc*c#L | The HP-GL/2 plot size, in inches, of the drawing being imported. The ratio of the frame to the plot size is the scaling factor for each axis: a 12 inch plot in a 4 inch frame is shrunk to one third. Default: the frame’s size, so no scaling. 0, a reset, page length, paper size or orientation restores it. |
The HP-GL/2 origin is the lower left corner of the frame, and the drawing is clipped to the frame. The frame rotates with the logical page’s orientation, not with the print direction. A drawing
is page size independent (it adjusts to any frame without a plot size) only if no parameter is in plotter units: scaling by SC with P1 and P2 at their defaults or set with IR,
the window in user units, labels sized with SR, WU1 pen widths, relative line pattern lengths, scalable fonts and DR directions.
Spec and programs. The HP-GL/2 guide: on a device with the Technical Graphics Extension (a plotter) the page size comes from PS; on any other device it is the picture frame imported from PCL.
GhostPCL (pgconfig.c: HPGL_COMMAND('P', 'S', hpgl_PS, hpgl_cdf_rtl); pgparse.c) runs PS only in its HP RTL personality and skips it in a PCL job; the viewer also ignores PS inside a PCL
frame and uses it only for a plot with no PCL around it. In the same table GhostPCL gives BP to both personalities but ignores its parameters (“BP command value pair is currently ignored”).
Entering and leaving
Esc%#Benters HP-GL/2: 0 puts the pen at its previous position (at P1 the first time after a reset), 1 puts it at the PCL cursor. Even values act as 0 and odd values as 1. The Comparison Guide adds −1 (stand-alone plotter), and 2 and 3 (use the PCL dot coordinate system, with the old pen position or the current cursor).- The printer stays in HP-GL/2 until
Esc%#A,Esc Eor the UEL arrives, or the power is cycled.Esc%#A: 0 returns the cursor to its position before the drawing, 1 puts it at the HP-GL/2 pen (a pen outside the logical page puts it at the nearest point on the boundary). No PCL variable but the cursor is changed by entering and leaving. - Most HP-GL/2 settings keep their values between visits. A reset (
Esc Eor the panel) runsINand defaults the frame size, the anchor point, the plot size and the orientation. A page size, page length or orientation command defaults the anchor point, the frame, the plot size, P1 and P2, the window and the polygon buffer.
The logical page the frame sits on
The logical page is the part of the physical page the printer can reach, in dots at 300 dpi (double them for 600 dpi). Portrait: the page is the paper width by its length, the logical page is narrower by a left and right offset and as long as the paper. Landscape: the logical page is as long as the paper’s length less an offset at each end, and as wide as the paper’s width.
| Paper | Physical (dots) | Portrait logical page | Landscape logical page |
|---|---|---|---|
| Letter | 2550 × 3300 | 2400 × 3300, offset 75 | 3180 × 2550, offset 60 |
| Legal | 2550 × 4200 | 2400 × 4200, offset 75 | 4080 × 2550, offset 60 |
| Ledger | 3300 × 5100 | 3150 × 5100, offset 75 | 4980 × 3300, offset 60 |
| Executive | 2175 × 3150 | 2025 × 3150, offset 75 | 3030 × 2175, offset 60 |
| A4 | 2480 × 3507 | 2338 × 3507, offset 71 | 3389 × 2480, offset 59 |
| A3 | 3507 × 4960 | 3365 × 4960, offset 71 | 4842 × 3507, offset 59 |
| COM-10 | 1237 × 2850 | 1087 × 2850, offset 75 | 2730 × 1237, offset 60 |
| Monarch | 1162 × 2250 | 1012 × 2250, offset 75 | 2130 × 1162, offset 60 |
| C5 | 1913 × 2704 | 1771 × 2704, offset 71 | 2586 × 1913, offset 59 |
| B5 | 2078 × 2952 | 1936 × 2952, offset 71 | 2834 × 2078, offset 59 |
| DL | 1299 × 2598 | 1157 × 2598, offset 71 | 2480 × 1299, offset 59 |
The viewer uses these tables to place the page, the frame and the drawing.
HP RTL: cursor moves, negative motion and switching context
HP RTL (Raster Transfer Language) is the raster half of the large-format printers’ and plotters’ languages: PCL’s raster commands with HP-GL/2 beside them, without PCL’s text. The HP-GL/2 and HP RTL Reference Guide (third edition) describes three things the PCL pages do not:
| Topic | What the guide says |
|---|---|
Moving the cursor in native resolution units (Esc*p#x|X, Esc*p#y|Y) | The CAP (current active position) moves by that many HP RTL native resolution units: at a native resolution of 300 dots per inch a two-inch horizontal move is 600. A plus sign moves right (x) or down (y) from the CAP, a minus sign left or up, and no sign is an absolute distance from the logical page’s left or top bound. The range is −32767 to 32767 (out-of-range values are clamped); the x and y commands have no default. A move outside the logical page is allowed. The move does not depend on the raster resolution that Esc*t#r|R sets. Printers with several native resolutions choose one with @PJL SET RESOLUTION=; a lower one uses less memory and loses detail, which the guide recommends for drafts only. The older Esc&a#h|H moves in decipoints (1/720 inch, fractional dots allowed) and is to be made obsolete, as is Esc*b#y|Y (Y offset) outside raster mode. Reset puts the CAP at the HP RTL origin (0,0), and so does any HP-GL/2 page advance (PG, BP, RP). After raster data the CAP is on the left graphics margin one row below the last row (or below the destination raster height). |
Negative motion (Esc&a#n|N) | Negative motion is any HP-GL/2 drawing operation, any operation that would print above (in the negative y direction of) data already printed, and any Y offset in raster mode that moves the CAP upward (raster line path 0: a negative Y offset; path 1: a positive Y offset or any data transfer). 0 (the default) says the image may contain negative motion, so the device composes the whole page (or spools it to disk) before printing and several rasters, or rasters and vectors, can share a page. 1 says there is none: the device may print while it parses, saving memory and time, which only helps when one raster image is left to put on the page; printing is not guaranteed if the job then moves negatively, and the effect is device-dependent. A missing value is 0; other values make the command ignored. On devices that cannot receive and print at once the command does nothing. Entering HP-GL/2 with Esc%-1B ignores all HP RTL state, “negative motion disabled” included. |
Context switching (Esc%#B, Esc%#A, Esc E) | Esc%#B (HP-GL/2) with 0 puts the pen at its previous position and with 1 at the HP RTL CAP (a missing value is 0, a negative value is −1; the final bit decides otherwise), −1 makes the device a stand-alone plotter: a conditional page advance, then BP; only Esc E, Esc%#A and the UEL are recognised and vector and raster data cannot share a page; leaving it prints the page, advances and resets. Esc%#A (RTL) with 0 keeps the previous CAP and with 1 sets it to the pen position (the nearest point on the page boundary if the pen is outside); it also ends raster mode (an implied Esc*rC); PS and IW pass into HP RTL as the logical page and the soft-clip window. Both commands end the sequence they are in: they cannot be combined with others. The palette is unified: the active palette is transferred in either direction (sizes and colours, remapped to look the same; some devices cannot), its HP-GL/2 pen widths default by WU, and the bits per index become the smallest that holds the palette. Merge Control and Logical Operation are shared (the last sent applies); HP RTL patterns can fill HP-GL/2 areas, but HP-GL/2’s patterns cannot be used by HP RTL. Esc E resets both contexts, except in label mode with TD1 and inside a binary data transfer. Esc%-12345X leaves to PJL from either. A dual-context device (Esc%0B or %1B) lets vectors and raster come in any order on one page, drawn in the order received with TR, MC and the logical operation deciding how they combine; the guide advises sending vectors before rasters because a device that prints as it goes may drop later vectors, and BP5,1 to switch off auto-rotate when mixing. |
The explorer explains each of these commands in a job and applies the HP-GL/2 pen position and frame; it does not model a plotter’s page memory, so negative motion and the native resolution make no difference to the picture.
Sources
- HP, The HP-GL/2 and HP RTL Reference Guide (third edition): the HP RTL chapters on the current active position, negative motion and native resolution units, “Changing Language Contexts and Modes” and the reference pages of
Esc%#A,Esc%#B,Esc*p#x|X,Esc*p#y|YandEsc&a#n|N(read for this page) - HP, PCL 5 Printer Language Technical Reference Manual, Part II (bpl13211), chapters 17 and 18 – the frame, anchor, plot size, enter and leave commands, the default-settings list
- HP, PCL 5 Printer Language Technical Reference Manual, Part I (bpl13210), chapter 2, tables 2-1 and 2-2 – the logical pages
- HP, PCL 5 Comparison Guide (bpl13206) – the extra values of
Esc%#B