1 /*****************************************************************************\
2 PrinterCommands.h : Printer command sequences
4 Copyright (c) 1996 - 2009, Hewlett-Packard Co.
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions
10 1. Redistributions of source code must retain the above copyright
11 notice, this list of conditions and the following disclaimer.
12 2. Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
15 3. Neither the name of Hewlett-Packard nor the names of its
16 contributors may be used to endorse or promote products derived
17 from this software without specific prior written permission.
19 THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
20 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
22 NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
24 TO, PATENT INFRINGEMENT; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
25 OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
26 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 \*****************************************************************************/
31 #ifndef PRINTER_COMMANDS_H
32 #define PRINTER_COMMANDS_H
34 const BYTE UEL[] = {0x1b, '%', '-','1','2','3','4','5','X' };
35 const BYTE EnterLanguage[] = {'@','P','J','L',' ','E','N','T','E','R',' ',
36 'L','A','N','G','U','A','G','E','=','P','C','L','3','G','U','I',0x0A};
37 const BYTE Reset[] = {0x1b,'E'};
38 const char PJLExit[] = "\x1b%-12345X@PJL EOJ\012\x1b%-12345X";
39 const BYTE grafStart[5] = {0x1b, '*', 'r', '1', 'A'}; // raster graphics mode
40 const BYTE grafMode2[5] = {0x1b, '*', 'b', '2', 'M'}; // Mode2 Compression
41 const BYTE grafMode3[5] = {0x1b, '*', 'b', '3', 'M'}; // Mode3 Compression
42 const BYTE grafMode9[5] = {0x1b, '*', 'b', '9', 'M'}; // Mode9 Compression
43 const BYTE seedSame[5] = {0x1b, '*', 'b', '0', 'S'}; // Reset seed row
44 const BYTE GrayscaleSeq[10] = {0x1b, '*', 'o', '5', 'W', 0x0B, 0x01, 0x00, 0x00, 0x02};
45 const BYTE MediaSubtypeSeq[8] = {0x1b, 0x2A, 0x6F, 0x35, 0x57, 0x0D, 0x03, 0x00};
46 // "Esc*o5W 0D 03 00 00 00" Media Type Index
47 const BYTE EnableDuplex[5] = {0x1b,'&','l', '2', 'S'};
48 const BYTE ExtraDryTime[21] = {0x1b, '&', 'b', '1', '6', 'W', 'P', 'M', 'L', ' ',
49 0x04, 0x00, 0x06, 0x01, 0x04, 0x01, 0x04, 0x01, 0x06,
51 const BYTE crd_sequence_k[18] = {0x1b, 0x2a, 0x67, 0x31, 0x32, 0x57, 0x06, 0x1F, 0x00, 0x01,
52 //Esc * |g |# of bytes |W |frmt |SP |# of cmpnts
53 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x01, 0x01};
54 //|Horz Res |Vert Rez |compr|orien|bits |planes
56 const BYTE crd_sequence_color[18] = {0x1b, 0x2a, 0x67, 0x31, 0x32, 0x57, 0x06, 0x07, 0x00, 0x01,
57 // Esc * |g |# of bytes |W |frmt |SP |# of cmpnts
58 0x00, 0x00, 0x00, 0x00, 0x0a, 0x01, 0x20, 0x01};
59 //|Horz Res |Vert Rez |compr|orien|bits |planes
61 const BYTE crd_sequence_both[26] = {0x1b, 0x2a, 0x67, 0x32, 0x30, 0x57, 0x06, 0x1F, 0x00, 0x02,
62 // Esc * |g |# of bytes |W |frmt |SP |# of cmpnts
63 /* K */ 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x01, 0x01,
64 //|Horz Res |Vert Rez |compr|orien|bits |planes
65 /* RGB */ 0x00, 0x00, 0x00, 0x00, 0x0a, 0x01, 0x20, 0x01};
67 const BYTE speed_mech_cmd[8] = {0x1B, '*', 'o', '5', 'W', 0x0D, 0x02, 0x00};
68 const BYTE speed_mech_end[10] = {0x1B, '*', 'o', '5', 'W', 0x0D, 0x05, 0x00, 0x00, 0x01};
69 const BYTE speed_mech_continue[10] = {0x1B, '*', 'o', '5', 'W', 0x0D, 0x05, 0x00, 0x00, 0x00};
70 const BYTE black_extract_off[10] = {0x1B, '*', 'o', '5', 'W', 0x04, 0xC, 0, 0, 0};
71 const BYTE FRBeginSession[] = {0xC0, 0x00, 0xF8, 0x86, 0xC0, 0x03, 0xF8, 0x8F, 0xD1, 0x58,
72 0x02, 0x58, 0x02, 0xF8, 0x89, 0x41};
73 const BYTE FRFeedOrientation[] = {0xC0, 0x00 , 0xF8, 0x28 };
74 // |fd ori enum| |ori cmd|
75 const BYTE FRPaperSize[] = {0xC0, 0x00 ,0xF8, 0x25};
76 // |pap siz enum| |pap sz cmd|
77 const BYTE FRCustomMediaSize[] = {0xC0, 0x00, 0xF8, 0x30};
78 const BYTE FRMedSource[] = {0xC0, 0x00 ,0xF8, 0x26};
79 // |Med src enum| |Med src cmd|
80 const BYTE FRMedDestination[] = {0xC0, 0x00 ,0xF8 , 0x24};
81 // |Med Dest enum| |Med src cmd|
82 const BYTE FRBeginPage[] = {0x43, 0xD3, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x2A, 0x75, 0xC0, 0x07,
83 0xF8, 0x03, 0x6A, 0xC0, 0xCC, 0xF8, 0x2C, 0x7B,
84 0xD3, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x4C, 0x6B};
85 const BYTE FRBeginImage[] = {0xC2, 0x00, 0x40, 0x70, 0x68, 0xF8, 0x91, 0xC1};
87 const BYTE FRVUverTag[] = {0xC2, 0x00, 0x00, 0x04, 0x00 , 0xF8, 0x95};
88 // |endian alignd | |FR_ver_ tag|
89 const BYTE FRDataLength[] = {0xC2, 0x86, 0x0A, 0x00, 0x00, 0xF8, 0x92};
91 const BYTE FRVendorUniq[] = {0x46};
92 const BYTE FRVUExtn3[] = {0xC2, 0x11, 0x20, 0x70, 0x68 ,0xF8, 0x91};
93 // |endian alignd FR rd img tag| |VU extensn|
94 const BYTE FROpenDataSource[] = {0xC0, 0x00, 0xF8, 0x88, 0xC0, 0x01, 0xF8, 0x82, 0x48};
95 const BYTE FREnterFRMode[] = {0xC2, 0x06, 0x20, 0x70,0x68, 0xF8, 0x91, 0xC2};
96 const BYTE FREndPage[] = {0x44};
97 const BYTE FREndSession[] = {0x42};
98 const BYTE FRCloseDataSource[] = {0x49};
100 const BYTE JRBeginSessionSeq[] = {0xC0, 0x00, 0xF8, 0x86, 0xC0, 0x03, 0xF8, 0x8F, 0xD1, 0x58,
101 0x02, 0x58, 0x02, 0xF8, 0x89, 0x41};
102 const BYTE JRFeedOrientationSeq[] = {0xC0, 0x00, 0xF8, 0x28 };
103 // |fd ori enum| |ori cmd|
104 const BYTE JRPaperSizeSeq[] = {0xC0, 0x00, 0xF8, 0x25};
105 // |pap siz enum| |pap sz cmd|
106 const BYTE JRCustomPaperSizeSeq[] = {0xF8, 0x2F, 0xC0, 0x00, 0xF8, 0x30};
107 const BYTE JRMediaSourceSeq[] = {0xC0, 0x00, 0xF8, 0x26};
108 // |Med src enum| |Med src cmd|
109 const BYTE JRMediaDestinationSeq[] = {0xC0, 0x00, 0xF8, 0x24};
110 // |Med Dest enum| |Med src cmd|
111 const BYTE JRBeginPageSeq[] = {0x43, 0xD3, 0x64, 0x00, 0x64, 0x00, 0xF8, 0x2A, 0x75, 0xD3,
112 0x00, 0x00, 0x00, 0x00, 0xF8, 0x4C, 0x6B};
113 const BYTE JRBeginImageSeq[] = {0xC2, 0x00, 0x40, 0x70, 0x68, 0xF8, 0x91, 0xC1};
114 const BYTE JRReadImageSeq[] = {0xC2, 0x01, 0x40, 0x70, 0x68, 0xF8, 0x91, 0xC1};
115 const BYTE JRStripHeightSeq[] = {0xF8, 0x6D, 0xC1, 0x80, 0x00, 0xF8, 0x63};
116 const BYTE JRTextObjectTypeSeq[] = {0xC0, 0x00, 0xF8, 0x96};
117 // Interleaved Color Enumeration for Mojave
118 const BYTE JRICESeq[] = {0xC0, 0x00, 0xF8, 0x98};
120 const BYTE JRVueVersionTagSeq[] = {0xC2, 0x00, 0x00, 0x04, 0x00 , 0xF8, 0x95};
121 // |endian alignd | |JR_ver_ tag|
122 const BYTE JRDataLengthSeq[] = {0xC2, 0x86, 0x0A, 0x00, 0x00, 0xF8, 0x92};
124 const BYTE JRVendorUniqueSeq[] = {0x46};
125 const BYTE JRVueExtn3Seq[] = {0xC2, 0x02, 0x40, 0x70, 0x68, 0xF8, 0x91 };
126 // |endian alignd JR rd img tag| |VU extensn|
127 const BYTE JREndPageSeq[] = {0x44};
128 const BYTE JREndSessionSeq[] = {0x42};
130 const BYTE JRQTSeq[] = {0x00, 0x80, 0x00, 0x03, 0x00, 0x00};
131 const BYTE JRCRSeq[] = {0x01, 0x80, 0x2C, 0x00, 0x00, 0x00};
132 const BYTE JRCR1GSeq[] = {0x05, 0xE0, 0x00, 0x00};
133 const BYTE JRCR1CSeq[] = {0x01, 0xE0, 0x14, 0x66};
135 const BYTE JRSCSeq[][4] =
138 0x00, 0x20, 0x00, 0x00
141 0x00, 0x00, 0x00, 0x00
144 0x00, 0x00, 0x00, 0x00
147 0x00, 0x20, 0x00, 0x00
150 0x00, 0xE0, 0x00, 0x00
153 0x00, 0x00, 0x00, 0x00
156 0x00, 0x20, 0x00, 0x00
159 0x00, 0x00, 0x00, 0x00
162 0x00, 0xE0, 0x00, 0x00
166 const BYTE LdlReset[] = {0x24, 0x00, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00,
167 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x24};
168 const BYTE LdlSync[] = {0x24, 0x01, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
170 const BYTE LdlSyncComplete[] = {0x24, 0x00, 0x10, 0x00, 0x08, 0x00, 0x00, 0x00,
171 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x24};
172 const BYTE LdlContinue[] = {0x24, 0x00, 0x10, 0x00, 0x00, 0x0C, 0x00, 0x00,
173 0x00, 0x00, 0x02, 0xFF, 0xFF, 0xFF, 0xFF, 0x24};
174 const BYTE LdlPrepareToCancel[] = {0x24, 0x00, 0x10, 0x00, 0x00, 0x0C, 0x00, 0x00,
175 0x00, 0x00, 0x0A, 0xFF, 0xFF, 0xFF, 0xFF, 0x24};
178 #endif // PRINTER_COMMANDS_H