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

EN PM, Polygon Mode Command 21-37
(PM2)
Use (PM2) to close the current polygon (or subpolygon) and exit
polygon mode. Remember, if you have not closed your polygon,
executing (PM2) adds a point to close the polygon. Refer to “Pen
Status and Location” in Chapter 17, Introduction to HP-GL/2
Graphics.
The following example draws the surface area of a 3-prong electrical
receptacle as a series of subpolygons, then fills and edges it using
the FP and EP commands, respectively.
Table 21-20 Example: Using the PM Command
?E Reset the printer.
?%0B Enter HP-GL/2 mode.
IN; Initialize HP-GL/2 mode.
SP1; Select pen number 1. Even though there is
no physical pen, the SP command must be
used to enable printing.
PA2000,2000; Specify absolute plotting and move to
(2000,2000).
PM0;PD3000,2000,
3000,3000;
Enter polygon mode, store a Pen Down
command, and store locations (3000,2000)
and (3000,3000).
PD2000,3000,
2000,2000;
Store two more pen-down locations,
(2000,3000) and (2000,2000).
PM1; Close the first polygon.
PD2080,2160,2480,
2160, 2480,2340,
2080,2340,2080,
2160;
Store 5 pen-down locations for a
subpolygon.
PM1; Close the subpolygon.
PD2080,2660,2480,
2660,2480,2840,
2080,2840,2080,
2660;
Store pen-down locations for another
subpolygon.
PM1; Close the second subpolygon.