HP PCL Code Samples
116 HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide
14.0 HP PCL Code Samples
The following pages contain PCL code samples that are intended to address some of the most
commonly asked support questions. Key among these questions are coding general page for-
matting, 4-plane color graphics, and using Configure Raster Data (CRD).
14.1 Page Formatting Program Example
The following example is old, but covers the essential page formatting commands. While
there is no one best way to write a page formatting program, you can use this example as a
starting point. When performed in the order given, the set of commands prints the output
shown in the figure at the end of the example.
The example assumes the following formatting objectives:
44
Select US Letter size paper
44
Select portrait page orientation
44
Set
3
/4 in. top, left, and right margins
44
Set 1
1
/4 in. bottom margin
44
Establish a header centered approximately in the middle of the top margin
44
Establish a footer
5
/8 inch from the bottom of the paper
44
Set line spacing at 8 lpi
44
Use Letter Gothic and CG Times typefaces
No assumption is made as to the status of the configuration switches.
Command Line,
Action Command Comment
Reset Printer Esc E Returns the printer to its default
settings.
* Set Paper Size Esc & l 2 A Selects U.S. Letter size paper 8 1/2
X 11 in.
* Set Portrait
Orientation
Esc & l 0 O
Enable Perforation
Skip Mode
Esc
& l 1 L Default top margin is 1/2 in.
Set Line Spacing Esc & l 8 D 8 lpi is used for page length and
margin calculations.
Specify Page Length Esc & l 88 P 11 in. X 8 lpi = 88 lines
Set Top Margin Esc & l 6 E 3/4 in. margin X 8 lpi = 6 lines
!