Hp escape / pcl koder

For mere end tre år siden

Generelt

Hewlett-Packard Laser og DeskJet printer escape koder
(Hewlett-Packard escape koderne omtales ogsåsom HPPCL, "HP Printer Code Language".

Nedenfor finder du en oversigt over koderne. HP har selv 2 "wizards" liggende. En til PCL5 og en til PCL3.

Der er to typer HPPCL escape koder:

  • 2-karakters escape koder, hvor anden byte ligger i området 48-126.
  • Escape koder med parametre:
    Anden byte
    Parameter-karakter i området 33-47
    !"#$%&'()*+,-./
    Tredie byte
    Gruppe karakter i området 96-126
    `abcdefghijklmnopqrstuvwxyz{|}~
    Værdi felt
    Decimale karakterer evt. med foranstillet "+" eller "-" kan indeholde decimaler. ingen værdi betyder 0.
    Parameter
    Karakter i området 96-126; specificerer hvordan værdi felt opfører sig; Virker som afsluttende karakter hvis den ligger i området 64-94.
    @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^
    Data (valgfri)
    Binære data; antallet af bytes specificeres i værdi feltet.

Nedenstående er en engelsksproget oversigt:

HPPCL, sorted by parameterized byte and terminating parameter

&a  #C      Cursor Horizontal Position - Columns
&a  0G      Page Side Selection Next Side
&a  1G      Page Side Selection Front Side
&a  2G      Page Side Selection Back Side
&a  #H      Cursor Horizontal Position - Decipoints
&a  #L      Job Margin Left column #
&a  #M      Job Margin Right column #
&a  0P      Job Character Rotate   0x
&a 90P      Job Character Rotate  90x
&a180P      Job Character Rotate 180x
&a270P      Job Character Rotate 270x
&a  #R      Cursor Vertical Position - Rows
&a  #V      Cursor Vertical Position - Decipoints
&d   @      Font Underline Off
&d   D      Font Underline Enable
&d  0D      Font Underline Enable Fixed
&d  1D      Font Underline Single Fixed
&d  2D      Font Underline Double Fixed
&d  3D      Font Underline Single Float
&d  4D      Font Underline Double Float
&f  0S      Macro Cursor Push position
&f  1S      Macro Cursor Pop position
&f  0X      Macro Start Definition
&f  1X      Macro Stop Definition
&f  2X      Macro Execute
&f  3X      Macro Call
&f  4X      Macro Enable Overlay #
&f  5X      Macro Disable Overlay #
&f  6X      Macro Delete All
&f  7X      Macro Delete All Temp
&f  8X      Macro Delete One Macro #
&f  9X      Macro Make Temp
&f 10X      Macro Make Permanent
&f  #Y      Macro Set New ID #
&k  0E      Job Line-by-Line Enhance ON
&k  1E      Job Line-by-Line Enhance OFF
&k  0F      Job Line-by-LIne SI/SO ON
&k  1F      Job Line-by-Line SI/SO OFF
&k  0G      Job Line Termination Normal
&k  1G      Job Line Termination CR=CR+LF
&k  2G      Job Line Termination LF=FF=CR+LF
&k  3G      Job Line Termination CR=LF=FF=CR+LF
&k  #H      Cursor Horizontal Motion Index #/120" incr.
&k  0S      Font Pitch 10.00
&k  2S      Font Pitch 16.66
&k  0W      Job Print Left to Right
&k  1W      Job Print Bidirectional
&k  2W      Job Print Right to Left
&k  5W      Job Print Text Scale OFF
&k  6W      Job Print Text Scale ON
&l  0A      Job Paper Default size
&l  1A      Job Paper Size Executive
&l  2A      Job Paper Size Letter
&l  3A      Job Paper Size Legal
&l 26A      Job Paper Size A4
&l 80A      Job Paper Size Monarch
&l 81A      Job Paper Size Commercial #10 envelope
&l 90A      Job Paper Size International DL envelope
&l 91A      Job Paper Size International C5 envelope
&l  #C      Cursor Vertical Motion Index #/48" incr.
&l  #D      Cursor Lines per inch # (1,2,3,4,6,8,12,16,24,48)
&l  #E      Job Margin Top # of lines
&l  #F      Job Margin Text Length # of lines
&l  1G      Job Paper Destination Upper Bin
&l  2G      Job Paper Destination Rear Bin
&l  0H      Job Paper Page Eject
&l  1H      Job Paper Source from Upper Tray
&l  2H      Job Paper Input Manual Feed from Tray
&l  3H      Job Paper Input Manual Feed Envelope
&l  4H      Job Paper Source from Lower Tray
&l  6H      Job Paper Envelope Feeder
&l  0L      Job Paper Perf Skip Off
&l  1L      Job Paper Perf Skip On
&l  0O      Job Page Orientation Portrait
&l  1O      Job Page Orientation Landscape
&l  2O      Job Page Orientation Reverse Portrait
&l  3O      Job Page Orientation Reverse Landscape
&l  #P      Job Page Length # of lines
&l  0S      Job Page Simplex
&l  1S      Job Page Duplex Long-Edge Binding
&l  2S      Job Page Duplex Short-Edge Binding
&l  1T      Job Separation
&l  #U      Job Margin Left Offset # in 1/720"
&l  #X      Job Paper Number of Copies (ESC,ESC,&l#X)
&l  #Z      Job Margin Top Offset # in 1/720"
&p  #X{data}Job Print Data Transparent # bytes
&s  0C      Cursor Line Wrap On
&s  1C      Cursor Line Wrap Off
(   #@      Font Primary Default ID #
(   0@      Font Primary Default CharSet
(   2@      Font Primary Current CharSet
(   3@      Font Primary Default Active
(   0A      Font Primary Math Symbol set
(   0B      Font Primary Line Draw Symbol set
(   0D      Font Primary ISO 60: Norway v.1
(   1D      Font Primary ISO 61: Norway v.2
(   0E      Font Primary HP Roman Extension
(   1E      Font Primary ISO UK
(   0F      Font Primary ISO 25: French
(   1F      Font Primary ISO 69: France
(   0G      Font Primary HP German
(   1G      Font Primary ISO 21: Germany
(   8G      Font Primary ISO HP Greek8
(   0I      Font Primary ISO 15: Italy
(   6J      Font Primary Microsoft Publishing
(   7J      Font Primary DeskTop
(  10J      Font Primary PS Text
(  13J      Font Primary Ventura International
(  14J      Font Primary Ventura US
(   0K      Font Primary ISO 14: JIS ASCII
(   1K      Font Primary ISO HP Katakana
(   2K      Font Primary ISO 57: Chinese
(   8K      Font Primary Kana-8 Symbol set
(   0L      Font Primary JIS Line Draw
(  10L      Font Primary PS ITC Zapf Dingbats
(  11L      Font Primary ITC Zapf Dingbats Series 100
(  12L      Font Primary ITC Zapf Dingbats Series 200
(  13L      Font Primary ITC Zapf Dingbats Series 300
(   0M      Font Primary JIS Math7
(   1M      Font Primary Technical
(   5M      Font Primary Technical PS Math
(   6M      Font Primary Technical Ventura Math
(   8M      Font Primary JIS Math8
(   0N      Font Primary ISO100: ECMA-94 Latin 1
(   0O      Font Primary OCR-A
(   1O      Font Primary OCR-B
(   0Q      Font Primary JIS Math8a
(   1Q      Font Primary JIS Math8b
(   2Q      Font Primary JIS PIFonta
(   0S      Font Primary ISO 11: Swedish
(   1S      Font Primary HP Spanish
(   2S      Font Primary ISO 17: Spain
(   3S      Font Primary ISO 10: Sweden: Names
(   4S      Font Primary ISO 16: Portugal
(   5S      Font Primary ISO 84: Portugal
(   6S      Font Primary ISO 85: Spanish
(   0U      Font Primary ISO  6: ASCII
(   1U      Font Primary JIS Legal
(   2U      Font Primary ISO  2: IRV
(   7U      Font Primary OEM-1
(   8U      Font Primary Roman 8 Symbol set
(   9U      Font Primary ANSI Symbol set
(  10U      Font Primary PC-8 symbol set
(  11U      Font Primary PC-8 Denmark/Norway
(  12U      Font Primary PC-8 50
(  15U      Font Primary JIS Pi Font
(   #X      Font Primary Download Select ID #
(s  0B      Font Primary Stroke Weight Normal
(s -7B      Primary Font Stroke Weight Ultra Thin
(s -6B      Primary Font Stroke Weight Extra Thin
(s -5B      Primary Font Stroke Weight Thin
(s -4B      Primary Font Stroke Weight Extra Light
(s -3B      Primary Font Stroke Weight Light
(s -2B      Primary Font Stroke Weight Demi Light
(s -1B      Primary Font Stroke Weight Semi Light
(s  0B      Primary Font Stroke Weight Medium (book or text)
(s  1B      Primary Font Stroke Weight Semi Bold
(s  2B      Primary Font Stroke Weight Demi Bold
(s  3B      Primary Font Stroke Weight Bold
(s  4B      Primary Font Stroke Weight Extra Bold
(s  5B      Primary Font Stroke Weight Black
(s  6B      Primary Font Stroke Weight Extra Black
(s  7B      Primary Font Stroke Weight Ultra Black
(s  #H      Font Primary Pitch  (10,12,16.66)
(s  0P      Font Primary Spacing Fixed
(s  1P      Font Primary Spacing Proportional
(s  1Q      Font Primary Draft Quality
(s  2Q      Font Primary Letter Quality
(s  0S      Font Primary Type Style: Upright
(s  1S      Font Primary Style Italic
(s  4S      Font Primary Style Condensed
(s  5S      Font Primary Style Condensed Italic
(s  8S      Font Primary Style Compressed (Extra Condensed)
(s 24S      Font Primary Style Expanded
(s 32S      Font Primary Style Outline
(s 64S      Font Primary Style Inline
(s128S      Font Primary Style Shadowed
(s160S      Font Primary Style Sutline Shadowed
(s  #T      Font Primary Typeface CG Times (#= 4101)
(s  #T      Font Primary Typeface Univers  (#= 4148)
(s  0T      Font Primary Typeface Line Printer
(s  1T      Font Primary Typeface Pica
(s  2T      Font Primary Typeface Elite
(s  3T      Font Primary Typeface Courier
(s  4T      Font Primary Typeface Helvetica
(s  5T      Font Primary Typeface Times Roman
(s  6T      Font Primary Typeface Gothic
(s  7T      Font Primary Typeface Script
(s  8T      Font Primary Typeface Prestige
(s 11T      Font Primary Typeface Presentations
(s 17T      Font Primary Typeface Optima
(s 18T      Font Primary Typeface ITC Garamond
(s 19T      Font Primary Typeface Cooper Black
(s 20T      Font Primary Typeface Coronet Bold
(s 21T      Font Primary Typeface Broadway
(s 22T      Font Primary Typeface Bodini Condensed
(s 23T      Font Primary Typeface Century School
(s 24T      Font Primary University Roman
(s 32T      Font Primary Typeface Brush
(s 61T      Font Primary Typeface Dom Casual
(s 85T      Font Primary Typeface Univers Conden.
(s  0U      Font Primary Typeface Normal
(s +1U      Font Primary Super
(s -1U      Font Primary Sub
(s  #V      Font Primary Character Height # of 1/72"
(s  #W{data}Font Download Character # Bytes
)   #@      Font Secondary Default ID #
)   0@      Font Secondary Default CharSet
)   2@      Font Secondary Current CharSet
)   2@      Font Secondary Current CharSet
)   3@      Font Secondary Default Active
)   0A      Font Secondary Math Symbol set
)   0B      Font Secondary Line Draw Symbol set
)   0D      Font Secondary ISO Norway v.1
)   1D      Font Secondary ISO Norway v.2
)   0E      Font Secondary HP Roman Extension
)   1E      Font Secondary ISO UK
)   0F      Font Secondary ISO 25: French
)   1F      Font Secondary ISO 69: France
)   0G      Font Secondary HP German
)   1G      Font Secondary ISO 21: Germany
)   8G      Font Secondary HP Greek8
)   0I      Font Secondary ISO Italy
)   0K      Font Secondary JIS ASCII
)   1K      Font Secondary HP Katakana
)   2K      Font Secondary ISO 57: Chinese
)   8K      Font Secondary Kana-8 Symbol set
)   0L      Font Secondary JIS Line Draw
)   0M      Font Secondary JIS Math7
)   1M      Font Secondary Technical
)   8M      Font Secondary JIS Math8
)   0N      Font Secondary ECMA-94 Latin 1
)   0O      Font Secondary OCR-A
)   1O      Font Secondary OCR-B
)   0Q      Font Secondary JIS Math8a
)   1Q      Font Secondary JIS Math8b
)   2Q      Font Secondary JIS PIFonta
)   0S      Font Secondary ISO 11: Swedish
)   1S      Font Secondary HP Spanish
)   2S      Font Secondary ISO Spain
)   3S      Font Secondary ISO Sweden: Names
)   4S      Font Secondary ISO Portugal
)   5S      Font Secondary ISO 84: Portuguese
)   6S      Font Secondary ISO 85: Spanish
)   0U      Font Secondary ISO  6: ASCII
)   1U      Font Secondary JIS Legal
)   2U      Font Secondary ISO IRV
)   7U      Font Secondary OEM-1
)   8U      Font Secondary Roman 8 Symbol set
)   9U      Font Secondary ANSI Symbol set
)  10U      Font Secondary PC-8 symbol set
)  11U      Font Secondary PC-8 Denmark/Norway
)  12U      Font Secondary PC-850
)  15U      Font Secondary JIS PIFont
)   #X      Font Secondary Download Select ID #
)s  0B      Font Secondary Stroke Weight Normal
)s  3B      Font Secondary Stroke Weight Bold
)s  7B      Font Secondary Stroke Weight Extra Bold
)s -3B      Font Secondary Light
)s  #H      Font Secondary Pitch  )10,12,16.66)
)s  0P      Font Secondary Spacing Fixed
)s  1P      Font Secondary Spacing Proportional
)s  1Q      Font Secondary Draft Quality
)s  2Q      Font Secondary Letter Quality
)s  0S      Font Secondary Type Style: Upright
)s  1S      Font Secondary Style Italic
)s  #T      Font Secondary Typeface CG Times (#= 4101)
)s  #T      Font Secondary Typeface Univers  (#= 4148)
)s  0T      Font Secondary Typeface Line Printer
)s  1T      Font Secondary Typeface Pica
)s  2T      Font Secondary Typeface Elite
)s  3T      Font Secondary Typeface Courier
)s  4T      Font Secondary Typeface Helvetica
)s  5T      Font Secondary Typeface Times Roman
)s  6T      Font Secondary Typeface Gothic
)s  7T      Font Secondary Typeface Script
)s  8T      Font Secondary Typeface Prestige
)s 11T      Font Secondary Typeface Presentations
)s 17T      Font Secondary Typeface Optima
)s 18T      Font Secondary Typeface ITC Garamond
)s 19T      Font Secondary Typeface Cooper Black
)s 20T      Font Secondary Typeface Coronet Bold
)s 21T      Font Secondary Typeface Broadway
)s 22T      Font Secondary Typeface Bodini Condensed
)s 23T      Font Secondary Typeface Century Schoolbook
)s 24T      Font Secondary Typeface University Roman
)s 32T      Font Secondary Typeface Brush
)s 61T      Font Secondary Typeface Dom Casual
)s 85T      Font Secondary Typeface Univers Conden.
)s  0U      Font Secondary Typeface Normal
)s +1U      Font Secondary Super
)s -1U      Font Secondary Sub
)s  #V      Font Secondary Character Height # of 1/72"
)s  #W{data}Font Download Create Font Header # Bytes
*b  0M      Graphics Compaction OFF
*b  1M      Graphics Compaction Mode 1
*b  2M      Graphics Compaction Mode 2
*b  3M      Graphics Compaction Delta Row
*b  #W{data}Graphics Transfer # Bytes
*b  #X      Graphics X Offset # dots
*b  #Y      Graphics Y Offset # dots
*c  #A      Graphics Rectangle Horizontal Size-Dots
*c  #B      Graphics Rectangle Vertical Size-Dots
*c  #D      Font Download Assign ID #
*c  #E      Font Download ASCII Code #
*c  0F      Font Download Delete All
*c  1F      Font Download Delete Temp
*c  2F      Font Download Delete Last
*c  4F      Font Download Make Temp
*c  5F      Font Download Make Perm
*c  6F      Font Assign Current as Temp
*c  #G      Rectangle Shade 2,10,15,30,45,70,90,100%
*c  1G      Rectangle Pattern Horizontal Lines
*c  2G      Rectangle Pattern Vertical Lines
*c  3G      Rectangle Pattern Diagonal + Lines
*c  4G      Rectangle Pattern Diagonal - Lines
*c  5G      Rectangle Pattern Square Lines
*c  6G      Rectangle Pattern Crosshatch Lines
*c  #H      Rectangle Size Horizontal Decipoints
*c  #K      HPCL Plot Horizontal Size
*c  #L      HPCL Plot Vertical Size
*c  0P      Rectangle Fill Black
*c  1P      Rectangle Fill White (IIP-III)
*c  2P      Rectangle Fill Shading
*c  3P      Rectangle Fill Pattern
*c  5P      Rectangle Fill Current Pattern
*c  0T      Set Picture Frame Anchor to cursor position
*c  #V      Rectangle Size Vertical Decipoints
*p  #X      Cursor Horizontal Position - Dots
*p  #Y      Cursor Vertical Position - Dots
*r  0A      Graphics Start Left Margin
*r  1A      Graphics Start Current Cursor
*r   B      Graphics End
*r  0F      Graphics Presentation Rotate Image
*r  3F      Graphics Laserjet Landscape Compatible
*r   K      Job Printer Model Number Return
*r  0Q      Graphics Set to default
*r  1Q      Graphics Set Quality draft
*r  2Q      Graphics Set to high
*r  #S      Graphics Width # pixels
*r  #T      Graphics Raster Height in raster rows
*t 75R      Graphic Resolution  75 pixels/inch
*t100R      Graphic Resolution 100 pixels/inch
*t150R      Graphic Resolution 150 pixels/inch
*t300R      Graphic Resolution 300 pixels/inch
*v  0N      Job Print Source Transparent
*v  1N      Job Print Source Opaque
*v  0O      Job Print Pattern Transparent
*v  1O      Job Print Pattern Opaque
*v  0T      Job Print Pattern - Black
*v  1T      Job Print Pattern - White
*v  2T      Job Print Pattern - Shading
*v  3T      Job Print Pattern - Cross Hatch
%   0A      Enter PCL Mode using prior PCL cursor position
%   1A      Enter PCL Mode using current HPGL position
%   0B      Enter HPGL Mode using prior HPGL cursor position
%   1B      Enter HPGL Mode using current PCL position
9           Job Margin Clear Horizontal
=           Cursor Half Line Feed
E           Job Printer Reset
Y           Job Display Function On
z           Job Printer Self-Test
Z           Job Display Function Off

Font Downloading

  1. Send assigned font ID number.
  2. Send font descriptor.
  3. Send character code.
  4. Send character descriptor.

Font descriptor

Offset Len Name Notes LJ DJ
0 1 Font descriptor size 40 48*
2 1 Reserved 00 00
3 1 Font Type
  • 0 7-bit (32-127 printable)
  • 1 8-bit (32 to 127 and 160-255 printable)
  • 2 PC-8 (all printable except 0,7,15,27)
  • To access unprintable characters, use Print Data Transparent.
00 05
4 2 Reserved 0000 0000
6 2 Baseline Distance (unsigned integer) Distance from top of cell to baseline (from 0 to cell height in dots minus 1). 2600 2600
8 2 Cell Width (unsigned word) Width of cell in dots. 1900 3200*
10 2 Cell Height (unsigned word) Height of cell in dots. 3200 3200
12 1 Orientation (unsigned byte) Orientation of font (0=portrait, 1=landscape) 00 00
13 1 Spacing (byte) Spacing of font
  • 0=fixed
  • 1=proportional
00 00
14 2 Symbol Set (unsigned word) Symbol set for this font (value field times 32 + ASCII decimal value of termination character - 64); range 0 to 2047. HP uses 0 to 1023. Termination characters can be "A" to 'V". 1500 1500
16 2 Pitch (default HMI) (unsigned word) Pitch of font in quarter-dots. Defines default HMI for font. Range: 0 to 16800. 6400 6400
18 2 Height (unsigned word) Heigth of font in quarter-dots. Value is converted to points (1/720"=1 pt). Range: 0-10922. C700 C700
20 2 xHeight (unsigned word) Height of lower case "x" in quarter-dots. (Ignored by HP LJ Series II, ...) 6400 6400
22 1 Width Type (signed byte) Proportionate width of characters in font. (Ignored by HP LJ Series II, ...)
  • -2=condensed
  • -1=semi-condensed
  • 0=normal
  • 1=semi-expanded
  • 2=expanded
00 00
23 1 Style (unsigned byte) Style of font; 0=upright, 1=italics 00 00
24 1 Stroke Weight (signed byte): Thickness of strokes; (-7 to 7; standard is 0, bold is 3, light is -3). 06 06
25 1 Typeface
  • 0 LinePrinter
  • 3 Courier
  • 4 Helv
  • 5 TmsRmn
  • 6 LetterGothic
  • 8 Prestige
  • 11 Presentations
  • 17 Optima
  • 18 Garamond
  • 19 CooperBlack
  • 20 CoronetBold
  • 21 Broadway
  • 22 BauerBodoniBlackCondensed
  • 23 CenturySchollbook
  • 24 UniversityRoman
03 03
26 1 Reserved 00 00
27 1 Serif Style (unsigned byte): (Ignored by LJ II,...)
  • 0 Sans Serif Square
  • 1 Sans Serif Round
  • 2 Serif Line
  • 3 Serif Triangle
  • 4 Serif Swath
  • 5 Serif Block
  • 6 Serif Bracket
  • 7 Rounded Bracket
  • 8 Flair Stroke
00 00
28 2 Reserved ** dj ** 0000 0002*
30 1 Underline Distance (signed byte) Distance from baseline to top dot row of underline in dots. 0=at baseline, positive=above baseline. 02 02
31 1 Underline Height (unsigned byte) Thickness of underline in dots. (LJ II is always set to 3 dots.) F6 F6
32 2 Text Height (unsigned word) Font's optimum inter-line spacing, in quarter-dots. (Ignored by LJ II) EF00 EF00
34 2 Text Width (unsigned word) Font's optimum character spacing in quarter-dots. (Ignored by LJ II) 6400 6400
36 2 Reserved 2000 2100*
38 2 Reserved 7F00 7F00
40 1 Pitch Extended (unsigned byte) Extends pitch an extra eight bits. Value is in 1024ths of one dot. E.g. 17 pitch: Pitch=70 (17.5 dots) and Pitch Extended=150 (0.1465 dots additional). 41 41
41 1 Height Extenced (unsigned byte) Extends height an extra eight bits. Value is 1024th of one dot. 00 00
42 2 Reserved 0000 0000
44 2 Reserved 0000 0000
46 2 Reserved 0000 0000
48-63 Font Name (ASCII) String for font name.

Character Descriptor

Offset Len Name Notes LJ DJ
01Format (unsigned byte): Format of the character descriptor byte. 0405
11Continuation (Boolean): 0=data is character descriptor block, or 1=continuation of data associated with previous character descriptor (for large descriptors exceeding 32,767 bytes (max of value field). If so, bytes from 2 are character data. 0000
21Descriptor Size (unsigned byte): Size of character descriptor, in bytes. 1406
31Class (Char.Type) (unsigned byte): Format of character data. 0100
41Orientation (unsigned byte): 0=portrait, 1=landscape; must match font.
51Reserved
62Left Offset (unsigned word): Distance from left of physical page, in dots. (range: -4200 to 4200)
82Top Offset (unsigned word): Distance from top of physical page, in dots. (range: -4200 to 4200)
102Character Width (unsigned word): Width of character in dots. (Range: 1 to 4200). Cannot extend beyond cell boundary, as specified in font descriptor.
122Character Height (unsigned word): Height of character in dots. (Range: 1 to 4200). Cannot extend beyond cell boundary.
142Delta X (signed word): Number of quarter-dots by which horizontal position will be incremented after printing character. Used for proportional spaced characters. (Range: 0 to 16800)
16Character Data Dot-per-bit image; in rows; left-to-right, parallel to raster scan; zero-bit filled to make an integral number of bytes.