HP PCL/PJL reference (PCL 5 Printer Language) - Technical Reference Manual Part II

EN Pen Status and Location 17-21
Pen Status and Location
Since printing vector graphics has traditionally been performed with
plotters, the terms pen and pen position are used to described the
HP-GL/2 cursor, the current active position (CAP) when in HP-GL/2
mode. Like a physical pen, this imaginary pen must be selected if you
want to draw images. Commands such as Pen Up (PU) or Pen Down
(PD), and phrases such as “current pen position” or “moving the pen”
apply to the imaginary pen just as they would a physical pen on a
plotter.
Pen Status
Pen status refers to whether the “pen” is up or down. Use the Pen
Up (PU) command with X,Y coordinates to move the pen to the
desired printing location without drawing a line. Use the Pen Down
(PD) command with X,Y coordinates to lower the pen and begin
drawing from the current location to the first specified X,Y coordinate.
Upon entering HP-GL/2 mode for the first time following a reset (
E
C
E)
command, no pen has been selected and the pen is up. This means
that no lines are drawn when HP-GL commands are given until a pen
is selected. This can be done using the Select Pen (SP) command.
Most drawing commands require that the pen be lowered to produce
marks on the page. Once lowered with a Pen Down (PD) command,
the pen remains down for subsequent HP-GL/2 printing commands
until a Pen Up (PU) or Initialize (IN) command is issued. The pen
remains selected until a new SP command is received. You must be
aware of the pen’s up/down status to avoid drawing stray lines
between parts of your picture.
Note Upon entry into HP-GL/2 mode, a good programming practice is to
select a pen and command a pen-up move to the initial starting
position. This ensures that a pen is selected and is in the proper
position to begin drawing.
Every time you use a PU or PD command, the printer updates the
pen up/down status. The following table shows the commands that
include an automatic PD command as part of their function. After
performing their complete function, they return the pen to its previous
up/down state.