LEGEND: Ec = [Ctrl] [P] [Esc] in DOS EDIT This example shows how to create a rectangle, and a fill pattern in PCL. Then it explains how to put them together, making a filled rectangle with solid sides. This example is listed in three parts, but will all print on a single page showing each part of the rectangle. First it shows how to draw a box, second it shows how to shade a rectangular area, lastly it shows how to fill a box with a shading pattern. DRAW THE TOP BOX This portion of the sequence shows how to draw a rectangle using other rectangles as sides. This will make the sides of the rectangle black. Remember if you use this example by itself, you must send the command to exit out of HP-GL/2 mode and reset the printer to eject the page. EcE Resets the printer. Ec*p900x600Y Moves the cursor 900 dots (3 inches at 300 dpi) in from the left margin, and 600 dots (2 inches at 300 dpi) down from the top margin. Ec*c600a6b0P Using the print model commands for rectangle dimensions, "600a" specifies a rectangle with a horizontal size or width of 600 dots, and "6b" specifies a vertical size or height of 6 dots. The 0P selects the solid black rectangular area fill. Ec*c6a600b0P Specifies a rectangle with width of 6 dots, height of 600 dots, and a fill pattern of solid black. Ec*p900x1200Y Moves the current cursor position to 900 dots, from the left margin and 1200 dots down from the top margin. Ec*c606a6b0P Specifies a rectangle with a width of 606 dots, a height of 6 dots and a fill pattern of solid black. Ec*p1500x600Y Moves the current cursor position to 1500 dots from the left margin and 600 dots down from the top margin. Ec*c6a600b0P Specifies a rectangle with a width of 6 dots, a height of 600 dots and a fill pattern of solid black. DRAW THE SHADING This portion shows how to select a shading pattern for the rectangle. If shading is done by itself the sides of the rectangle will appear with the same fill pattern as the one used to fill it. If this example is used alone, the commands to enter HP-GL/2 mode must be used to toggle the printer into HP-GL/2 mode, also remember to send the command to exit out of HP-GL/2 mode and eject the page with a printer reset. Ec*p900x1350Y Moves the cursor 900 dots from the left margin and 1350 dots down from the top margin. Ec*t300R Sets the raster resolution to 300 dpi. Ec*c15G Sets the shading of the rectangular area fill to 15 percent. Ec*c600a600b2P Specifies a rectangle with a width of 600 dots, a height of 600 dots and a shaded fill pattern, using a specific shading pattern, which was specified above with the "Ec*c15G" command. BRING THE TWO RECTANGLES TOGETHER The following sequence can be used by itself to perform the two parts listed above. This can be used as a complete example of a rectangle with shaded fill pattern. If this example is used alone, the commands to enter HP-GL/2 mode must be used, to toggle the printer into HP-GL/2 mode. Ec*p900x2100Y Moves the cursor 900 dots from the left margin and 2100 dots from the top margin. Ec*c600a6b0P Specifies a rectangle with a width of 600 dots and a height of 6 dots and a fill pattern of black. Ec*c6a600b0P Specifies a rectangle with a width of 6 dots and a height of 600 dots and a fill pattern of black. Ec*p900x2700Y Moves the cursor 900 dots from the left margin and 2700 dots from the top margin. Ec*c606a6b0P Specifies a rectangle with a width of 606 dots, a height of 6 dots and a fill pattern of black. Ec*p1500x2100Y Moves the cursor 1500 dots in from the left margin and 2100 dots down from the top margin. Ec*c6a600b0P Specifies a rectangle with a width of 6 dots, a height of 600 dots and a fill pattern of black. Ec*p900x2100Y Moves the cursor 900 dots form the left margin and 2100 dots down from the top margin. Ec*t300R Sets the raster resolution to 300 dpi. (This command is only needed if this last section is used alone. The raster resolution for this plot was already selected in the section above.) Ec*c15G Sets the shading of the rectangular area fill to 15 percent. (This command is only needed if this last section is used alone. The fill pattern was set in the section above.) Ec*c600a600b2P Specifies a rectangle with a width of 600 dots, a height of 600 dots and a fill pattern using shading. EcE Resets the printer to end the job and eject the page. Note: When using the last section alone, "Bringing the two rectangles together," you must also add the commands that specify the raster resolution and the percentage of shading before using this last command for the fill pattern shading. Copyright Hewlett-Packard Co. 1993 The information contained herein is subject to change without notice. Hewlett-Packard shall not be liable for incidental or consequential damages in connection with the use of this material.
Questions: