HP-GL Commands


The following HP-GL commands are recognised by Plot2EMF:

Initialization and default setting instructions

IN Initialize Set Instruction
BP Begin Plot
DF Default Set Instruction

Plot area and unit setting instructions

IP [P1x, P1y, P2x, P2y] Input Scaling Point
IR [P1x, P1y, P2x, P2y] Relative Scaling Point
SC [Xmin, Xmax, Ymin, Ymax [, type]] Scale
IW [X1, Y1, X2, Y2] Input Window
RO [q] Rotation (q may be 0, 90, 180 or 270 degrees)
PG Page Feed

Pen control and plot instructions

PU [X1, Y1 [, Xn, Yn]] Pen Up
PD [X1, Y1 [, Xn, Yn]] Pen Down
PA [X1, Y1 [, Xn, Yn]] Plot Absolute
PR [X1, Y1 [, Xn, Yn]] Plot Relative
AA X, Y, qc [, qd] Draw Absolute Arc
AR X, Y, qc [, qd] Draw Relative Arc
BZ X1, Y1, X2, Y2, X3, Y3 [...] Draw Beziér Curve Absolute
BR X1, Y1, X2, Y2, X3, Y3 [...] Draw Beziér Curve Relative
CI r [, qd] Draw Circle
PE ... Polyline Encoded (HPGL/2)
PC pen, red, green, blue Pen Colour
CR red, green, blue Set Color Range for Relative Colors

Polygon group instructions

EA X, Y Edge Absolute Rectangle
ER X, Y Edge Relative Rectangle
EW r, q1, qc [, qd] Edge Wedge
RA X, Y Fill Rectangle Absolute
RR X, Y Fill Rectangle Relative
WG r, q1, qc [, qd] Fill Wedge
PM [n] Polygon mode (HPGL/2)
EP Edge Polygon (HPGL/2)
FP Filled Polygon (HPGL/2)

Plot function instructions

AC [x, y] Anchor Corner
FT [n [,d [,q]]] Fill Type n=1 and n=2 are both solid fills. 'd' and 'q' are ignored.
LT [n [,p]] Line Type n=2 and n=3 are the same, and n=4 and n=5 are the same. 'p' is ignored.
SM [c] Symbol Mode
SP [n] Select Pen
TL l1 [, l2] Tick Length ('l2' ignored)
XT X-axis Tick
YT Y-axis Tick
PS X, Y Page Size. PS4; = A4, PS3; = A3 paper sizes.
PT [d] Pen Thickness
PW [d] [,n] Pen Width (d) for pen number (n)
WU [d] Width Units (determines how the "PWn;" command is interpreted)
VS [d] Velocity Select (ignored)
PC n, red, green, blue Pen Color (HPGL/2) ?

Character plot instructions

CS [n] Standard Character Set Definition (only n=0 is supported)
CA [n] Alternate Character Set Definition (only n=0 is supported)
SS Select Standard Character Set
SA Select Alternate Character Set (not implemented)
DT [c] Define Label Terminator
LO [n] Define Label Origin
LB text <terminator> Plot Label
DI [run, rise] Character Plot Absolute Direction
DR [run, rise] Character Plot Relative Direction
SD [attribute, value] [...] Define Standard Font Attributes (only attributes 5 and 6 are recognised
CP [X, Y] Character Placement
ES [X, Y] Extra Spacing
SI [width, height] Absolute Character Size
SR [width, height] Relative Character Size
SL [t] Character Slant (not implemented)
UC X1, Y1 [, Xn, Yn] User-Defined Character

Miscellaneous instructions

CO ["comment"] Comment
MG ["message"] Message

Reference: The HP-GL/2 and HP RTL Reference Guide A handbook for developers.
Hewlett-Packard -- Third Edition -- July 1997
ISBN 0-201-31014-7

See Also:


Copyright © 1999-2006 by James Greene. All rights reserved. Information subject to change without notice.