An Introduction to HP-GL/2 Graphics ========================================= What is HP-GL/2? Vector graphics uses less memory than raster graphics, when being stored, as well as having a more efficient Input/Output transfer of large images when printing, (it will print faster). When printing in HP-GL/2, the printer will define points "a" and "b" then draw a line between them, in raster the printer defines every point between point "a" and point "b". HP-GL/2 History HP-GL/2 was added to the PCL language in PCL Level 5, for LaserJet III family printers and is supported in LaserJet 4 family printers with PCL Level 5 Enhanced. To print in HP-GL/2 you are required to leave the PCL environment and enter the HP-GL/2 environment. Switching into and out of HP-GL/2 requires only a few commands, and cannot be done through the front menu panel. Some software applications may easily switch between the two modes as needed without affecting performance. Learning HP-GL/2 The best way to learn HP-GL/2 is to read the "Introduction to HP-GL/2 Graphics" in the PCL 5 Printer Language Technical Reference Manual for an overview of HP-GL/2. Then find the specific commands you need in subsequent chapters. Reading through the examples, then trying to print them using a text editor or programming language is the best way to learn HP-GL/2. ------------------------------------------------------------------------------------------------ --------------------------- Absolute Arc Three Point (AT) Command ========================================= The AT command is Absolute Arc Three Point, and draws an arc segment, using absolute coordinates, from a starting point, through an intermediate point, to an end point. For more information see the PCL 5 Printer Language Technical Reference Manual. LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1 (black). Even though there is no physical pen, the SP command must be used to enable printing. PA1000,100;PD2500,100; Specifies (1000,100) as the starting location, places the pen down, and draws a line to (2500,100). PU650,1150;PD1000,1150; Lifts the pen up and moves to (650,1150), then places the pen down and draws a line to (1000,1150). PU650,450;PD1000,450; Lifts the pen up and moves to (650,450) then places the pen down, and draws a line to (1000,450). PU1000,100;PD1000,1500,2500,1500; Lifts the pen up and moves to (1000,100), then places the pen down and draws a line to (1000,1500), then draws a line to (2500,1500). AT3200,800,2500,100; Prints an arc, starting at the current pen position (25,1500), passing through (3200,800) and ending at (2500,100). PU3200,900;PD; Lifts the pen and moves it to (3200,900), and sets the pen down. AT3300,800,3200,700; Prints an arc, starting at the current pen position, passing through (3300,800) and ending at (3200,700). PU3300,800;PD3500,800; Lifts the pen to (3300,800) and then puts the pen down and draws a line to (3500,800). Ec%0A; Enters PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ ------------------------ Absolute Character Size (SI) Command ========================================= The Absolute character Size (SI) command, specifies the size of labeling characters in centimeters. For more information see the Updated PCL 5 Printer Language Technical Reference Manual. The syntax for this command is as follows: SI width, height; or SI; LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT. EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1, (black). Even though there is no physical pen, the SP command must be used to enable printing. PA700,3000; Enters absolute plotting mode and moves to (700,3000). DT#; Defines the label terminator as the "#" character. LBPrint#; Prints the word "Print" in the default font. PA700,2000;SI1,1.5;LBPrint#; Moves to (700,2000); specifies an absolute character size of 1 cm wide by 1.5 cm high; prints the word "Print". SI; Send SI with no parameters to return to the default size. SD1,21,2,1,4,12,5,0,6,0,7, 4148;SS; Designates a 12 point Universe font and selects it. PA 4000,3000;LBPrint#; Moves to (4000,3000) and prints the word "Print" in the 12 point Universe font. PA4000,2000;SI1,1.5;LBPrint#; Moves the pen to (4000,2000) and specifies a character size of 1 cm by 1.5 cm; prints the word "Print". Ec%0A Enters PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ --------------------------- Anchor Corner (AC) Command ========================================= The AC command positions the starting point of any fill pattern. By using this command you ensure that the selected fill pattern is positioned as expected within the figure. For more information see the PCL 5 Printer Language Technical Reference Manual. LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT. EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1, (black). Even though there is no physical pen, the SP command must be used to enable printing. PA3000,3000; Specifies absolute plotting and moves to location (3000,3000). FT3,400,45;RR1000,1000; ER1000,1000; Specifies a fill type of number 3 (parallel lines), with each line 400 plotter units (plu) apart and set at a 45 degree angle. RR fills a rectangle using the current pen location as the lower left corner, and a point 1000 plu to the right and 1000 plu up as the upper right corner. The ER edges the same rectangle just filled. PR1000,0;FT4,400,45;RR1000, 1000;ER1000,1000; Moves 1000 plu to the right, andselects fill type 4 (cross-hatch); then draws a rectangle the same size as the first one, and fills it with the cross-hatch pattern just specified, then edges it with the ER command. PR1000,0;FT3,400,45; RR1000,1000;ER1000,1000; Moves to the right another 1000 plu, and creates another rectangle of the same size, then fills this one with the number 3 fill pattern again. Then edges the rectangle just specified. PA3000,1500;AC3000,1500; RR1000,1000;ER1000,1000; Moves the pen to absolute position (3000,1500), and moves the anchor corner to location (3000,1500). Fills a rectangle with the fill pattern selected (number 3 from the command above), and edges it. PA4000,1500;AC4000,1500; FT4,400,45;RR1000,1000, ER1000,1000; Moves to location (4000,1500) andspecifies the location as the anchor corner. Selects fill type number 4 again, then fills, and edges a rectangle. PA5000,1500;AC5000,1500; FT3,400,45;RR1000,1000; ER1000,1000; Moves to absolute location (5000,1500)and specifies that location as the anchor corner, then selects fill type 3 again, and fills and edges another rectangle. Ec%0A Enters PCL mode. EcE Sends a reset to end the job and eject the page. NOTE Due to space limitations these lines of code appear on more than one line. When entered into the DOS editor they should appear on one line. ------------------------------------------------------------------------------------------------ --------------------------- Bezier Absolute (BZ) Command ========================================= The BZ command or Bezier Absolute command draws bezier curves using absolute coordinates. It uses the current pen position as the first control point, and specifies the other three control points as absolute coordinates. For more information see the PCL 5 Printer Language Technical Reference Manual. NOTE The Bezier command is not supported in any printers prior to the HP LaserJet 4 printer. LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT EcE Resets the Printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1 (black). Even though there is no physical pen, the SP command must be used to enable printing. PA1016,5080; Specifies the absolute point (1016,5080) as the starting location. PR;PD; Specifies relative plotting and puts the pen down. BZ1016,8128,5588,5080,4572,7112, 4064,8128,7112,7620,7112,2032; Draws a Bezier using the current position (1016,5080) as the first control point. The specified control points for the first curve are (1016,8128), (5588,5080), and (4572,7112). The second curve uses the last control point of the previous curve as the first control point (45,7112). The other three control points for the second curve are (4064,8128), (7112,7620), and (7112,2032). Ec%0A Enters PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ ------------------------ Bezier Relative (BR) Command ========================================= This command, BR or Bezier Relative , draws bezier curves using relative coordinates. This command uses the current pen position as the first control point, and specifies the other three control points as relative increments from the first point. For more information see the PCL 5 Printer Language Technical Reference Manual. NOTE The Bezier command is not supported on printers prior to the LaserJet 4 printer. LEGEND: Ec = [Ctrl] [P] Esc] in DOS EDIT EcE Resets the Printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1 (black). Even though there is no physical pen, the SP command must be used to enable printing. PA1016,5080; Specifies the absolute point (1016,5080) as the starting location. PR;PD; Specifies relative plotting and then puts the pen down. BR0,3048,4572,0,3556,2032, -508,1016,2540,508,2540,-5080; Draws a Bezier curve using the current position (1016,5080) as the first control point. The specified control points for the first curve are (0,3048), (4572,0), and (3556,2032). The second curve uses the last control point of the previous curve as the first control point (3554,2032). The other three control points for the second curve are (-508,1016), (2540,508) and (2540,-5080). Ec%0A Enters the PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ --------------------------- Changing Radii and Line Types in Circles The Line Type command specifies a line pattern to be used when drawing lines. You can specify the line type, pattern length and the mode. The line type specifies a particular pattern, the pattern length specifies the length of one complete line pattern, and mode specifies how the values of the pattern length parameter are interpreted. For more information see the PCL 5 Printer Language Technical Reference Manual. LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1 (black). Even though there is no physical pen, the SP command must be used to enable printing. SC-75,75,-75,75,1; Sets up user scaling with (-75,-75) as P1 and (75.75) as P2; the "1" parameter specifies isotropic scaling. PA0,0; Specifies absolute plotting and moves to user-unit location (0,0). LT;CI5; Specifies a default line type (solid) and draws a circle with a radius of 5 user-units. LT0;CI-12; Selects line type 0 (dotted) and draws a circle with a radius of 12 user-units (the -sign indicates starting at the 180 degree point). LT1;CI19;LT2;CI-26; Selects line type 1, and draws a circle with a radius of 19 user-units. then selects line type 2 and draws a circle with a radius of 26 user- units. LT3;CI33;LT4;CI-40; Selects line type 3, draws a circle with a radius of 33 user-units, then selects line type 4 and draws a circle with a radius of 40 user- units. LT5;CI47;LT6;CI54; Draws the outer two circles; the first with line type of 5 and radius of 47 user-units; the second with line type of 6 and a radius of 54 user-units. Ec%0A Enters PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ --------------------------- Character Slant (SL) Command ========================================= The Character Slant command (SL) specifies the at which labels are drawn. For more information see the Updated PCL 5 Printer Language Technical Reference Manual. The syntax for the command is as follows: SL tangent of angle; or SL; LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT. EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1, (black). Even though there is no physical pen, the SP command must be used to enable printing. SD1,21,2,1,4,25,5,0,6,0,7,4101; Designates a 25 point CG times font as the standard (primary) font. SI.7,1;PA1000,1000; Sets the absolute character size to .7 cm wide by 1 cm high; moves to (1000,1000). DT#,1; Defines the label terminator as the "#" character, and the 1 designates it as non-printing. SL.36;LBSlant#; Sets the slant angle for 20 degrees from the vertical (forward slant), and prints "Slant." PA1000,300;SL-.36;LBSlant#; Moves to (1000,300); changes the slant angle to -20 degrees from upright and prints "Slant". Ec%0A Enters PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ --------------------------- Chord Angle Effects on Circle Smoothness ========================================= When plotting circles, two parameters can be set. The first is the radius of the circle, the second is the chord angle. The chord angle default if 5 degrees, and the smaller the number the smoother the curve. This example shows the differences in appearance between chord angles on circles. For more information see the PCL 5 Printer Language Technical Reference Manual. LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1 (black). Even though there is no physical pen, the SP command must be used to enable printing. SC-3000,3000,-2000,2000,1; Specifies a scaling mode, making P1 equal to (-3000,-2000) user units and P2 equal to (3000,2000) user units. With isotropic scaling specified. PA-1700,2000;CI750,45; Specifies absolute plotting and moves to (- 1700,2000), the center of the circle, to be drawn. Draws a circle with a radius of 750 user-units and a chord angle of 45 degrees. PA300,2000;CI750,30; Specifies absolute plotting and moves to (300,2000) to draw another circle. This circle is drawn with a radius of 750 user-units, and a chord angle of 30 degrees. PA-1700,-200;CI750,15; Specifies absolute plotting and moves to (-1700,-200) the center point of a third circle. This circle is drawn with a radius of 750 user- units, and a chord angle of 15 degrees. PA300,-200;ci750; Specifies absolute plotting and moves to (300,-200), the center of the fourth circle. Draws this circle with a radius of 750 user-units and the default chord angle of 5 degrees. Ec%0A Enters PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ -------------------------- Creating a Mirror-Image ========================================= For more information see the PCL5 Printer LanguageTechnical Reference Manual. The subroutine is listed below the program example. LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT EcE Resets the printer. Ec%0B Enters HP-GL/2 Mode. IN; Initializes HP-GL/2 Mode. SP1; Selects pen number 1. You must use the SP command to enable printing. IP1500,3600,3000,5100; Specifies the P1/P2 locations for the first arrow figure. SC-15,15,-10,10; Sets up user scaling: (-15,-10) to (15,10). (Subroutine) Replace (Subroutine) with the actual subroutine following this program. This subroutine will draw an arrow image on the page. IP3000,3600,1500,5100; Changes the physical locations of P1 and P2 to flip the image to the left. (Subroutine) Prints the second arrow image. IP1500,5100,3000,3600; Changes the physical locations of P1 and P2 to flip the image down. (Subroutine) Prints the third arrow image. IP3000,5100,1500,3600; Changes the physical locations of P1 and P2 to flip the image to the left and down. (Subroutine) Prints the fourth arrow image. Ec%0A Enters the PCL mode. EcE Sends a reset to end the job and eject the page. Subroutine to Print the Arrow Image PA1,2;PD1,4,3,4,3,7,2,7, 4,9,6,7,5,7,5,4,12,4,12,5, 14,3,12,1,12,2,1,2;PU; ------------------------------------------------------------------------------------------------ -------------------------- Creating and Printing a Raster Fill Pattern ========================================= The Raster Fill ( RF ) Command is used to define a fill pattern to be used in other fill commands. The RF command does not select a fill type, it defines a user created fill type that can then be selected using the Fill Type ( FT ) command, with a type parameter of 11 and the corresponding raster fill index number for the second parameter. For example FT11,3; for the index number 3. For more information see the PCL 5 Printer Language Technical Reference Manual. The syntax for the RF command is as follows: RF index,width,height,pen number....pen number; or RF index; or RF; Raster Fill Pattern Parameters Index Specifies the index number of the pattern being defined. Width and Height Specifies the width and height in pixels of the pattern being defined. Pen Number Represents a pixel in the pattern being defined and indicates its color, black (>0) or white (0). This parameter defines pixels left to right, top to bottom, and the total number of pen number parameters should be equal to the width times the height parameter. For example, to define a pattern that is 8 x16 pixels, you need 128 pen number parameters. If not all pen parameters are specified, the remainder parameters default to zeros (white). The pattern that is created is printed in rows parallel to the plotter-units X-axis. Raster Fill Pattern Program LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT. EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1, (black). Even though there is no physical pen, the SP command must be used to enable printing. PU5,5; Lifts the pen and moves to absolute position (5,5). PA3500,2500: Specifies absolute plotting and moves to (3500,2500). RF2,8,4,0,0,0,0,0,0,0,0,0,0, 0,1,1,0,0,0,0,0,0,1,1,0,0,0 0,0,0,0,0,0,0,0; Defines a raster fill pattern (index number 2) that is 8 dots wide by 4 dots high. The dots are shown as they will appear in the pattern, they should ,be inputted into the program, on one line FT11,2; Selects the user-defined pattern just specified in the command above, with the index number of 2. RR4000,800;EP; Fills a rectangle with the fill pattern just specified by the FT command, with the lower left corner at (3500,2500) and upper right 4000 plotter units (plu) to the right and 800 plu up from that location. The EP command edges the polygon just drawn. Ec%0A Enters the PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ ----------------------- Default Settings for The HP-GL/2 Environment ========================================= When you enter the HP-GL/2 environment for the first time, all settings are at their default. When you exit HP-GL/2 to send other PCL commands then re- enter HP-GL/2, most variables retain their previous values. However, the following changes in the PCL environment can affect the HP-GL/2 environment. Related Topics: Resetting the Printer ("Esc E", or Control Panel Reset) Page Size, Page Length, or Orientation Command Redefining the PCL Picture Frame Setting the Picture Frame Anchor Point Setting an HP-GL\2 Plot Size Resetting the Printer ("Esc E", or Control Panel Reset) * Executes an IN ( Initialize ) command * Defaults the PCL Picture Frame size * Defaults the PCL Picture Frame anchor point * Defaults the HP-GL/2 Plot size * Defaults the PCL logical page orientation Page Size, Page Length, or Orientation Command * Defaults the PCL Picture Frame anchor point * Defaults the PCL Picture Frame * Defaults the HP-GL/2 plot size * Defaults P1 and P2 ( IP,IR ) * Resets the soft-clip window to the PCL Picture Frame boundaries ( IW ) * Clears the polygon buffer ( PM0, PM2 ) * Updates the cursor to the lower left corner of the picture frame ( P1 ) Redefining the PCL Picture Frame * Defaults P1 and P2 ( IP,IR ) * Resets the soft-clip window ( IW ) to the PCL Picture Frame boundaries. * Clears the polygon buffer ( PM0, PM2 ) * Updates the current pen position to the lower-left corner of the picture frame ( P1) Setting the Picture Frame Anchor Point * Defaults P1 and P2 ( IP, IR ) * Resets the soft-clip window to the PCL Picture Frame boundaries ( IW ) * Clears the polygon buffer ( PM0, PM2 ) * Updates the current pen position to the lower-left corner of the picture frame ( P1) Setting an HP-GL\2 Plot Size * Changes the picture frame scaling factor ------------------------------------------------------------------------------------------------ ---------------------- Drawing Arcs ========================================= The Arc Absolute (AA), and the Arc Relative (AR), commands use the following method for drawing arcs. Your current pen location becomes one end of the arc; you specify the center point with one parameter (setting the radius), and set another parameter to specify the number of degrees through which you want the arc drawn. For more information see the PCL 5 Printer Language Technical Reference Manual. LEGEND: Ec = [Ctrl] [P] Esc] in DOS EDIT EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2. SP1; Selects pen number 1 (black). Even though there is no physical pen, the SP command must be used to enable printing. PA4200,2900;PD; Sets starting point to (4200,2900) and sets pen down. AA4600,2500,-180; Using the Arc Absolute command, specifies the pivot point of the arc, thereby setting the radius; draws the arc for 180 degrees, in a negative angle of rotation, (clock-wise). Ec%0A Enters PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ --------------- Drawing Basic Wedges ========================================= The wedge commands, Edge Wedge ( EW ) and Fill Wedge ( WG ), use your current pen location as the center point of the wedge. You then specify the radius, the start angle, and the sweep angle to complete the wedge. The angles are measured counterclockwise, zero at the 3 o-clock position. For more information see the PCL 5 Printer Language Technical Reference Manual. Syntax for the EW command is as follows: EW[radius],[start angle],[sweep angle]; LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1, (black). Even though there is no physical pen, the SP command must be used to enable printing. PA2500,3500; Specifies absolute plotting and moves to location (2500,3500). EW600,90,60; Draws the outline of a wedge, using the current pen location (2500,3500) as the center point of the wedge. The wedge has a radius of 600 plotter units, and begins at 90 degrees from the default, zero degree, reference point, and "sweeps" for 60 degrees, counterclockwise. Ec%0A Enters the PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ ------------------------ Drawing Bezier Curves ========================================= The Bezier Absolute ( BZ ) and Bezier Relative ( BR ) commands use your current pen position as the first control point in the bezier curve. You specify the second, third and fourth control points. For more information see the PCL 5 Printer Language Technical Reference Manual. The following example shows a simple command sequence using BZ ( Bezier Absolute ) to draw a Bezier Curve in the shape of a sine wave. NOTE The Bezier command is not supported on printers prior to the LaserJet 4 printer. LEGEND: Ec = [Ctrl] [P] Esc] in DOS EDIT EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2. SP1; Selects pen number 1 (black). The SP command must be used to enable printing. PA1000,5000;PD; Specifies absolute plotting and moves to position (1000,5000) then puts the pen down. BZ2000,8000,4000,2000,5000,5000; Draws a bezier curve with (1000,5000) as the starting point (first control point). Specifies (2000,8000), (4000,2000), and (5000,5000) as the second, third and fourth control points. Ec%0A Enters PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ ----------------------- Drawing Circles ========================================= The CI command uses your current pen position as the center of the circle; you specify the radius of the circle. For more information see the PCL 5 Printer Language Technical Reference Manual. LEGEND: Ec = [Ctrl] [P] Esc] in DOS EDIT EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2. SP1; Selects pen number 1, (black). The SP command must be used to enable printing. PA2400,2500; Specifies absolute plotting and moves to position (2400,2500). CI500; Draws a circle with a radius of 500 plu (plotter units); the center of the circle is the current pen location (2400,2500). Ec%0A Enters the PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ ------------------------- Drawing Equal-Size Pictures on a Page ========================================= For more information see the PCL 5 Printer Language Technical Reference Manual. LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT EcE Resets the printer. Ec&l1O Selects landscape orientation. Ec%0B Enters HP-GL/2 mode, using the default picture frame size and anchor point. IN; Initializes HP-GL/2 mode. IP500,500,5450,7500; Sets P1 to (500,500) and P2 to (5450,7500). SC0,10,0,15; Sets up user-unit scaling to range from (0,0) to (10,15). SP1; Selects pen number 1. Even though there is no physical pen, the SP command must be used to enable printing. PA0,0; Begins absolute plotting from the origin (0,0). PD10,0,10,15,0,15,0,0;PU; Pen Down and print from (0,0) to (10,0) to (10,15) to (0,15) to (0,0); then Pen Up. IP5550,500; Inputs a new P1 and allows P2 to automatically follow it. PA 0,0: Begin absolute plotting from the new origin. PD10,0,10,15,0,15,0,0;PU; Pen Down and print from (0,0) to (10,0) to (10,15) to (0,15) to (0,0); then Pen Up. Ec%0A Enters PCL Mode. EcE Resets the Printer to complete the job and eject the page. ------------------------------------------------------------------------------------------------ -------------------------- Drawing Filled Rectangles ========================================= The Fill Rectangle Absolute (RA) and Fill Rectangle Relative (RR) commands fill their rectangles with the default or current fill pattern. When you use these commands, the rectangle created does not have an edge. Therefore, if you want the rectangle to have an edge, you should use the edge or outline rectangle commands, Edge Polygon ( EP ). For more information see the PCL 5 Printer Language Technical Reference Manual. This example shows one rectangle with an edge and another without. LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT. EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1, (black). Even though there is no physical pen, the SP command must be used to enable printing. PA0,0; Specifies absolute plotting and moves to location (0,0). FT3; Specifies a fill type of 3, (hatching - Parallel lines). RR1500,1000; Fills a rectangular shape with the currently active fill pattern. The lower left corner of the rectangle should be the current location (0,0), and the upper right corner should be 1500 plotter units (plu), in the X direction and 1000 plu in the Y direction from the starting location. EP; Draws an edge around the rectangle that was just drawn. Since the previous RR command leaves its definition in the polygon buffer (1500,1000), you do not need to specify the coordinates again. PR2000,0; Specifies relative plotting and moves the pen 2000 plu in the X direction from the current pen location. FT4,100,45; Specifies fill type number 4 (cross-hatching), sets the spacing to 100 plu between fill lines, and sets the fill line angle to 45 degrees. RR1500,1000; Fills a rectangle with the currently specified fill type. Using the current relative pen location of (0,0) as the lower left corner of the rectangle and a point (1500,1000) relative plu away for the upper right corner. Ec%0A Enters PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ --------------------------- Drawing Lines in HP-GL/2 ========================================= For more information see the PCL5 Printer Language Technical Reference Manual. LEGEND: Ec = [Ctrl] [P] Esc] in DOS EDIT EcE Resets the Printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes printer. SP1; Selects pen number 1 (Black). Even though there is no physical pen, the SP command must be used to enable printing. PA0,0; Begins absolute plotting from coordinate (0,0). PD2500,0,0,1500,0,0; Specifies the pen down and draw lines between the points. Ec%0A Enters the PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ ---------------------- Drawing Rectangles Using the Edge Rectangle Absolute (EA) Command ===================================================== The commands to draw rectangles in HP-GL/2 are Edge Rectangle Absolute (EA) , and Edge Rectangle Relative (ER). To use these commands, the printer uses the current pen location for one corner and you give the coordinates for the diagonally opposite corner. This example uses EA to draw the rectangle. For more information see the PCL 5 Printer Language Technical Reference Manual. LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT. EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1, (black). Even though there is no physical pen, the SP command must be used to enable printing. PA10,10; Specifies absolute plotting, then moves to (10,10). EA2500,1500; Draws the outline of a rectangle with the lower left corner being the current pen location, (10,10), and the upper right corner being (2500,1500). Ec%0A Enters PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ --------------------------- Edge Polygon (EP) Command ========================================= The Edge Polygon ( EP ) command outlines any polygon that is currently in the polygon buffer. This includes wedges and rectangles defined using the EA , ER , EW , RA , RR , and WG commands. EP accesses the data in the polygon buffer, but does not clear the buffer or change the data in any way. For more information see the PCL 5 Printer Language Technical Reference Manual. NOTE The last polygon drawn is stored in the polygon buffer. This is where EP finds the information it needs to edge a polygon. LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT. EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1, (black). Even though there is no physical pen, the SP command must be used to enable printing. PA2000,10; Selects absolute plotting mode and moves the pen to (2000,10). PM0;PD10,2000,10,10,2000,10;PM1; Enters polygon mode, stores a pen down command, stores points (10,2000), (10,10), and (2000,10), then closes the polygon. PU610,610;CI500;PM2; While still in polygon mode, lifts the pen and moves to (610,610). Draws a circle with a diameter of 500 plu, then closes the current subpolygon and exits polygon mode. EP; Outlines the polygon that was just stored in the buffer. Ec%0A Enters the PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ -------------------------- Entering HP-GL/2 Mode ========================================= The HP LaserJet printer will not understand HP-GL/2 commands without first toggling the printer into HP-GL/2 mode. This can be done by using PCL commands. To send PCL commands to the printer you can create a text file using any text editor, and printing the file on the target printer. The following example will be done using the DOS text editor EDIT. Creating a File Using EDIT to Enter HP-GL/2 LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT 1. At the DOS prompt type EDIT HPGL2.MOD and press ENTER. This will create a new file called HPGL2.MOD that you can save and use to enter HP-GL/2 mode whenever you want. After you press enter, the EDIT screen will appear. 2. The escape character in EDIT is done by pressing CTRL-P and then pressing ESC. (The escape character is produced in numerous other ways for different types of editors. Please consult your user manual for appropriate keys to produce the escape character in your editor). 3. In EDIT the escape character is represented by a left arrow, in this example we will use "Ec". EcE Resets the printer. Ec%0B Enters HP-GL/2 mode with the pen at the default HPGL/2 pen position (The lower left corner of the page). 4. Send these commands to the printer by selecting FILE, PRINT, Full Document and OK if you have a mouse. -OR- Press ALT, F, P, then ENTER. You will now be in HP-GL/2 Mode. 5. To exit EDIT press ALT, F, then X. EDIT will ask you if you want to save the file now, press ENTER and it will save and exit EDIT. After you have entered this command sequence, the printer will accept HP-GL/2 code and execute it as if the printer was actually a plotter. The best way to use these commands, is to put them at the beginning of your HP-GL/2 file that you want to print on the HP LaserJet printer. ------------------------------------------------------------------------------------------------ ----------------- Filling Wedges and Circles ========================================= The wedge commands, Edge Wedge (EW) and Fill Wedge (WG), use your current pen location as the center point of the wedge. You then specify the radius, the start angle, and the sweep angle to complete the wedge. The angles are measured counterclockwise, with zero at the 3 o-clock position. For more information see the PCL 5 Printer Language Technical Reference Manual. Syntax for the Edge Wedge command is: EW[radius],[start angle],[sweep angle]; LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes Hp-GL/2 mode. SP1; Selects pen number 1, (black). Even though there is no physical pen, the SP command must be used to enable printing. PA1400,2500; Selects absolute plotting mode and moves the pen to (1400,2500). WG600,150,120; Fills a wedge with radius 600 plotter units (plu), start angle 150 degrees, and sweep angle 120 degrees. Since no fill type was specified, the wedge is black (solid black is the default fill type). PA2300,2500;FT3,75,45; Specifies absolute plotting and moves to (2300,2500). Selects the fill type to be number 3 (hatching-parallel lines), with 75 plu between hatching lines, and hatching lines tilted at 45 degree angles. WG600,90,180; Fills a wedge with the current fill type, using a radius 600 plu, a start angle 90 degrees, and a sweep 180 degrees. FT1,0,0;WG600,270,60; Specifies a fill type of solid black and fills a wedge using the same center and radius as the previous wedge, but starts this wedge at 270 degrees with a sweep of 60 degrees. FT4,60,45;WG600,330,120; Specifies a fill type of number 4, (cross- hatching) with 60 plu between lines and the lines tilted at 45 degrees. Fills a wedge using the same center and radius as the previous two wedges, but starts this wedge at 330 degrees with a sweep of 120 degrees. PA3500,2500;WG400,0,360; Selects a new absolute plotting point and moves to it, (3500,2500) Creates a filled circle using the current fill type of number 4 (cross-hatching), and specifies a start angle 0 degrees with a 360 degree sweep. PA4500,2500;FT;WG400,0,360; Moves to (4500,2500) and begins absolute plotting. Selects a solid black fill to fill a wedge with a 400 plu radius, and sweep of 360 degrees, (a circle). Ec%0A Enters the PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ --------------------------- Fill Polygon (FP) Command ========================================= The Fill Polygon ( FP ) command, fills the polygon currently in the polygon buffer. For more information see the PCL 5 Printer Language Technical Reference Manual. LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT. EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1, (black). Even though there is no physical pen, the SP command must be used to enable printing. PA1500,1500; Specifies absolute plotting, then moves to (1500,1500). PM0;CI1000,60;PA1500,1500;CI500;PM2; Enters the polygon mode, stores a circle with radius of 1000 plotter units (plu) and a 60 degree chord angle. Stores a pen move to (1500,1500), and another circle with a 500 plu radius and a 5 degree (default) chord angle. Closes the current polygon and exits the polygon mode. LT4;FT3,50,45; Selects line type 4 and fill type 3. Specifies a 50 plu distance between the fill lines, and slants the lines at a 45 degree angle. FP; Using the even-odd fill method, this fills the polygon currently in the polygon buffer with the line and fill types specified in the command above. Ec%0A Enters the PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ --------------------------- Fill Rectangle Relative (RR) Command ========================================= The Fill Rectangle Relative ( RR ) command, defines and fills a rectangle using the current pen, the current line and fill types and relative X, Y, coordinates. The RR command includes an automatic pen down, and when the operation is complete, the original pen location and up/down status are restored For more information see the Updated PCL 5 Printer Language Technical Reference Manual. LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT. EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1, (black). Even though there is no physical pen, the SP command must be used to enable printing. PA400,400;RR400,800; Specifies absolute plotting, then moves to (400,400); fills a rectangle with the default fill color of black, with (400,400) as the lower left corner and the upper right corner, 400 plotter units (plu) to the right and 800 plu up from there. PR0,800;FT3,50;RR400,400; Enters the relative plotting mode and moves 800 plu in the Y direction; selects fill type 3 (parallel lines), with 50 plu between each line; fills a rectangle with the fill type just specified, with the current pen location as the lower left corner, and the upper right corner 400 plu to the right and 400 plu up from there. PR0,400;FT4;RR400,400; Moves 400 plu up and selects fill type 4 (cross- hatching); draws a rectangle using the current pen position as the lower left corner and a point 400 plu to the right and 400 plu up as the upper right corner. PA1200,400;FT;RR400,800; ER400,800; Moves to absolute location (1200,400) and selects the default fill type (solid black); draws and edges a rectangle that begins at the current pen position and extends 400 plu to the right, and 800 plu up from there. PR0,800;FT3,50;RR400,400; ER400,400; Moves 800 plu up from the current position an selects fill type 3 (parallel lines), with 50 plu between each line; draws and edges a rectangle using the current pen location as the lower left corner, and a point 400 plu up and 400 plu to the right as the upper right corner. PR0,400;FT4;RR400,400; ER400,400; Moves 400 plu up from the current pen position; selects fill type 4 (cross-hatching); draws and edges a rectangle using the current pen location as the lower left corner, and the right corner location is 400 plu to the right and 400 plu up from there. Ec%0A Enters PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ ------------------------ Fill Wedge (WG) Command ========================================= The Fill Wedge ( WG ) command, defines and fills a wedge using the current pen, the current line and fill types. The WG command includes an automatic pen down, and when the operation is complete, the original pen location and up/down status are restored. The syntax for the WG command is as follows: WG radius,start angle,sweep angle,[chord angle]; For more information see the Updated PCL 5 Printer Language Technical Reference Manual. LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1, (black). Even though there is no physical pen, the SP command must be used to enable printing. SC-3000,3000,-2000,2000,1; Sets up user scaling, with P1 located at (- 3000,-2000), and P2 being (3000,2000). The 1 indicates isotropic scaling. PA0,0;FT3,75,45;WG-1000,90,180; Enters absolute plotting mode and moves to user-unit position (0,0). Then selects fill type 3 (parallel lines), with 75 user-units between lines and the lines slanted 45 degrees. Then fills a wedge with the current fill pattern; using a radius of 1000 user-units, a starting angle of 90 degrees and a sweep angle of 180 degrees. The zero-degree reference point is on the left side of the circle (indicated by the negative radius parameter [- 1000]). EW-1000,90,180; Outlines (edges) the wedge just drawn with the commands above. FT4,60,45;WG-1000,330,120; Selects fill type 4 (cross-hatching), specifying 60 user-units between lines with the lines tilted at a 45 degree angle. Fills a wedge that has the same radius and center point as the one above, but with a starting angle of 330 degrees, and a sweep angle of 120 degrees. EW-1000,330,120; Edges the wedge just drawn above. PR-60,110;FT1; Specifies relative plotting and moves the pen 60 user-units to the left and 110 units up. Then selects fill type 1 (solid black). WG-1000,270,60; Fills a wedge, using the fill type just specified above, with a radius of 1000 user-units, a start angle of 270 degrees, and a sweep angle of 60 degrees. EW-1000,270,60; Edges the wedge just drawn. Ec%0A Enters PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ ------------------------ Filling Then Edging vs Edging Then Filling ========================================= When the transparency mode (TR) Command is opaque, filling then edging an object may produce different results than edging and then filling. This is especially true when large pen widths are used. The following example illustrates this. For more information see the PCL 5 Printer Language Technical Reference Manual. NOTE The following program will draw two circles using different sequences to fill then edge. The circle that is drawn on top is filled then edged, while the circle on the bottom is edged then filled. LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT. EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1, (black). Even though there is no physical pen, the SP command must be used to enable printing. TR0; Sets transparency mode off (opaque). PU4000,6000; Moves the pen to coordinate (4000,6000). PW5; Selects a pen width of 5 plotter units (plu). PM0; Enters polygon mode. CI1000; Draws a circle with a radius of 1000 plu. PM2; Closes polygon and exits polygon mode. FT10,30; Selects 30% shading fill type. FP;EP; Fills then edges the polygon, (circle). PU4000,3000; Moves the pen to location (4000,3000). PM0; Enters polygon mode. CI1000; Draws another circle with a radius of 1000 plu. PM2; Closes the polygon and exits polygon mode. EP;FP; Edges then fills the polygon, (circle). Ec%0A Enters PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ ---------------- Fill Type (FT) Command ========================================= This command selects the shading pattern used to fill polygons ( FP ), rectangles ( RA or RR ), wedges ( WG ), or characters ( CF ). The Fill Type command ( FT ), can use solid, shading, parallel lines (hatching), cross hatching, patterned (raster) fill, or PCL user-defined patterns. For more information see the PCL 5 Printer Language Technical Reference Manual. The syntax for this command is as follows: FT fill type,[option1,[option2]]; or FT; LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT. EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1, (black). Even though there is no physical pen, the SP command must be used to enable printing. PA2000,2000; Specifies absolute plotting and moves to location (2000,2000). FT;RR2500,300;ER2500,300; Selects the default fill type (solid black); fills a rectangle using solid black fill, with the lower left corner being the current pen location and the upper right corner a point 2500 plotter units (plu) to the right and 300 plu up. Edges the rectangle just filled. PR0,300;FT3,80,30;RR2500,300; Specifies relative plotting and moves the pen up 300 plu; selects fill type number 3 (parallel lines), with 80 plu between each line, with each line tipped 30 degrees. The RR command fills the rectangle with the fill type just specified, using the current pen location as the lower left corner, and a point 2500 X-units and 300 Y-units away as the upper right corner. PR0,300;FT10,36;RR2500,300 ER2500,300; Moves the pen position up 300 plu and specifies the fill type as 36% shading; fills a rectangle with that fill type, with the lower left corner being the current pen location and the upper right corner 2500 plu to the right and 300 plu up from there. The ER command edges the rectangle just filled. Ec%0A Enters the PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ -------------------- HP-GL to HP-GL/2 Command Changes ========================================= Some commands of the HP-GL language are not available in the HP-GL/2 language for HP LaserJet printers, because of the differences between the HP LaserJet printers, and HP Plotters. XT and YT ( x tick and y tick ) This command allows for automatic x- and y-axis tick mark printing. It is not available in HP-GL/2 as implemented on the LaserJet printers. RP ( Replot ) This command allows a plotter to recreate the plot image without sending new data to the plotter, (or printer). The only way to produce multiple copies on the LaserJet running in HP-GL/2 mode is to send a PCL copies command before entering HP-GL/2 mode, then at the end of the plot file an exit HP-GL/2 command is required. PG ( Page Advance ) This is an eject plot command. It has been disabled in the LaserJets to allow mixing of HP-GL/2 and PCL commands on the same page. The only way to eject a page is from PCL mode. The following commands will cause a conditional (if buffer holds data) page eject: LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT Printer Reset Command EcE Page Size Command Ec&l#A Paper Source Command Ec&l#H Page Length Command Ec&l#P Orientation Command Ec&l#O The printer will also unconditionally eject the page if a form feed control code character is sent (Decimal value 012 in ASCII). A form feed can also be invoked on the front panel of the printer if there is data in the buffer. ------------------------------------------------------------------------------------------------ ------------------------ Input Window (IW) Command ========================================= In HP-GL/2 you can create a window where your image will print. If your HP- GL/2 commands move the pen outside of that window, the part of the image that is outside will not print. The IW command or Input Window command will let you define this window where the image will print. The IW command creates a "soft-clip" window, where HP-GL/2 commands will not print. For more information see the PCL 5 Printer Language Technical Reference Manual. LEGEND: Ec = [Ctrl] [P] Esc] in DOS EDIT EcE Resets the printer. Ec%1B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1, (Black). SI.2,.35; Sets absolute character size to .2 x .35 cm. PA2000,3200; Specifies absolute plotting and moves to location (2000,3200) plotter units. DT@,1; Defines label terminator to be the "@" character, without printing the character. LBThis is an example of IW@; Prints a label beginning at (2000,3200). IW3000,1300,4500,3700; Specifies a soft-clip window in plotter units. PD2000,1700 Moves the pen down and prints a line from the current pen position to (2000,1700). Current pen position at start of command is at the letter W baseline. LBThis is an example of IW@; Prints the same label at (2000,1700). PU3000,1300; Moves the pen up and to the position (3000,1300). PD4500,1300,4500,3700; Moves the pen down and begins drawing the box indicating the soft-clip window. PD3000,3700,3000,1300; Finishes drawing the soft-clip window box. PU; Moves the pen up. Ec%0A Enters PCL mode. EcE Resets the printer to end the job and eject the page. ------------------------------------------------------------------------------------------------ ------------------- Label (LB) Command ========================================= The Label command (LB) allows you to print text using the currently defined font. For more information see the Updated PCL 5 Printer Language Technical Reference Manual. LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT. EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1, (black). Even though there is no physical pen, the SP command must be used to enable printing. PA2500,2500; Specifies absolute plotting and moves to (2500,2500). DT*; Defines "*" as a label terminator (non-printing). SD1,21,2,1,4,25,5,0,6,3,7,4148;SS; Designates the 25-point Universe Bold font as the standard font and selects it with the SS command. LBThis is a Label.*; Prints "This is a Label." in the currently selected font. The label terminator "*" will not print. Ec%0A Enters PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ ----------------- Label Origin (LO) Command ========================================= The Label Origin command (LO) positions labels relative to the current pen location. For more information see the Updated PCL 5 Printer Language Technical Reference Manual. LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT. EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1, (black). Even though there is no physical pen, the SP command must be used to enable printing. SC-4000,4000,-5000,5000; Specifies scaling by assigning (-4000,-5000) to P1, and (4000,5000) to P2. SI.17,.26;PA0,500; Sets the absolute character size to .17 cm wide by .26 cm high; moves to (0,500). PD-500,0,0,-500,500,0,0,500; Sets the pen down and draws lines from (0,500) to (-500,0), to (0,-500), to (500,0), and to (0,500). DT#; Defines the label terminator as the "#" character. CI10;LO4;LBCentered on point#; Draws a small circle (radius of 10 plotter units, plu) to represent the label origin point; specifies a label origin of 4, and prints "Centered on point". PU-500,0;CI10;LO18; Lifts the pen and moves to (-500,0); draws another small circle; specifies a label origin of 18. LBLeft center offset#; Prints "Left center offset". PU0,-500;CI10;LO13; Lifts the pen, and draws another small circle; specifies label origin number 13. LBRight offset from point#; Prints "Right offset from point". PA500,0;CI10;LO3; Moves to (500,0); draws another small circle; specifies label origin number 3. LBRight hang from point#; Prints the last label, "Right hang from point". Ec%0A Enters PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ --------------------------- Line Attribute (LA) Command ========================================= The Line Attributes command specifies how line ends and line joins are physically shaped. This command can only be used when drawing lines that are thicker than 0.35 mm. The following example draws an electrical ground symbol using the ( LA ) command. For more information see the PCL 5 Technical Reference Manual. The syntax for this command is as follows: LA kind,value,[kind,value,[kind,value]]; or LA; NOTE Due to space limitations some of the lines of code appear on more than one line. When entering them in DOS EDIT they should be placed on one line. LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT. EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1, (black). Even though there is no physical pen, the SP command must be used to enable printing. PA4000,3000; Specifies absolute plotting and moves to location (4000,3000). PW2;LA1,3;PD3500,2500, 4000,2000; Sets the pen width to 2 mm; specifies a triangular line end, places the pen down and draws a line from the current pen location to (3500,2500), to (4000,2000). PU3500,2500;LA2,2,3,20; PD3000,2500,3000,2300; Lifts the pen and moves to (3500,2500);sets the line join to mitered/beveled and the miter limit to 20. Sets the pen down and draws a line to (3000,2500), then to (3000,2300). PU2500,2300;LA1,4;PD35002300; Lifts the pen and moves it to (2500,2300); specifies round line ends and draws a line to (3500,2300). PU2700,2100;PD3300,2100; Lifts the pen and moves to (2700,2100); sets the pen down and draws a line to (3300,2100). PU2900,1900;PD3100,1900; Lifts the pen and moves to (2900,1900); sets the pen down and draws a line to (3100,1900). Ec%0A Enters PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ ----------------------- Pen Down (PD) Command ========================================= The Pen Down command is the basic plotting command, it puts the printer's logical pen down to enable printing. For more information see the PCL 5 Printer Language Technical Reference Manual. LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT. EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1, (black). Even though there is no physical pen, the SP command must be used to enable printing. PA10,10; Begins absolute plotting from coordinate (10,10). PD2500,10,10,1500,10,10; Sets the pen down and draws lines between the specified points. Ec%0A Enters the PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ --------------------- Pen Width (PW) Command ========================================= This command specifies a new width for the logical pen. The pen width can be specified as a fixed value or a relative value based on the distance between P1 and P2. The units for measurement in the PW command are selected with the WU command (the default is metric). For more information see the PCL 5 Printer Language Technical Reference Manual. The syntax for the PW command is as follows: PW width,[pen]; or PW; NOTE Due to space limitations, some of the above lines of code appear on more than one line. When entering them in DOS Edit they should be on one line. LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT. EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1, (black). Even though there is no physical pen, the SP command must be used to enable printing. PA3500,2500; Specifies absolute plotting and moves to location (3500,2500) PW1.5;PD4500,2800,4500, 1800,3500,1500,3500,2500; Selects a pen width of 1.5 mm. Sets thepen down and draws a line from the current pen position to (4500,2800), to (4500,1800), to (3500,1500), and to (3500,2500). PW.8;PD2300,2900,2300, 1900,3500,1500; Sets the pen width to .8 mm and places the pen down to print a line to (2300,2900) to (2300,1900), and to (3500,1500). PW.5;PU2300,2900;PD3300, 3200,4500,2800; Sets the pen width to .5 mm and puts the pen up to move to (2300,2900). Puts the pen down and draws a line to (3300,3200) to (4500,2800). PW.25;PU4500,1800; PD3500,2100; Sets the pen width to .25 mm and puts the pen up to move to location (4500,1800); puts the pen down to draw a line to (3500,2100). Ec%0A Enters PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ ------------------- Plot Relative (PR) Command ========================================= The Plot Relative command establishes relative plotting and moves the pen to specified points, with each move relative to the current pen location. For more information see the PCL 5 Printer Language Technical Reference Manual. LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT. EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1, (black). Even though there is no physical pen, the SP command must be used to enable printing. PA10,10;PD Begins absolute plotting from coordinate (10,10), and places the pen down. PR2500,0,-2500,1500,0,-1500; Specifies relative plotting and draws lines beginning at (10,10) and then moves the relative coordinate distances indicated. Ec%0A Enters the PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ ---------------------- Printing Labels ========================================= When printing labels in HP-GL/2, use the Label ( LB ) command. For more information see the PCL 5 Language Technical Reference Manual. LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT. EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1, (black). Even though there is no physical pen, the SP command must be used to enable printing. PA1500,2500; Specifies absolute plotting and moves to (1500,2500). SD1,21,2,1,4,25,5,1,6,0,7,52; Designates the 25 point Universe Italic font as the standard font. DT*,1; Defines the asterisk (*), as the label terminator (the 1 indicates the terminator should not be printed). SA; Selects the alternate font for printing; since an alternate font hasn't been designated, the default 11.5 point stick font is selected. LBThis is the Stick Font (Default)CR-LF CR-LF*; Prints the first line of text, followed by two Carriage Return (CR) and two Line Feed (LF) control codes. Notice how the asterisk terminates the label. SS; Selects the standard font, defined with the SD command above, as a 25 point Universe Italic font. LBThis is Universe Italic*; Prints the next line of text in the newly specified font. Ec%0A Enters PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ ------------------- Relative Arc Three Point (RT) Command ========================================= The RT command draws an arc segment, using relative coordinates, from a starting point through an intermediate point to an end point. For more information see the PCL 5 Printer Language Technical Reference Manual. LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT EcE Resets the Printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1 (black). Even though there is no physical pen, the SP command must be used to enable printing. PA1000,100; Specifies the absolute point (1000,100) as the starting location of the plot. PR;PD1500,0; Specifies relative plotting, pen down, and draws a line (1500,0) relative plotter units from the current pen location of (1000,100). PU-1850,1050;PD350,0; Lifts the pen, moves to (-1850,1050) in relative coordinates, places the pen down, and draws a line 350 plu in the X direction. PU-350,-700;PD350,0; Lifts the pen, moves (-350,-700) plu from the current location, places the pen down, and draws a line 350 plu in the X direction. PU0,-350;PD0,1500,1500,0; Lifts the pen, moves 350 plu to the left, places the pen down, draws a line 1500 plu up and then another line 1500 units to the right. RT700,-750,0,-1500; Draws an arc from the current pen position through a point (700,-750) plu away, with an ending point (0,-1500) plu from the beginning of the arc. PU700,850;PD; Lifts the pen and moves it (700,850) plu from the current pen position; then puts the pen down. RT100,-100,0,-200; Draws an arc from the current pen position, through a point (100,-100) plu away, to an ending point (0,-200) from the starting point of the arc. PU100,100;PD200,0; Lifts the pen and moves it (100,100) plu from the current pen position, places the pen down and draws a line 200 plu in the X direction. Ec%0A Enters the PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ ----------------- Relative Character Size (SR) Command ========================================= The Relative Character Size (SR) command, specifies the size of labeling characters as a percentage of the distance between P1 and P2. For more information see the PCL 5 Printer Language Technical Reference Manual. The syntax for this command is as follows: SR width, height; or SI; NOTE Due to space limitations some of the lines of code appear on more than one line. When entering them in DOS EDIT they should be placed on one line. LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT. EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1, (black). Even though there is no physical pen, the SP command must be used to enable printing. IP-6956,-4388,6956,4388; Moves P1 to (-6956,-4388), and P2 to (6956,4388). DT@; Defines the label terminator as the "@" character. SR;PA0,2700;LBRELATIVE LABEL SIZE@; Defaults the character size as a percentage of the P1/P2 rectangle, and moves the pen to (0,2700); prints "RELATIVE LABEL SIZE". IP0,0,5500,5500;PA0,2000; Moves P1 to (0,0) and P2 to (5500,5500); moves the pen to (0,2000). LBNEW P1 AND P2 CHANGE LABEL SIZE@; Prints "NEW P1 AND P2 CHANGE LABEL SIZE". PA0,1000;SR2.5,2.5; Moves to (0,1000) and sets the character size to 2.5% by 2.5% of the P1/P2 rectangle. LBNEW SR INSTRUCTION@;CP; Prints "NEW SR INSTRUCTION" and sends a CP for Carriage Return/Line Feed. LBCHANGES LABEL SIZE@; Prints "CHANGES LABEL SIZE." Ec%0A Enters PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ --------------------------- Select Primary Font ( FI ) Command ========================================= The Select Primary Font command ( FI ), allows any accessible font that has been assigned a font ID number to be selected as the primary (standard) font. For more information see the PCL 5 Printer Language Technical Reference Manual. The syntax for this command is as follows: FI font-ID; LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT. EcE Resets the printer. Ec*c15D Specifies a font ID number of 15. Ec(s1p18v0s3b4148T Selects an 18-point Universe Bold font as the primary font. Ec*c6F Assigns the font just defined as the temporary font with ID number (15). Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1, (black). Even though there is no physical pen, the SP command must be used to enable printing. PA1500,1500; Specifies absolute plotting and moves to (1500,1500). DT#; Defines "#" as a label terminator (non-printing). LBLaserJet Printers CR-LF#; Prints "LaserJet Printers" in the currently selected font, which is the default Stick font. Then, a Carriage Return and Line Feed (CR-LF). SD4,18;FI15;SS; Uses the SD command to designate an 18-point font from within HP-GL/2 mode; selects the PCL font with font ID number 15 as the primary font; selects the primary font for printing. LBLaserJet Printers#; Prints "LaserJet Printers" in the newly selected font. Ec%0A Enters PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ ---------------- Select Secondary Font (FN) Command ========================================= The Select Secondary Font command (FN), allows any accessible font that has been assigned a font ID number to be selected as the secondary (alternate) font. For more information see the PCL 5 Printer Language Technical Reference Manual. The syntax for this command is as follows: FN font-ID; LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT. EcE Resets the printer. Ec*c28D Specifies a font ID number of 28. Ec(s1p18v0s3b4148T Selects an 18-point Universe Bold font as the primary font. Ec*c6F Assigns the currently selected font as the temporary font with the current ID number (28). Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1, (black). Even though there is no physical pen, the SP command must be used to enable printing. PA1500,1500; Specifies absolute plotting and moves to (1500,1500). DT#; Defines "#" as a label terminator (non-printing). LBLaserJet Printers CR-LF#; Prints "LaserJet Printers" in the currently selected font, which is the default Stick font, followed by a Carriage Return and Line Feed (CR-LF). AD4,18;FN28;SA; Uses the AD command to designate an 18-point font from within HP-GL/2 mode; selects the PCL font with font ID number 28 as the secondary font; selects the font. LBLaserJet Printers#; Prints "LaserJet Printers" in the newly selected font. Ec%0A Enters PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ --------------------- Simple Drawing in HP-GL/2 ========================================= This example will draw a box with a circle in the center. For more information see the PCL 5 Printer Language Technical Reference Manual. Creating a Simple Drawing: LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT EcE Resets the printer. Ec&l2A Sets the page size to letter. Ec&l0O Specifies portrait orientation. Ec*c3600x3600Y Specifies a 5" wide by 5" high PCL Picture Frame (5 inches x 720 decipoints/in = 3600 decipoints). Ec*p450x675Y Moves the cursor to the point you want at the picture frame anchor point. Ec*c0T Sets the picture frame anchor point to the cursor position. Ec%1B Enters HP-GL/2 mode with the cursor (pen) at the PCL cursor position. In this example, the cursor is at the picture frame anchor point 450 dots (1.5 in.) down from the top margin and 675 dots (2.25 in.) to the right of the left logical page boundary. IN;SP1; (IN) Initializes HP-GL/2 command values and (SP) selects pen number 1 (black). The IN command moves the pen position from the anchor point to the HP-GL/2 origin, the lower-left corner of the PCL Picture Frame. SC0,100,0,100; Sets up user scaling so that P1 is (0,0) and P2 is (100,100). These points are the lower-left and upper-right corners of the PCL Picture Frame, respectively. PD100,0,100,100,0,100,0,0; Draws a box marking the perimeter of the PCL Picture Frame. (It is important to note that this line is being drawn on the border of the Picture Frame, and any line drawn on the border of the frame will be clipped, producing a line width one-half of the defined pen width.) PU50,50;CI25; Lifts the pen and moves to the center of the PCL Picture Frame (50,50); draws a circle with a 25 unit radius. Ec%1A Enters the PCL Mode with the cursor at the current HP-GL/2 pen position. EcE Resets the printer to end the job and eject a page. ------------------------------------------------------------------------------------------------ -------------------- User-Defined Line Type (UL) Command ========================================= The User-Defined Line Type ( UL ) command allows you to define and store your own line types. The command does not itself select a line type, it only defines it. To select a line type use the Line Type ( LT ) command. For more information see the PCL 5 Printer Language Technical Reference Manual. The syntax for the UL command is as follows: UL index,[gap1,...gap20]; -OR- UL; User-Defined Line Type Parameters Index Identifies the number of the line type to be redefined. Gaps Specifies alternate pen down and pen up stretches in the line type pattern; if gaps are numbered starting with1, odd numbered gaps are pen up moves. The first gap is a pen down move. A maximum of 20 gaps are allowed for each user-defined line type. User-Defined Line Type Program LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT. EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1, (black). Even though there is no physical pen, the SP command must be used to enable printing. PA4000,3000; Specifies absolute plotting and moves to (4000,3000). UL8,0,15,0,15,0,15,40,15; Redefines the user-defined line type with an index number of 8; specifies the lines and spaces as follows, in percentages of the line distance: gap1 as a dot (0%), gap2 as a space (15%), gap3 as a dot (0%), gap4 as a space (15%), gap5 as a dot (0%), gap6 as a space (15%), gap7 as a line (40%), and gap8 as a space (15%). LT8,10;PU2000,2500;PD5000,2500; Specifies line type number8 (just defined), with a pattern length of 10% of the distance between P1 and P2, (in this case, the lower-left and upper-right corners of the PCL picture frame); lifts the pen and moves to (2000,2500); sets the pen down to draw a line to (5000,2500). Ec%0A Enters the PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ -------------------------- Varying the Chord Angle ========================================= The chord angle refers to the angle used to draw an arc in a curve. The smaller the chord angle the smoother the curve. The default is a chord angle of 5 degrees. For more information see the PCL 5 Printer Language Technical Reference Manual. LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number one (black). Even though there is no physical pen, the SP command must be used to enable printing. PA2000,0; Specifies (2000,0) as the starting point, to plot absolute. PD;AA0,0,45,25; With the pen down, draws a 45 degree arc (positive angle) with center coordinates of (0,0) and a chord angle of 25 degrees. PU1050,1060; Lifts the pen and moves to coordinates (1050,1060) Plotter Units (PLU). PD;AA0,0,-45,10; With the pen down, draws a 45 degree arc (negative angle) using the same center point as the first arc, but with a 10 degree chord angle. PU;1000,0; Lifts the pen and moves to coordinates (1000,0), PLU. PD;AA0,0,45; With the pen down, draws another 45 degree arc (positive angle) with the same center point, but with the default chord angle of 5 degrees. Ec%0A Enters PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ ------- Using Edge Rectangle Absolute (EA) to Draw Rectangles ========================================= The Edge Rectangle Absolute (EA) command defines and outlines a rectangle using absolute coordinates with the current pen location and a point you specify as the two opposite corners of a rectangle. For more information see the PCL 5 Printer Language Technical Reference Manual. LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT. EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1, (black). Even though there is no physical pen, the SP command must be used to enable printing. SC0,150,0,150,1; Sets up user scaling, with P1 being (0,0) user-units, (as opposed to plotter units), and P2 being (150,150) user-units. (The 1 on the end specifies isotropic scaling, or that the units on the X and Y axis are the same size). PA75,105;EA115,130 Selects absolute plotting mode and moves the pen to (75,105). Using the EA command will outline the shape of a rectangle that begins at (75,105) and has an upper right corner of (115,130) user-units. PA95,105;PD95,95; Draws a line form (95,105) to (95,95). PD65,95,65,90; Draws a line from the current pen location (95,95) to (65,95), and another line from there to (65,90). PU45,90;EA85,65; Lifts the pen and moves to (45,90), then draws the outline of a rectangle with an upper left corner of (45,90) and a lower right corner of (85,65). PU95,95;PD125,95,125,90; Lifts the pen and moves to (95,95), lowers the pen and draws a line to (125,95), then to (125,90). PU145,90;EA105,65; Lifts the pen and moves it to (145,90). Draws the outline of a rectangle, with the upper right corner at (145,90) and the lower left corner at (105,65). Ec%0A Enters the PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ ------------------------- Using Arc Relative to Draw Arcs ========================================= For more information see the PCL 5 Printer Language Technical Reference Manual. LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT EcE Resets the Printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1 (black). Even though there is no physical pen, the SP command must be used to enable printing. PA1500,1500;PD; Specifies the starting position as (1500,1500) and puts the pen down. AR0,2000,80,25; Draws an arc with a center point 0 Plotter Units (PLU) in the X direction and 2000 PLU in the Y direction from (1500,1500). Then it specifies an arc section to be 80 degrees (positive angle), with a chord angle of 25 degrees. AR2000,0,80; Draws an arc with a center point 2000 PLU in the X direction and 0 PLU in the Y direction from the current pen position. Then specifies the arc section to be 80 degrees (positive angle), with a default chord angle of 5 degrees. Ec%0A Enters PCL mode. EcE Send a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ ----------------------- Using Edge Wedge (EW) with Pie Charts ========================================= The Edge Wedge ( EW ) command defines and edges a wedge using the current pen, line type and attributes to outline a wedge. When the command is completed the original pen location and up/down status of the pen are restored. For more information see the PCL 5 Printer Language Technical Reference Manual. LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT. EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1, (black). Even though there is no physical pen, the SP command must be used to enable printing. SC-3000,3000,-2000,2000,1; Enters the scaling mode, specifying P1 as (- 3000,-2000) and P2 as (3000),2000), using isotropic scaling. (Isotropic scaling means the X and Y units are the same size.) PA0,0; Specifies absolute plotting, then moves to (0,0). EW-1000,90,180; Draws a wedge section with a radius of 1000 user- units, a start angle of 90 degrees and a sweep angle of 180 degrees. The minus sign before the radius (-1000) sets the zero-degree reference point to the left side of the drawing. EW-1000,330,120; Using the same center point and zero-degree reference point this draws a second wedge section outline starting at 330 degrees and sweeps 120 degrees. PR-60,110; Moves the cursor 60 user-units to the left and 110 user-units up. EW-1000,270,60; From the new center point location, draws a wedge using a negative zero-reference point, starting at 270 degrees and sweeping for 60 degrees. Ec%0A Enters the PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ ------------- Using the Extra Space (ES) Command ========================================= The Extra Space command (ES), adjusts space between characters and lines of labels without affecting character size. For more information see the PCL 5 Printer Language Technical Reference Manual. The syntax for this command is as follows: ES width,[height]; or ES; Parameters Width Specifies an increase (positive number) or decrease (negative number) in the space between characters. Height Specifies an increase (positive number) or decrease (negative number) in the space between lines. Program LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT. EcE Resets the printer. Ec%0B Enters HP-GL/2 mode. IN; Initializes HP-GL/2 mode. SP1; Selects pen number 1, (black). Even though there is no physical pen, the SP command must be used to enable printing. PA2500,3200;SI.187,.269; Specifies absolute plotting and moves to (2500,3200); specifies a relative character size of .187 cm wide by .269 cm high. DT#;ES; Defines the "#" character as the label terminator and sets the extra space setting to default (no extra spaces). LBES; CAUSES#; Prints "ES; CAUSES". CP;LBTHIS SPACING.#; Sends a CP command with no parameters, which is equivalent to a Carriage Return and Line Feed; prints "THIS SPACING.". PA2500,2500; Moves to (2500,2500). ES-.1,-.25;LBES-.1,-.25; CAUSES#; Decreases the inter-character spacing by .1 and the inter-line spacing by .25; prints "ES-.1,-.25; CAUSES". CP;LBTHIS SPACING#; Sends a CP command with no parameters, which is equivalent to a Carriage Return and Line Feed; prints "THIS SPACING". PA2500,1800; Moves to (2500,1800). ES.2,.25;LBES.2,.25; CAUSES#; Increases the inter-character spacing by .2 and the inter-line spacing by .25. Then prints "ES.2,.25; CAUSES". CP;LBTHIS SPACING#; Sends a CP command with no parameters, which is equivalent to a Carriage Return and Line Feed. Then prints "THIS SPACING.". Ec%0A Enters PCL mode. EcE Sends a reset to end the job and eject the page. ------------------------------------------------------------------------------------------------ ---------------- Using the HP-GL/2 Scaling Command ========================================= WHAT IS SCALING? In HP-GL/2, the standard units of measure are plotter units (plu). These units are equal to 1016 units per inch. Scaling allows you, the user, define an easier value to use. You can define a coordinate system that uses 1 unit per inch, centimeter, millimeter or just a rounder number such as 100, 200, 500, or 1000 units per inch. Overall, scaling lets you define an easier to calculate coordinate system. LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT EcE Resets printer. Ec%0B Enters HP-GL/2 mode using the default picture frame size and anchor point. IN; Initializes HP-GL/2 mode. IP0,0,2000,2000; Sets P1 to (0,0) and P2 to (2000,2000). SC0,10,0,10; Sets up user-unit scaling to range from (0,0) to (10,10). SP1; Selects pen number 1. Even though there is no physical pen, the SP command must be used to enable printing. PA5,5; Begins absolute plotting from the center of the square (5,5). CI3; Prints a circle with a radius of 3 user-units. IP2500,500,3500,1500; Inputs a new P1 and P2 position for printing a smaller circle. PA5,5; Begins absolute plotting from the center of the new square (5,5). CI3; Prints the second circle with a radius of 3 user-units. Ec%0A Enters PCL Mode. EcE Resets the printer to complete the job and eject the page. ========================================================= ================