HP Deskjet 600 User Manual

HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide
Hewlett-Packard Vancouver Site
To aid in HP PCL printer driver development for HP DeskJet 600/700/800/900 & HP 2000 Series printers
1.0 Preface and Printing History
The information contained in this document is subject to change without notice.
Hewlett-Packard makes no warranty of any kind with regard to this material, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose.
Hewlett-Packard shall not be liable for errors contained herein or for incidental or consequen­tial damages in connection with the furnishing, performance, or use of this material.
This document may not be photocopied, reproduced, modified, or translated without prior con­sent of Hewlett-Packard Company.
Printing History
Edition 1 September 1995 Edition 2 March 1996 Edition 3 May 1996 Edition 4 May 1997 Edition 5 October 1997 Edition 6 December 1999, Edition 6.1 September 2001
© Copyright 1995, 1996, 1997, 1998, 1999, 2001 by Hewlett-Packard Company
18110 S.E. 34th Street, Vancouver, WA 98683, USA
2 HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide
About this Developer’s Guide
2.0 About this Developer’s Guide
2.1 Which printers are covered by this guide
Throughout this HP PCL Developer’s Guide you will see printer names referenced. Here is a list of actual names and the “Series” names used throughout this guide.
2.1.1 HP DeskJet 600 Series: 630C*, 640C*, and 656C*
HP DeskJet 600 - HP DeskJet 600, HP DeskJet 600C HP DeskJet 610C - HP DeskJet 610C, HP DeskJet 610CL, HP DeskJet 612C HP DeskJet 660C - HP DeskJet 660C, HP DeskJet 660Cse HP DeskJet 670C - HP DeskJet 670C, HP DeskJet 670TV, HP DeskJet 672C HP DeskJet 680C - HP DeskJet 680C, HP DeskJet 682C HP DeskJet 690C - HP DeskJet 690C, HP DeskJet 692C, HP DeskJet 693C,
HP DeskJet 694C
HP DeskJet 695C - HP DeskJet 695C, HP DeskJet 695Cci, HP DeskJet 697C
2.1.2 HP DeskJet 800 Series: 840C*
HP DeskJet 810C - HP DeskJet 810C, HP DeskJet 812C, HP DeskJet 815C HP DeskJet 830C - HP DeskJet 830C HP DeskJet 850C - HP DeskJet 850C, HP DeskJet 855C, HP DeskJet 855Cse,
HP DeskJet 855Cxi
HP DeskJet 870C - HP DeskJet 870Cse, HP DeskJet 870Cxi HP DeskJet 880C - HP DeskJet 880C, HP DeskJet 882C HP DeskJet 890C - HP DeskJet 890C, HP DeskJet 890Cse, HP DeskJet 890Cxi,
HP DeskJet 890CM
HP DeskJet 895C - HP DeskJet 895Cse, HP DeskJet 895Cxi
1
2.1.3 HP DeskJet 900 Series: 920C*, 940C*, 960C*, 980C*, and 990C*
HP DeskJet 930C, 950C, and 970C - HP DeskJet 930Cxi, 950Cxi, and 970Cxi
2.1.4 HP 2000C Series
HP 2000C - HP 2000C, HP 2000CN, HP 2000Cse, HP 2000Cxi
1. HP DeskJet 710C, 712, HP DeskJet 720C, 722C, and HP DeskJet 820Cse, 820Cxi printers are “Windows” printers. See Section 2.2.1 “Special Note” regarding these printers. * Product will appear in December 2001 revision
HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide 3
About this Developer’s Guide
2.2 Special Notes
44
HP DeskJets were designed in series - the printer’s internal firmware will usually report the series name, rather than the specific product name. All printers in a series will behave as the base model. For example, the HP DeskJet 810C Series printers were sold under the name of the HP DeskJet 810C, HP DeskJet 812C, and the HP DeskJet 815C. All three printer models have the same internal firmware, reporting the printer as a HP DeskJet 810C.
Note that the HP DeskJet 895Cse and HP DeskJet 895Cxi are both part of the HP Desk­Jet 895C Series family and are NOT derived from the HP DeskJet 890C Series.
44
If a command is not covered in this guide, it is either obsolete or Hewlett-Packard propri­etary information. No further information on these unsupported or proprietary commands is available.
44
In the HP PCL escape sequences within this manual, the letter “ell” (l) is represented by a script character (l ) to differentiate between the “ell” and the character 1 (one). Where spaces have been added to commands for readability, those spaces must not be included in your code.
44
Specifications on the ink cartridges (including the HP Photo Cartridge) are not available ­this is Hewlett-Packard proprietary information and will not be provided.
2.2.1 Special Note - HP DeskJet 710C, 720C and 820C Series printers
44
The HP DeskJet 710C, 720C, and 820C Series printers are “Windows” printers. These printers will not function from a DOS-only environment. However, they will work when accessed from a DOS box within Windows 3.1x, 95, 98.
For clarity, these printers are not included in the printer tables in this guide. If you wish to send PCL commands to these printers, use the HP DeskJet 660C Series printers as your guide in the tables.
4 HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide
Table of Contents
3.0 Table of Contents
1.0 Preface and Printing History2
2.0 About this Developer’s Guide3
2.1 Which printers are covered by this guide3
2.1.1 HP DeskJet 600 Series3
2.1.2 HP DeskJet 800 Series3
2.1.3 HP DeskJet 900 Series3
2.1.4 HP 2000C Series3
2.2 Special Notes4
2.2.1 Special Note - HP DeskJet 710C, 720C and 820C Series
3.0 Table of Contents5
4.0 How This Developer’s Guide Works10
4.0.1 Page Length10
4.0.2 The Command Description Page10
4.0.3 Command Name10
4.0.4 Escape Sequence11
4.0.5 Command Summary11
4.0.6 Command Usage Table11
4.0.7 Command Options11
4.0.8 Command Option Recognition Grid11
4.0.9 Effect of Command Options11
4.0.10 Detailed Command Description12
4.0.11 Important Point12
printers4
5.0 Introduction to HP PCL13
5.1 History of HP PCL Printer Language13
5.1.1 What are Printer Commands?13
5.1.2 Control Codes13
5.1.3 HP PCL Commands13
5.2 Syntax of Escape Sequences14
5.2.1 Two-Character Escape Sequences14
5.2.2 Parameterized Escape Sequences14
6.0 The Page17
6.1 Logical Page, Physical Page17
6.2 Page Layout18
6.2.1 Current Active Position (CAP)18
6.2.2 CAP Reference Point19
7.0 The Print Environment20
8.0 Merged Text and Graphics21
9.0 Programming Hints22
HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide 5
Table of Contents
9.0.1 Follow Specifications22
9.0.2 Leverage from Previous Programs22
9.0.3 Priority of Feature Set Commands22
9.0.4 Priority of Commands23
9.0.5 Time Savers23
10.0 HP PCL Commands25
10.1 Control Codes and Special Character Codes25
10.1.1 Escape25
10.2 Testing Commands25
10.3 Print Modes25
10.3.1 Transparent Data Mode25
10.3.2 Display Functions Mode ON26
10.3.3 Display Functions Mode OFF26
10.4 Text Enhancements27
10.4.1 Enable Underline27
10.4.2 Disable Underline28
10.4.3 Line Termination28
10.4.4 End-of-Line Wrap29
10.5 Job Control30
10.5.1 Reset30
10.6 Printer Control31
10.6.1 Gray Balance31
10.6.2 Dry Timer32
10.6.3 Print Quality33
10.6.4 Media Type34
10.6.5 Unit of Measure34
10.7 Printer Diagnostics36
10.7.1 Self-Test36
10.8 Page Control37
10.8.1 Page Length37
10.8.2 Page Size38
10.8.3 Media Source40
10.8.4 Orientation41
10.8.5 Horizontal Motion Index42
10.8.6 Vertical Motion Index43
10.8.7 Line Spacing44
10.8.8 Clear Horizontal Margins44
10.8.9 Left Margin45
10.8.10 Right Margin45
10.8.11 Top Margin46
10.8.12 Text Length47
10.8.13 Perforation Skip Mode47
10.9 Horizontal Positioning Commands49
10.9.1 Backspace49
10.9.2 Carriage Return49
10.9.3 Space49
10.9.4 Linefeed49
6 HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide
Table of Contents
10.9.5 Formfeed50
10.9.6 Horizontal Tab50
10.9.7 Move CAP Horizontal (Decipoints)51
10.9.8 Move CAP Horizontal (Columns)52
10.9.9 Move CAP Horizontal (HP PCL Units)52
10.10 Vertical Positioning Commands54
10.10.1 Move CAP Vertical (Rows)54
10.10.2 Move CAP Vertical (Decipoints)55
10.10.3 Move CAP Vertical (HP PCL Units)56
10.11 Font Selection57
10.11.1 Font Selection by Attribute57
10.11.2 Font Symbol Set57
10.11.3 Font Spacing60
10.11.4 Font Pitch60
10.11.5 Font Height61
10.11.6 Font Style62
10.11.7 Font Stroke Weight64
10.11.8 Font Selection by ID65
10.12 Downloading Fonts66
10.12.1 Font ID66
10.12.2 Download Font67
10.12.3 Character Code68
10.12.4 Download Character68
10.12.5 Font Control69
10.13 Raster Graphics70
10.13.1 Raster Mode70
10.13.2 Commands Locked Out of Raster Mode70
10.13.3 Commands Allowed in Raster Mode70
10.13.4 Start Raster71
10.13.5 End Raster71
10.13.6 Raster Resolution72
10.13.7 Source Raster Width73
10.13.8 Y Offset74
10.14 Raster Data Transfer75
10.14.1 Transfer Raster by Plane75
10.14.2 Transfer Raster by Row/Block76
10.15 Raster Compression77
10.15.1 Compression Method77
10.16Color84
10.16.1 Simple Color84
10.16.2 Foreground Color87
11.0 Fonts90
11.1 Standard Bitmap Font Definition90
11.2 Resolution-Specified Bitmap Font Definition91
11.2.1 Font Descriptor Size (UINT)92
11.2.2 Descriptor Format (UBYTE)92
11.2.3 Symbol Set Type (UBYTE)92
HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide 7
Table of Contents
11.2.4 Font Type (UBYTE)93
11.2.5 Style MSB (UINT)93
11.2.6 Baseline Position (UINT)94
11.2.7 Cell Width (UINT)94
11.2.8 Cell Height (UINT)94
11.2.9 Orientation (UBYTE)94
11.2.10 Spacing (BOOL)95
11.2.11 Symbol Set (UINT)95
11.2.12 Character Set (UINT16)95
11.2.13 Pitch (UINT)95
11.2.14 Height (UINT)96
11.2.15 xHeight (UINT)96
11.2.16 Width Type (SBYTE)96
11.2.17 Style LSB (UBYTE)96
11.2.18 Stroke Weight (SBYTE)96
11.2.19 Typeface [LSB/MSB] (UBYTE)97
11.2.20 Serif Style (UBYTE)98
11.2.21 Quality98
11.2.22 Placement99
11.2.23 Underline Position (SBYTE)99
11.2.24 Underline Thickness (UBYTE)99
11.2.25 Text Height (UINT)99
11.2.26 Text Width (UINT)99
11.2.27 First Code (UINT)100
11.2.28 Last Code/Number of Chars (UINT)100
11.2.29 Pitch Extended (UBYTE)100
11.2.30 Height Extended (UBYTE)100
11.2.31 Cap Height (UINT)101
11.2.32 Font Number (UINT)101
11.2.33 Font Name (ASC16)101
11.2.34 X Resolution (UINT)101
11.2.35 Y Resolution (UINT)101
11.2.36 Copyright102
11.2.37 Font Scaling Technology102
11.2.38 Segment Size102
11.3 Bitmap Resolution Segment103
11.3.1 X Resolution (UINT16)103
11.3.2 Y Resolution (UINT16)103
11.4 Character Enhancement Segment104
11.4.1 Style (UINT32)104
11.4.2 Stroke Weight (UINT32)104
11.4.3 Sizing (UINT16)105
11.5 Dual-Pitch-Space Char Segment106
11.5.1 Full-Width-Space Character Code106
11.5.2 Half-Width-Space Character Code106
12.0 HP LaserJet Bitmap Character Definition107
12.0.1 Format (UBYTE)107
12.0.2 Continuation (BOOL)108
8 HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide
Table of Contents
12.0.3 Descriptor Size (UBYTE)108
12.0.4 Class (UBYTE)108
12.0.5 Orientation (UBYTE)111
12.0.6 Left Offset (SINT)111
12.0.7 Top Offset (SINT)111
12.0.8 Character Width (UINT)111
12.0.9 Character Height (UINT)111
12.0.10 Delta X (SINT)112
12.0.11 Character Data112
13.0 Banner Printing113
13.0.1 Media Source113
13.0.2 Margins114
13.0.3 Command Sequence114
13.0.4 Moving to a New Logical Page114
13.0.5 Unloading Continuous Media114
13.0.6 Power-On with Continuous Media115
13.0.7 Power-Off with Continuous Media115
13.0.8 Printing Cutsheet with Z-Fold Media115
13.1 Sample HP PCL for a Banner Print Job115
14.0 HP PCL Code Samples116
14.1 Page Formatting Program Example116
14.2 Commands Sent to Printer118
14.3 3-Plane Color Graphics119
14.4 4-Plane Color Graphics120
15.0 Printer Commands122
16.0 Other Resources for Assistance124
16.1 HP Developer Exchange124
16.2 Comments & Feedback124
HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide 9
How This Developer’s Guide Works
4.0 How This Developer’s Guide Works
Below is a sample command description chart from this guide. On the following pages you can find descriptor names for the various parts of the graph.
A
4.0.1 Page Length
TABLE 1. Page Length - Esc & ll # P
E
F
#
Value
0 1 .. n
Default Range
G
DJ600
DJ610C
DJ660C
44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44
44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44
0 (66 lines per page) 1 to maximum supported paper size - Command is ignored for out of
range values
D
Designates the number of lines on the logical page at the current VMI (Vertical Motion Index) setting.
I
This command performs the following actions:
B
DJ670C
DJ680C
DJ690C
DJ695C
DJ810C
DJ830C
DJ850C
le Ch
44
Prints any unprinted pages.
44
Ejects the current page if printable data has been received (FF-CR).
44
Sets text length, top margin, left margin, and right margin to user defaults.
44
Moves CAP to the left edge of the logical page at the top of form.
Samp
The printer may select a different page size for the same line count, since lines are defined by the current VMI. This command is ignored if VMI is 0.
C
DJ870C
DJ880C
DJ890C
DJ895C
DJ970C
art Only!
H
HP2000C
Page length set to 66 lines Page length is set, in number of
lines, at the current lpi
EFFECT
4.0.2 The Command Description Page
Since some commands are not recognized by all HP DeskJet printers, or some family mem­bers do not recognize all options for a particular command, it is necessary to indicate which printers do respond to each command, and how each printer treats each command option.
4.0.3 Command Name
The Command Name is the name by which each command is referred to within the text of this guide, and by which the command is referenced in the index.
10 HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide
B
A
How This Developer’s Guide Works
4.0.4 Escape Sequence
This is the ASCII text version of the binary string, which causes the command to be invoked. The pound sign ("#") is used to represent where one of the command options, which are listed following the Command Summary, would be inserted.
4.0.5 Command Summary
A brief description of the purpose of a command is given. The Command Summary can be used to determine quickly if a particular command will perform the overall task you desire.
4.0.6 Command Usage Table
The Command Usage Table provides a quick key for the application of the available command options for each printer command. The column labeled "#Value" lists all options (also referred to as command parameters) for the command being discussed. The group of columns labeled with the model numbers of the HP DeskJet printers indicates which printers recognize each command option. The column labeled "Effect" briefly describes what result the use of each command option will have. The Command Usage Table is designed to let you quickly deter­mine if a particular command and a selected command option will be recognized by your tar­get printer, and what the effect of using that command and command option will be. The detailed command description can be carefully studied to gain a thorough understanding of the command once you determine if it is the one you want to use.
C
D
E
4.0.7 Command Options
All command options for a command are listed in the column of the Command Usage Table, which is labeled "Value". You should note that even though a particular member of the HP DeskJet printer family is indicated as recognizing a command, that printer may not recognize, and therefore not respond to, all listed command options.
4.0.8 Command Option Recognition Grid
This section of the table serves to quickly indicate which HP DeskJet printer models will recog­nize and respond to a particular command option. If a check mark ("44") appears under a par­ticular printer model in the row for a command option, that printer will recognize the option. If there is no check mark for a command option under a particular printer model number, that printer will not recognize or respond to that command option. If a command is used with an option the printer does not recognize, the results you obtain on your print media will be unpre­dictable; your printed page may not appear as you expect.
4.0.9 Effect of Command Options
The result of using the command with a given command option is briefly described. A detailed description of the impact of the command and its options are provided in the detailed com­mand description, which follows the Command Usage Table.
F
H
G
HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide 11
How This Developer’s Guide Works
!
4.0.10 Detailed Command Description
This is where all aspects of the command are explained. All details of the command and its usage are covered, including the effect of the command on the printer and the printing envi­ronments, all the command's options and the effect of each of those options, and any extended impact the command may have which you should be aware of.
4.0.11 Important Point
Where a blue exclamation point appears, special information that you should keep in mind is presented. (As a side note, if you print this document on a monochrome printer, the exclama- tion point will appear a dark gray.) This information may be of a cautionary nature, or it may be included in this emphasized format to point out special cases, which may apply for a com­mand. Any information noted in these areas should be read carefully before you use the asso­ciated command.
I
12 HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide
Introduction to HP PCL
!
5.0 Introduction to HP PCL
5.1 History of HP PCL Printer Language
Hewlett-Packard created the HP PCL Printer Language to provide an economical and efficient way for application programs to control a range of printer features across a number of printing devices. HP has evolved both the definition and implementations of the HP PCL printer lan­guage to provide the optimal price and performance balance. HP PCL 3 continues to lead with enhancements to the HP PCL printer language in order to deliver powerful technology advances.
The HP PCL printer language commands are compact escape sequence codes that are embedded in the print job data stream. This approach minimized both data transmission and command decode overhead. HP PCL printer language formatters and fonts are designed to quickly translate application output into high-quality, device-specific, raster print images.
HP PCL printer language commonality from HP printer to HP printer helps to minimize printer support problems and protect HP printer customer investment in applications and printer driver software.
5.1.1 What are Printer Commands?
HP PCL language printer commands provide access to printer features. There are two gen­eral types of HP PCL language commands:
44
Control codes
44
HP PCL commands
5.1.2 Control Codes
A control code is a character that initiates a printer function, for example Carriage Return (CR), Line Feed (LF), Form Feed (FF), etc.
5.1.3 HP PCL Commands
HP PCL commands provide access to the printer's HP PCL control structure. The HP PCL structure controls all of the printer's features.
HP PCL printer commands consist of two or more characters. The first character is always the ASCII escape character, identified by Esc. Esc is a special control code, which identifies the subsequent string of characters as a printer command. As the printer monitors incoming data from a computer, it is "looking" for this character. When this character appears, the printer reads it and the subsequent string of characters as a command to be performed and not as data to be printed.
HP PCL printer commands are also referred to as escape sequences. The two terms are used interchangeably throughout this manual.
HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide 13
Introduction to HP PCL
Once an HP PCL command sets a parameter, that parameter will remain set until that HP PCL command is repeated with a new value, the printer is reset to its user default environment, or another command makes a change. For example, if you send the printer a command to set line spacing to 3 lines/inch, each page will print 3 lines/inch until the printer receives a Line Spacing or VMI command or the printer is reset.
5.2 Syntax of Escape Sequences
There are two forms of HP PCL escape sequences: two-character escape sequences and parameterized escape sequences.
5.2.1 Two-Character Escape Sequences
Two-character escape sequences have the following form: Esc X Where "X" is a character that defines the operation to be performed. (Note, "X" may be any
character from the ASCII table within the range 48-126 decimal ["0" through "~"]). Following are examples of two- character escape sequences: Esc E a two-character escape sequence used for resetting the printer. Esc 9 a two-character escape sequence used for resetting the left and right margins.
5.2.2 Parameterized Escape Sequences
Parameterized escape sequences have the following form: Esc X y # z1 # z2 # z3 … # Zn[data] Where y, #, zi (z1, z2, z3… ) and [data] may be optional, depending on the command. X Parameterized Character - A character from the ASCII table within the range 33-47 deci-
mal ("!" through "/") indicating that the escape sequence is parameterized. y Group Character - A character from the ASCII table within the range 96-126 decimal (" ' "
through "~") which specifies the group type of control being performed. # Value Field - A group of characters specifying a numeric value. The numeric value is rep-
resented as an ASCII string of characters within the range 48-57 decimal ("0" through "9") that may be preceded by a + or - sign and may contain a fractional portion indicated by the digits after a decimal point (.). Numeric value fields are within the range -32767 to 32767. If an escape sequence requires a value field and a value is not specified, a value of zero is assumed.
14 HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide
Introduction to HP PCL
!
zi Parameter Character - Any character from the ASCII table within the range 96-126 deci­mal (" " " through "~"). This character specifies the parameter to which the previous value field applies. This character is used when combining escape sequences.
Zn Termination Character - Any character from the ASCII table within the range 64-96 deci­mal ("@" through "~”). This character specifies the parameter to which the previous value field applies. This character terminates the escape sequence and is always in the form of a capital letter, such as A, M, T, etc.
[Data] Binary Data is eight-bit data (for example, graphics data, downloaded fonts, etc.). The number of bytes of binary data is specified by the value field of the escape sequence. Binary data immediately follows the terminating character of the escape sequence.
Following is an example of an escape sequence with a termination character and no parame­ter character. This escape sequence performs a single function of logical page orientation in landscape mode.
Esc & l l 1 O
Escape
Character
Termination Character
Value
Parameterized
Field
Character
Group
Character
44
Some escape sequences shown in this manual contain spaces between characters for clarity. Do not include these spaces when using escape sequences.
44
Also, in the escape sequence a script "l” is used to indicate a lower case "l" for clarity.
The following is an example of two escape sequences, each of which perform one function: the first sets the logical page orientation to Portrait Mode, and the second sets the page size to 8 ½ x 11 inches.
Esc & l 0 O and Esc & l 2 A These two escape sequences can be combined into one escape sequence as follows:
HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide 15
Introduction to HP PCL
Esc & ll 1 o 2 A
Escape
Character
Parameterized
Character
Group
Character
Value
Parameter Character
Termination Character
Field
Value
Field
Notice that the "Esc" and the "&l" are dropped from the second printer command when they are combined. Also, the upper-case "O" that terminated the first command becomes a lower­case "o" parameter character when these commands are combined.
Use these three rules to combine and shorten printer commands:
44
The first two characters after "Esc" (the parameterized and group character) must be the same in all of the commands that will be combined. In the example above, these are "&" and "l".
44
All alphabetical characters within the combined printer command will be lower-case, except the final letter, which is always upper-case. In the combined example above, "O" becomes "o". The final character in the printer command must always be upper-case to let the printer know that the command is complete.
44
The printer commands are performed in the order that they are combined (from left to right). Be sure to combine commands in the order that they are to be performed.
16 HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide
The Page
Paper Size
6.0 The Page
6.1 Logical Page, Physical Page
The HP PCL printer language distinguishes between the physical page and the logical page. The physical page is the actual sheet of paper. Its size is determined by the size of the media installed in the printer. The logical page defines the addressable area in which the cursor can be positioned.
CAP (Current Active Position) refers to the "cursor" position on the logical page, similar to the cursor used on most computer terminals. The CAP location on the logical page is the next position where a character will be placed. CAP cannot be moved outside of the logical page bounds. The figure below shows the layout of the logical page.
The Logical Page
Top Margin
Left Margin
Text Length
Bottom Margin
Unprintable Region
Page
Page
Text Area
Page
Perf Skip Zone ­(1 inch)
Right Margin
Logical Page
Perf Skip Zone ­(1 inch)
HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide 17
The Page
6.2 Page Layout
Referring to the previous figure, each page passed through the printer has a number of com­ponents. Text printing is normally limited to a specific printable area within the logical page known as the text area. The text area is entirely contained by the logical page, but may be smaller because of margins. There are unprintable regions along the outside edges and bot­tom of each sheet of print media. If printing is attempted outside the printable area at the bot­tom of the sheet, data may be printed on the following sheet. If printing is attempted in the unprintable regions, formatting or data may be lost.
The perforation skip zone extends from the bottom of the text area on one page to the top of the text area on the next page. When the Perforation Skip Mode is turned ON, a Line Feed that would normally move CAP into the bottom margin of the current page instead moves CAP to the top of the text area on the next page. If the Perforation Skip Mode is turned OFF, a Line Feed that would move CAP into the bottom margin is allowed. If text printing is attempted within the unprintable region at the bottom of the page, a hardware page break occurs, the text is printed on the next sheet of print media, and then a software page break occurs. The result is an unplanned, extra page, which contains only that portion of the text which invaded the unprintable region.
Allow ½ inch at the bottom of the page. This extra ½ inch can mean a loss of 3 lines. For example, on an 11 inch page, the full-page length is 66 lines (6 lines per inch). However, the effective page length is 10 ½ inches, or 63 lines.
6.2.1 Current Active Position (CAP)
CAP is the position at which the next character will be printed on the page. This position can be moved to different points on the logical page using the cursor positioning commands. CAP cannot be moved outside the bounds of the logical page, except when moving to another logi­cal page.
CAP position (0,0) is at the left edge of the logical page at the current top margin position. Since the top margin can be changed using a printer command, the physical location of the
18 HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide
The Page
point (0,0) may change. The point (0,0) then, does not necessarily equate to the top of the paper.
CAP Position
(0,0)
X
Y
ABCD...
Logical Page
Portrait
Top Margin
(0,0)
Y
Top Margin
X
ABCD...
Logical Page
Landscape
6.2.2 CAP Reference Point
The first line starts at the (0,0) coordinate. CAP starts at (X,Y), where X= the left margin set­ting, and Y= the top margin setting. CAP is moved the distance of the Horizontal Motion Index to the right after printing a character and one dot row down after printing graphics. The physi­cal location of the (X,Y) coordinate can change due to the size of the first printed character.
Characters are placed with their reference points at CAP. The reference point is on the char­acter baseline, a horizontal line just under the bottom of the non-descending characters. This means that if the top margin is at the top of the logical page, text cannot be printed at (0,0) because most of the character would be above the top edge of the page.
Graphics, however, can be printed at (0,0) because they do not move above CAP. Graphics begin at the vertical level specified by CAP and then move downward on the page from that point.
HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide 19
The Print Environment
!
7.0 The Print Environment
The group of all the printer's current feature settings is collectively referred to as the print envi­ronment. Default settings refer to the settings the printer uses unless printer commands are used to select other settings. Default settings are settings that are programmed into the printer at the factory.
Each time a job is printed, some of the printer's feature settings may be changed from their default values to produce a desired output for that job. After the job has printed, the job spe­cific feature settings are no longer needed, since the next job will likely have different output requirements. The next job should clear all previous job settings by performing a reset. This allows a job to start with the default settings as a base and vary only those settings that are needed. Returning to the default environment at the beginning of each print job eliminates the need for setting every feature each time a job is run.
Starting your print job with the Reset command (Esc E) is the recommended procedure, since the escape sequence resets all programmable features to their default values.
20 HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide
Merged Text and Graphics
!
8.0 Merged Text and Graphics
The process for merging text and graphics with the HP DeskJet 600/800/900 & HP 2000 Series printers in both portrait and landscape orientation is the same as the landscape orienta­tion method for the HP DeskJet 520, 540, 550C, and 560C Series printers, described in the HP DeskJet 500 Series Technical Reference Guide. The HP DeskJet 600/800/900 & HP 2000 Series printers are capable of buffering an entire page of text in either portrait or land­scape orientation. This capability dramatically simplifies the procedure for merging text and graphics.
As with the landscape orientation method for the HP DeskJet 520, 540, 550C, and 560C Series printers, when merging text and graphics for the HP DeskJet 600/800/900 & HP 2000 Series printers, the text for the entire page is first sent to the printer (without a Form Feed com­mand), where it is stored in the printer’s formatting buffer. Following the transmission of the text, the CAP is moved to the graphics starting position with cursor positioning commands. The graphics data for the page is then sent to the printer, and the page is printed as the graph­ics data is processed by the printer firmware.
It is important to note that once graphics data has been received for any particular raster row on the page, no text can be printed at that or any earlier position. You should not attempt to alter this procedure, for instance by sending a partial page of text, a partial page of graphics, then resuming with text transmission. Even if you do not violate the rule of sending text for a line (or preceding a line) where graphics data has been received, attempting to intermix the transmission of text and graphics data for a given page will render unpredictable results. Send all text for an entire page, then send all graphics data.
Follow the last of the graphics data with a Form Feed command, which will cause any remain­ing text data for the page to be printed, then proceed to the next page.
If you are modifying an existing DeskJet 500 Series printer driver, which has correctly implemented the merging of text and graphics in the past, to include other features for the HP DeskJet 600/800/900 & HP 2000 Series printers, you need not re-write your old driver. Add support for the new features to existing code, being careful to consider the impact of old, obsolete commands. However, if you are just beginning development, or you intend to add merged text and graphics capabilities for the HP DeskJet 600/800/900 & HP 2000 Series printers, you should begin with the algorithm provided above.
Be aware that highly complex pages, those with numerous font changes or cursor reposition­ing accompanying dense and complex graphics, may cause overflow condition with the printer buffer. If you encounter this problem, you may be able to remove some of the font or position changes in order to reduce the complexity of the page description.
HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide 21
Programming Hints
9.0 Programming Hints
The following are overall guidelines to keep in mind when programming with HP PCL printer language commands.
9.0.1 Follow Specifications
Follow the specifications for HP PCL printer language commands as described in this guide. Do not rely upon undocumented workarounds. For example, the HP DeskJet 500 Series print­ers do not allow a negative vertical cursor movement of more than 1/3 inch. While it is possi­ble to create a workaround, the solution may produce undesirable results, as the printer paper­movement hardware is not designed to provide negative paper motion. Additionally, the homemade solution that works today may not work with future printer models.
9.0.2 Leverage from Previous Programs
If you have previously used HP PCL commands to create printer programs, you may be able use most of those same commands for the HP DeskJet 600/800/900 & HP 2000 Series print­ers. This is especially true if you have programmed for other HP DeskJet printers. Reusing previously developed code can save you a significant amount of time since you do not have to start a development effort from scratch.
When leveraging from previous programs, keep in mind that the HP DeskJet 600/800/900 & HP 2000 Series printers have a number of important differences from the HP LaserJet family printer.
44
HP DeskJet 600/800/900 & HP 2000 Series printers are line oriented, whereas HP Laser­Jet printers are page oriented. The HP LaserJet printers format the entire page in internal memory and then the entire page is printed, whereas the HP DeskJet 600/800/900 & HP 2000 Series printers format and print consecutive horizontal lines of text or rows of graph­ics of the page content, one after another, until the entire page has been printed.
44
HP LaserJet printers have full-page printing capability and can position the cursor any­where on the page. HP DeskJet 600/800/900 & HP 2000 Series printers format from the top of the page to the bottom.
44
Generally, HP DeskJet 600/800/900 & HP 2000 Series printer commands sent to the HP LaserJet printer will provide the expected printing results, but may not work as efficiently. Not all HP DeskJet 600/800/900 & HP 2000 Series commands will work with HP LaserJet printers.
9.0.3 Priority of Feature Set Commands
Printer features for the HP DeskJet 600/800/900 & HP 2000 Series printers are controlled by escape sequences and control codes. Software application commands override default set­tings. However, when the printer is reset, either by turning the printer off and then on again or by sending the Reset escape sequence (Esc E), the printer returns to the default settings.
22 HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide
Programming Hints
9.0.4 Priority of Commands
There are no finite rules when it comes to structuring your overall program. In general, start by setting the print environment with the printer control commands, such as Reset, Selecting the Media Source, and so on.
It is almost always advisable to start and end your program with the reset command (Esc E). This clears the printer environment and places your program back to the default settings. An exception to this general rule is when the printer settings are intended to carry across a multi­component print job.
Where specified in this manual, pay close attention to the order of commands. For example, raster graphics commands should be sent to the printer in the following order:
44
End Raster Graphics
44
Raster Graphics Resolution
44
Raster Graphics Width
44
Raster Graphics Compression Method
44
Start Raster Graphics
44
Transfer Raster Graphics Row(s) with or without Relative Vertical Pixel Movement
44
End Raster Graphics
9.0.5 Time Savers
The following list provides some helpful hints to make your program more efficient:
44
You do not need to specify leading and trailing zeroes. The HP DeskJet 600/800/900 & HP 2000 Series printers will compensate if you do not include zeros that occur at the end of an escape sequence. For example, if you want to specify 10 pitch during a font selec­tion sequence, simply specify 10, rather than 0010.00.
44
Group printer control commands at the beginning of a print job. If a number of consecu­tive pages within a job have the same format (such as margins, HMI, VMI, etc.), the asso­ciated page formatting commands only need to be set once for that group of pages.
44
Combine escape sequences where possible. Shortening commands improves through­put. For example, instead of sending the Page Length command (Esc & l # P) and the Top Margin command (Esc & l # E) separately, send them as one parameterized escape sequence (Esc & l # p # E). Follow the guidelines for parameterized escape sequences, which are described earlier in this chapter.
44
Minimize escape sequences where possible. For example, if you wish to move the cursor two inches down the page, use one cursor movement command, rather than move the cursor by decipoints or dots a number of times.
44
You do not need to send a request to load paper. However, you do need to specify enve­lope size and send a Media Source command to load envelopes.
44
Avoid using tabs to move the cursor across the page. Using tabs may make you depen­dent upon the current font pitch. Instead, use cursor positioning commands.
HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide 23
Programming Hints
44
Avoid using a Start Raster Graphics and End Raster Graphics command on every line. Use these commands at the beginning and end of the graphics image.
44
When setting the raster graphics width, calculate the widest point of the raster image. Use this value to set the width once for the entire raster graphics image.
44
Avoid setting top margin or text length to values outside of the printable area. This may cause data loss.
When using both the top margin and text length commands, the top margin command should be sent before the text length command
24 HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide
HP PCL Commands
10.0 HP PCL Commands
10.1 Control Codes and Special Character Codes
The following commands initiate printer control functions:
10.1.1 Escape
Provides supplementary control of printer functions. The escape character itself is a prefix for the string of one or more characters that follow. Once an escape character is received by the printer, normal text processing is suspended, and the contents of the print data stream are interpreted as a printer command, until the command has been activated by a command termi­nation character, or the escape sequence has been determined to be invalid.
10.2 Testing Commands
Transparent Data Mode, and Display Functions modes (both of them) are used for testing pur­poses, to allow you to print the actual setup strings rather than having HP PCL actually inter­pret and execute them.
You can use either Print Modes -or- the Display Functions Mode On and Off commands ­whichever is more intuitive in your programming environment.
10.3 Print Modes
10.3.1 Transparent Data Mode
TABLE 2. Transparent Data Mode - Esc & p # X
#
DJ600
DJ610C
DJ660C
DJ670C
DJ680C
DJ690C
DJ695C
DJ810C
DJ830C
DJ850C
DJ870C
DJ880C
DJ890C
DJ895C
Value
1 . . n
Default Range
44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44
n/a 0 to 32767 - command is ignored for out of range values
Prints the graphic symbols associated with hidden control code characters. All subsequent character codes, for the specified number of bytes, are printed with the current
font attributes. The parser ignores all control codes, including the Esc character. Instead, the code’s graphic symbol in the current symbol set is printed. For example, in the PC-8 symbol set, Esc is printed as a left arrow.
DJ970C
HP2000C
Prints all data rather than execut­ing it.
EFFECT
HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide 25
HP PCL Commands
10.3.2 Display Functions Mode ON
TABLE 3. Display Functions Mode ON - Esc Y
#
DJ600
DJ610C
DJ660C
DJ670C
DJ680C
DJ690C
DJ695C
DJ810C
DJ830C
DJ850C
DJ870C
DJ880C
Value
1 . . n Default
44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44
off
This command turns on Display Functions Mode; a character code is then printed in the cur­rent active font.
Turning Display Functions mode ON has the following effects:
44
All control code and escape sequence functions except CR and Esc Z are disabled. CR marks the paper and executes CR-LF. Esc Z marks the paper and disables Display Func­tions Mode.
44
All character codes, except CR and Esc Z, either mark the paper or produce a blank space.
DJ890C
DJ895C
DJ970C
HP2000C
Display Functions turned on
EFFECT
The exact implementation may vary between products. This mode is intended as a program­mer’s debugging aid, and is not to be used for document preparation.
10.3.3 Display Functions Mode OFF
TABLE 4. Display Functions Mode OFF - Esc Z
#
DJ600
DJ610C
DJ660C
DJ670C
DJ680C
DJ690C
DJ695C
DJ810C
DJ830C
DJ850C
DJ870C
DJ880C
Value
1 . . n Default
44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44
off
This command turns Display Functions Mode OFF. If Display Function Mode is ON when Esc Z is received, the characters for the next sequence are printed, and Display Function Mode is disabled. If Display Function Mode is OFF when Esc Z is received, no operation is performed.
DJ890C
DJ895C
DJ970C
HP2000C
Display Functions turned off
EFFECT
26 HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide
HP PCL Commands
!
10.4 Text Enhancements
10.4.1 Enable Underline
TABLE 5. Enable Underline - Esc & d # D
#
DJ600
DJ610C
DJ660C
DJ670C
DJ680C
DJ690C
DJ695C
DJ810C
DJ830C
DJ850C
DJ870C
DJ880C
Value
0 1
2
3
4
Default Range
44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44
44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44
44 44 44 44 44 44 44 44 44 44 44 44 44
44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44
44 44 44 44 44 44 44 44 44 44 44 44 44
off 0 to 4 - (default is selected for values >4 or <0)
DJ890C
DJ895C
DJ970C
HP2000C
Default - single underline Single underline, fixed location
below the baseline Double underline, fixed location
below the baseline Single underline, font
dependent (“floating”) location Double underline, font
dependent (“floating”) location
EFFECT
Enables the automatic underline enhancement.
This command must use a capital “D” as a terminator.
Except when changing the left margin causes positive horizontal CAP movement, when underlining is enabled, each printed character or any positive horizontal motion (e.g., spaces, CAP moves) is automatically underlined.
Once enabled, underline remains enabled until explicitly disabled. The default state is under­line disabled.
A single underline is produced if double underline is invoked but unavailable, as in the case of the DeskJet 850/870/890 Series printers.
When fixed location underlining is enabled, the underline is drawn a fixed, device-dependent distance below the baseline. When floating location underlining is enabled, the greatest under­line distance specified in all of the fonts printed on the current line determines where the underline is positioned. The underline distance and height is defined in the font descriptor.
In the HP DeskJet implementation of “floating” underline, each font defines the thickness of the underline character and its position relative to the baseline.
HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide 27
HP PCL Commands
!
With HP DeskJet 500 Series printers, if underlining is enabled and changing the left mar­gin causes a positive horizontal cursor movement, the move is underlined. With HP Desk­Jet 600/800/900 & HP 2000 Series printers, the move is not underlined.
HP DeskJet 500 Series printers use a value (#) of 255 to disable underlining. HP DeskJet 600/800/900 & HP 2000 Series printers select Default for values over 4 or below 0.
10.4.2 Disable Underline
TABLE 6. Disable Underline - Esc & d @
#
DJ600
DJ610C
DJ660C
DJ670C
DJ680C
DJ690C
DJ695C
DJ810C
DJ830C
DJ850C
DJ870C
DJ880C
Value
n/a
44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44
DJ890C
DJ895C
DJ970C
HP2000C
Underlining is OFF
EFFECT
Disables automatic text underlining.
10.4.3 Line Termination
TABLE 7. Line Termination - Esc & k # G
#
DJ600
DJ610C
DJ660C
DJ670C
DJ680C
DJ690C
DJ695C
DJ810C
DJ830C
DJ850C
DJ870C
DJ880C
Value
0 1 2
3
Default Range
44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44
44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44
44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44
44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44
0 0 to 3 - Command is ignored for out of range values
This command controls how the printer interprets CR (Carriage Return), LF (Line Feed), and FF (Form Feed) control characters. For example, a value field of 1 causes the printer to exe­cute a carriage return (CR) and linefeed (LF) for every CR received. A linefeed or formfeed is sent as is.
DJ890C
DJ895C
DJ970C
HP2000C
CR = CR; LF = LF; FF = FF CR = CR, LF; LF = LF; FF = FF CR = CR; LF = CR, LF; FF =
CR, FF CR = CR, LF; LF = CR, LF; FF
= CR, FF
EFFECT
28 HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide
HP PCL Commands
10.4.4 End-of-Line Wrap
TABLE 8. End-of-Line Wrap - Esc & s # C
#
DJ600
DJ610C
DJ660C
DJ670C
DJ680C
DJ690C
DJ695C
DJ810C
DJ830C
DJ850C
DJ870C
DJ880C
Value
0 1 Default Range
44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44
44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44
1 0 to 1 - Command is ignored for out of range values
Defines the action that occurs when a line of text reaches the right margin. When end-of-line wrap is enabled, a character or space that would move the CAP to the right
of the right margin causes a CR-LF to be executed (prior to the printing of the character or space).
DJ890C
DJ895C
DJ970C
HP2000C
Enables End-of-Line Wrap Disables End-of-Line Wrap
EFFECT
When end-of-line wrap is disabled, a character or space that would move CAP to the right of the right margin is not printed, and CAP is set to the right margin.
HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide 29
10.5 Job Control
10.5.1 Reset
Esc E
Performs a reset on the printer (this is NOT a hardware reset). The reset performs the follow­ing:
Prints all data received before the reset.
44
“Floats” CAP.
44
Resets all programmable features to their user default values.
44
Deletes temporary fonts.
44
Does not delete downloaded permanent features.
44
Resets the color palette to black and white.
Esc E has no effect on I/O and causes no disruption in host-to-peripheral communication. The printer remains on-line and no data is lost.
HP PCL Commands
Esc E should be the first command received at the beginning of a job (e.g., before font down­load) to establish default conditions; and it should be the last command at the end of a job to leave the machine in the user default state and clear any partially composed pages.
Esc E “floats” CAP on the current page if no printable data has been received; otherwise it ejects the current page and “floats” CAP on the next page.
CAP is floating prior to printable characters, or commands affecting CAP. (Commands affect­ing CAP are ASCII data, LF, CAP moves, space, etc.). Commands affecting top and left mar­gins, line spacing, page length, and orientation can change CAP while it is floating.
CAP is fixed following printable characters or commands affecting CAP. CAP is fixed to the left margin and top margin plus 3/4 VMI upon receipt of printable characters or raster graphics commands that explicitly move CAP fix it at the specified location. Commands changing the top and left margins or line spacing cannot affect a fixed CAP; page length or orientation com­mands eject the page, moving CAP to the top-of-form on the subsequent page. If no printable data is received, page length and orientation commands eject the page only if the device can­not move the paper back to the top of form. The intent is to not eject unnecessary blank pages.
Since control panel settings can override the factory defaults, Esc E uses the control panel settings as the default values.
The SPACE character is not considered a printable character with respect to CAP.
30 HP DeskJet 600, 700, 800, 900 & HP 2000 Series PCL Developer’s Guide
Loading...
+ 94 hidden pages