PCL XL, the language of PCL 6, is a binary, object-based language unrelated to the escape sequences of PCL 5. A stream is a series of attributes (typed values, each with an attribute ID) followed by an operator that uses them, like a stack machine. HP’s own reference for it was not available to this page; the tag, attribute and enumeration values below are taken from Artifex’s GhostPDL, which implements PCL XL and marks the additions of protocol classes 2.0 and 3.0.
Stream header
A PCL XL job is entered from PJL (@PJL ENTER LANGUAGE=PCLXL) and
starts with one line of ASCII text, the stream header, ended by LF:
) HP-PCL XL;2;1;Comment, PCL-XL Generator
| Part | Meaning |
|---|---|
| First byte | The binding: ' (0x27) ASCII, ( (0x28) binary with the most significant byte first, ) (0x29) binary with the least significant byte first (the binding tags pxt_beginASCII, pxt_beginBinaryMSB, pxt_beginBinaryLSB). Ghostscript writes ). |
HP-PCL XL | The stream class name. |
;2;1 | Protocol class and revision of the stream, such as 2;1; Ghostscript writes 1;1. The attribute and operator tables mark what classes 2.0 and 3.0 added. |
;… | An optional comment, often the driver’s name. |
After the header come binary tokens up to the end of the job, normally
Esc%-12345X.
Operators
| Tag | Operator | Tag | Operator |
|---|---|---|---|
41 | BeginSession | 42 | EndSession |
43 | BeginPage | 44 | EndPage |
47 | Comment | 48 | OpenDataSource |
49 | CloseDataSource | 4F | BeginFontHeader |
50 | ReadFontHeader | 51 | EndFontHeader |
52 | BeginChar | 53 | ReadChar |
54 | EndChar | 55 | RemoveFont |
56 | SetCharAttributes (2.0) | 5B | BeginStream |
5C | ReadStream | 5D | EndStream |
5E | ExecStream | 5F | RemoveStream (2.0) |
60 | PopGS | 61 | PushGS |
62 | SetClipReplace | 63 | SetBrushSource |
64 | SetCharAngle | 65 | SetCharScale |
66 | SetCharShear | 67 | SetClipIntersect |
68 | SetClipRectangle | 69 | SetClipToPage |
6A | SetColorSpace | 6B | SetCursor |
6C | SetCursorRel | 6D | SetHalftoneMethod |
6E | SetFillMode | 6F | SetFont |
70 | SetLineDash | 71 | SetLineCap |
72 | SetLineJoin | 73 | SetMiterLimit |
74 | SetPageDefaultCTM | 75 | SetPageOrigin |
76 | SetPageRotation | 77 | SetPageScale |
78 | SetPaintTxMode | 79 | SetPenSource |
7A | SetPenWidth | 7B | SetROP |
7C | SetSourceTxMode | 7D | SetCharBoldValue |
7F | SetClipMode | 80 | SetPathToClip |
81 | SetCharSubMode | 84 | CloseSubPath |
85 | NewPath | 86 | PaintPath |
91 | ArcPath | 93 | BezierPath |
95 | BezierRelPath | 96 | Chord |
97 | ChordPath | 98 | Ellipse |
99 | EllipsePath | 9B | LinePath |
9D | LineRelPath | 9E | Pie |
9F | PiePath | A0 | Rectangle |
A1 | RectanglePath | A2 | RoundRectangle |
A3 | RoundRectanglePath | A8 | Text |
A9 | TextPath | B0 | BeginImage |
B1 | ReadImage | B2 | EndImage |
B3 | BeginRastPattern | B4 | ReadRastPattern |
B5 | EndRastPattern | B6 | BeginScan |
B8 | EndScan | B9 | ScanLineRel |
BF | PassThrough (PCL 5 inside PCL XL) |
All other bytes from 0x40 to 0xBF are reserved operators and an error if met.
Attribute IDs
| ID | Attribute | ID | Attribute |
|---|---|---|---|
| 2 | PaletteDepth | 3 | ColorSpace |
| 4 | NullBrush | 5 | NullPen |
| 6 | PaletteData | 8 | PatternSelectID |
| 9 | GrayLevel | 10 | Lightness (2.0) |
| 11 | RGBColor | 12 | PatternOrigin |
| 13 | NewDestinationSize | 14 | PrimaryArray (2.0) |
| 15 | PrimaryDepth (2.0) | 16 | Saturation (2.0) |
| 17 | ColorimetricColorSpace (2.0) | 18 | XYChromaticities (2.0) |
| 19 | WhiteReferencePoint (2.0) | 20 | CRGBMinMax (2.0) |
| 21 | GammaGain (2.0) | 29 | AllObjectTypes (3.0) |
| 30 | TextObjects (3.0) | 31 | VectorObjects (3.0) |
| 32 | RasterObjects (3.0) | 33 | DeviceMatrix |
| 34 | DitherMatrixDataType | 35 | DitherOrigin |
| 36 | MediaDestination | 37 | MediaSize |
| 38 | MediaSource | 39 | MediaType |
| 40 | Orientation | 41 | PageAngle |
| 42 | PageOrigin | 43 | PageScale |
| 44 | ROP3 | 45 | TxMode |
| 47 | CustomMediaSize | 48 | CustomMediaSizeUnits |
| 49 | PageCopies | 50 | DitherMatrixSize |
| 51 | DitherMatrixDepth | 52 | SimplexPageMode |
| 53 | DuplexPageMode | 54 | DuplexPageSide |
| 65 | ArcDirection | 66 | BoundingBox |
| 67 | DashOffset | 68 | EllipseDimension |
| 69 | EndPoint | 70 | FillMode |
| 71 | LineCapStyle | 72 | LineJoinStyle |
| 73 | MiterLength | 74 | LineDashStyle |
| 75 | PenWidth | 76 | Point |
| 77 | NumberOfPoints | 78 | SolidLine |
| 79 | StartPoint | 80 | PointType |
| 81 | ControlPoint1 | 82 | ControlPoint2 |
| 83 | ClipRegion | 84 | ClipMode |
| 98 | ColorDepth | 99 | BlockHeight |
| 100 | ColorMapping | 101 | CompressMode |
| 102 | DestinationBox | 103 | DestinationSize |
| 104 | PatternPersistence | 105 | PatternDefineID |
| 107 | SourceHeight | 108 | SourceWidth |
| 109 | StartLine | 110 | PadBytesMultiple (2.0) |
| 111 | BlockByteLength (2.0) | 115 | NumberOfScanLines |
| 120 | ColorTreatment | 129 | CommentData |
| 130 | DataOrg | 134 | Measure |
| 136 | SourceType | 137 | UnitsPerMeasure |
| 139 | StreamName | 140 | StreamDataLength |
| 141 | PCLSelectFont | 143 | ErrorReport |
| 145 | VUExtension | 146 | VUDataLength |
| 147–152 | VUAttr1–VUAttr6 (vendor-unique) | 161 | CharAngle |
| 162 | CharCode | 163 | CharDataSize |
| 164 | CharScale | 165 | CharShear |
| 166 | CharSize | 167 | FontHeaderLength |
| 168 | FontName | 169 | FontFormat |
| 170 | SymbolSet | 171 | TextData |
| 172 | CharSubModeArray | 173 | WritingMode |
| 175 | XSpacingData | 176 | YSpacingData |
| 177 | CharBoldValue |
Numbers not listed are unassigned in the published protocol classes.
Enumerated values
| Attribute | Values |
|---|---|
ColorSpace | 0 none, 1 Gray, 2 RGB, 6 sRGB |
ColorDepth | 0 1 bit, 1 4 bits, 2 8 bits |
ColorMapping | 0 direct pixel, 1 indexed pixel |
CompressMode | 0 none, 1 RLE, 2 JPEG, 3 delta row |
DataOrg | 0 binary high byte first, 1 binary low byte first |
SourceType | 0 default data source |
Measure | 0 inch, 1 millimetre, 2 tenths of a millimetre |
ErrorReport | 0 none, 1 back channel, 2 error page, 3 both, 4 back channel without stopping, 5 error page without stopping, 6 both without stopping |
Orientation | 0 portrait, 1 landscape, 2 reverse portrait, 3 reverse landscape, 4 default |
MediaSize | 0 Letter, 1 Legal, 2 A4, 3 Executive, 4 Ledger, 5 A3, 6 COM-10 envelope, 7 Monarch envelope, 8 C5 envelope, 9 DL envelope, 10 JIS B4, 11 JIS B5, 12 B5 envelope, 13 B5, 14 Japanese postcard, 15 Japanese double postcard, 16 A5, 17 A6, 18 JIS B6, 19 JIS 8K, 20 JIS 16K, 21 JIS Executive, 96 default; 201–224 newer sizes (B6 JIS, C6 envelope, 8K, 16K, 12×18, 13×19, SRA3, SRA4, 11×14 and others). MediaSize may also be given as a name string. |
MediaSource | 0 default, 1 auto select, 2 manual feed, 3 multi-purpose tray, 4 upper cassette, 5 lower cassette, 6 envelope tray, 7 third cassette; higher numbers device-specific |
MediaDestination | 0 default, 1 face-down bin, 2 face-up bin, 3 job offset bin |
MediaType | given as a name string; 0 default |
SimplexPageMode | 0 front side |
DuplexPageMode | 0 horizontal binding, 1 vertical binding |
DuplexPageSide | 0 front, 1 back |
ArcDirection | 0 clockwise, 1 counter-clockwise |
FillMode, ClipMode | 0 non-zero winding, 1 even-odd |
ClipRegion | 0 interior, 1 exterior |
LineCapStyle | 0 butt, 1 round, 2 square, 3 triangle |
LineJoinStyle | 0 mitre, 1 round, 2 bevel, 3 none |
TxMode | 0 opaque, 1 transparent |
PatternPersistence | 0 temporary, 1 page, 2 session |
DitherMatrixDataType, PointType | 0 ubyte, 1 sbyte, 2 uint16, 3 sint16 |
| Dither matrix | −1 downloaded, 0 device best |
WritingMode | 0 horizontal, 1 vertical |
CharSubModeArray | 0 no substitution, 1 vertical substitution |
ColorTreatment | 0 none, 1 vivid, 2 screen match, 3 text, 4 out of gamut, 5 CIE Lab match 1, 6 CIE Lab match 2 |
| Halftone method (3.0) | 0 high LPI, 1 medium LPI, 2 low LPI; adaptive halftoning 0 off, 1 on |
| Colour trapping (3.0) | 0 off, 1 max, 2 normal, 3 light; neutral axis 0 toner black, 1 process black |
Example
The start of a session, in low-byte-first binding: measure in inches, 600 units per
inch, errors on the back channel, then BeginSession.
C0 00 F8 86 Measure = 0 (inch)
D1 58 02 58 02 F8 89 UnitsPerMeasure = 600, 600
C0 01 F8 8F ErrorReport = 1 (back channel)
41 BeginSession
Sources
- GhostPDL gdevpxop.h – every tag byte: binding, operators, data types, attribute and embedded data tags
- GhostPDL gdevpxat.h – attribute IDs, with the 2.0 and 3.0 additions
- GhostPDL gdevpxen.h – enumerated values
- GhostPDL gdevpxut.c – the PJL and stream header the PCL XL driver writes