@hoangducnhuan/thermal-printer 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/assets/olaii-logo-black-small.png +0 -0
- package/assets/olaii-logo-black-smaller.png +0 -0
- package/assets/olaii-logo-black.png +0 -0
- package/dist/core.d.ts +178 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +585 -0
- package/dist/core.js.map +1 -0
- package/dist/interfaces/capacitor.d.ts +32 -0
- package/dist/interfaces/capacitor.d.ts.map +1 -0
- package/dist/interfaces/capacitor.js +44 -0
- package/dist/interfaces/capacitor.js.map +1 -0
- package/dist/interfaces/index.d.ts +4 -0
- package/dist/interfaces/index.d.ts.map +1 -0
- package/dist/interfaces/index.js +20 -0
- package/dist/interfaces/index.js.map +1 -0
- package/dist/interfaces/interface.d.ts +12 -0
- package/dist/interfaces/interface.d.ts.map +1 -0
- package/dist/interfaces/interface.js +13 -0
- package/dist/interfaces/interface.js.map +1 -0
- package/dist/interfaces/network.d.ts +16 -0
- package/dist/interfaces/network.d.ts.map +1 -0
- package/dist/interfaces/network.js +76 -0
- package/dist/interfaces/network.js.map +1 -0
- package/dist/interfaces/printer.d.ts +10 -0
- package/dist/interfaces/printer.d.ts.map +1 -0
- package/dist/interfaces/printer.js +52 -0
- package/dist/interfaces/printer.js.map +1 -0
- package/dist/interfaces/serialport.d.ts +22 -0
- package/dist/interfaces/serialport.d.ts.map +1 -0
- package/dist/interfaces/serialport.js +99 -0
- package/dist/interfaces/serialport.js.map +1 -0
- package/dist/types/brother-config.d.ts +4 -0
- package/dist/types/brother-config.d.ts.map +1 -0
- package/dist/types/brother-config.js +146 -0
- package/dist/types/brother-config.js.map +1 -0
- package/dist/types/brother.d.ts +12 -0
- package/dist/types/brother.d.ts.map +1 -0
- package/dist/types/brother.js +184 -0
- package/dist/types/brother.js.map +1 -0
- package/dist/types/custom-config.d.ts +4 -0
- package/dist/types/custom-config.d.ts.map +1 -0
- package/dist/types/custom-config.js +202 -0
- package/dist/types/custom-config.js.map +1 -0
- package/dist/types/custom.d.ts +16 -0
- package/dist/types/custom.d.ts.map +1 -0
- package/dist/types/custom.js +300 -0
- package/dist/types/custom.js.map +1 -0
- package/dist/types/daruma-config.d.ts +4 -0
- package/dist/types/daruma-config.d.ts.map +1 -0
- package/dist/types/daruma-config.js +128 -0
- package/dist/types/daruma-config.js.map +1 -0
- package/dist/types/daruma.d.ts +7 -0
- package/dist/types/daruma.d.ts.map +1 -0
- package/dist/types/daruma.js +22 -0
- package/dist/types/daruma.js.map +1 -0
- package/dist/types/epson-config.d.ts +4 -0
- package/dist/types/epson-config.d.ts.map +1 -0
- package/dist/types/epson-config.js +204 -0
- package/dist/types/epson-config.js.map +1 -0
- package/dist/types/epson.d.ts +17 -0
- package/dist/types/epson.d.ts.map +1 -0
- package/dist/types/epson.js +333 -0
- package/dist/types/epson.js.map +1 -0
- package/dist/types/printer-type.d.ts +57 -0
- package/dist/types/printer-type.d.ts.map +1 -0
- package/dist/types/printer-type.js +48 -0
- package/dist/types/printer-type.js.map +1 -0
- package/dist/types/star-config.d.ts +4 -0
- package/dist/types/star-config.d.ts.map +1 -0
- package/dist/types/star-config.js +189 -0
- package/dist/types/star-config.js.map +1 -0
- package/dist/types/star.d.ts +13 -0
- package/dist/types/star.d.ts.map +1 -0
- package/dist/types/star.js +417 -0
- package/dist/types/star.js.map +1 -0
- package/dist/types/tanca-config.d.ts +4 -0
- package/dist/types/tanca-config.d.ts.map +1 -0
- package/dist/types/tanca-config.js +194 -0
- package/dist/types/tanca-config.js.map +1 -0
- package/dist/types/tanca.d.ts +14 -0
- package/dist/types/tanca.d.ts.map +1 -0
- package/dist/types/tanca.js +317 -0
- package/dist/types/tanca.js.map +1 -0
- package/package.json +39 -0
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
import PrinterType from './printer-type.js';
|
|
2
|
+
import starConfig from './star-config.js';
|
|
3
|
+
export default class Star extends PrinterType {
|
|
4
|
+
constructor() {
|
|
5
|
+
super();
|
|
6
|
+
this.config = starConfig;
|
|
7
|
+
}
|
|
8
|
+
// ------------------------------ Append ------------------------------
|
|
9
|
+
append(appendBuffer) {
|
|
10
|
+
if (this.buffer) {
|
|
11
|
+
this.buffer = Buffer.concat([this.buffer, appendBuffer]);
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
this.buffer = appendBuffer;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
// ------------------------------ Set text size ------------------------------
|
|
18
|
+
setTextSize(height, width) {
|
|
19
|
+
this.buffer = null;
|
|
20
|
+
if (height > 5 || height < 0)
|
|
21
|
+
throw new Error('setTextSize: Height must be between 0 and 5');
|
|
22
|
+
if (width > 5 || width < 0)
|
|
23
|
+
throw new Error('setTextSize: Width must be between 0 and 5');
|
|
24
|
+
// [Name] Select character size
|
|
25
|
+
// [Code] Hex. 1B 69 n1 n2
|
|
26
|
+
// [Defined Area] 0 ≤ n1 ≤ 5, 0 ≤ n2 ≤ 5
|
|
27
|
+
// [Initial Value] n1 = 0, n2 = 0
|
|
28
|
+
// [Function] Specifies/cancels double high/wide for ANK and Kanji characters.
|
|
29
|
+
// • n1: Character height magnification (0 = normal, 1-5 = x2-x6)
|
|
30
|
+
// • n2: Character width magnification (0 = normal, 1-5 = x2-x6)
|
|
31
|
+
this.append(Buffer.from([0x1b, 0x69, height, width]));
|
|
32
|
+
return this.buffer;
|
|
33
|
+
}
|
|
34
|
+
// ------------------------------ QR ------------------------------
|
|
35
|
+
printQR(str, settings) {
|
|
36
|
+
this.buffer = null;
|
|
37
|
+
if (!settings) {
|
|
38
|
+
settings = {};
|
|
39
|
+
}
|
|
40
|
+
const config = {
|
|
41
|
+
model: this.config.QRCODE_MODEL1,
|
|
42
|
+
correctionLevel: this.config.QRCODE_CORRECTION_M,
|
|
43
|
+
cellSize: this.config.QRCODE_CELLSIZE_4,
|
|
44
|
+
};
|
|
45
|
+
const models = {
|
|
46
|
+
1: this.config.QRCODE_MODEL1,
|
|
47
|
+
2: this.config.QRCODE_MODEL2,
|
|
48
|
+
};
|
|
49
|
+
const correctionLevels = {
|
|
50
|
+
L: this.config.QRCODE_CORRECTION_L, // Correction level: L - 7%
|
|
51
|
+
M: this.config.QRCODE_CORRECTION_M, // Correction level: M - 15%
|
|
52
|
+
Q: this.config.QRCODE_CORRECTION_Q, // Correction level: Q - 25%
|
|
53
|
+
H: this.config.QRCODE_CORRECTION_H, // Correction level: H - 30%
|
|
54
|
+
};
|
|
55
|
+
const cellSizes = {
|
|
56
|
+
1: this.config.QRCODE_CELLSIZE_1, // Cell size 1
|
|
57
|
+
2: this.config.QRCODE_CELLSIZE_2, // Cell size 2
|
|
58
|
+
3: this.config.QRCODE_CELLSIZE_3, // Cell size 3
|
|
59
|
+
4: this.config.QRCODE_CELLSIZE_4, // Cell size 4
|
|
60
|
+
5: this.config.QRCODE_CELLSIZE_5, // Cell size 5
|
|
61
|
+
6: this.config.QRCODE_CELLSIZE_6, // Cell size 6
|
|
62
|
+
7: this.config.QRCODE_CELLSIZE_7, // Cell size 7
|
|
63
|
+
8: this.config.QRCODE_CELLSIZE_8, // Cell size 8
|
|
64
|
+
};
|
|
65
|
+
if (models[settings.model])
|
|
66
|
+
config.model = models[settings.model];
|
|
67
|
+
if (correctionLevels[settings.correctionLevel])
|
|
68
|
+
config.correctionLevel = correctionLevels[settings.correctionLevel];
|
|
69
|
+
if (cellSizes[settings.cellSize])
|
|
70
|
+
config.cellSize = cellSizes[settings.cellSize];
|
|
71
|
+
// [Name] Set QR code model
|
|
72
|
+
// [Code] Hex. 1B 1D 79 53 30 n
|
|
73
|
+
// [Defined Area] 1 ≤ n ≤ 2
|
|
74
|
+
// [Initial Value] n = 2
|
|
75
|
+
// [Function] Sets the model.
|
|
76
|
+
// • Parameter details
|
|
77
|
+
// n | Set Model
|
|
78
|
+
// ---+---------------
|
|
79
|
+
// 1 | Model 1
|
|
80
|
+
// 2 | Model 2
|
|
81
|
+
this.append(config.model);
|
|
82
|
+
// [Name] Set QR code mistake correction level
|
|
83
|
+
// [Code] Hex. 1B 1D 79 53 31 n
|
|
84
|
+
// [Defined Area] 0 ≤ n ≤ 3
|
|
85
|
+
// [Initial Value] n = 0
|
|
86
|
+
// [Function] Sets the mistake correction level.
|
|
87
|
+
// • Parameter details
|
|
88
|
+
// n | Correction Level | Mistake Correction Rate (%)
|
|
89
|
+
// --+------------------+----------------------------
|
|
90
|
+
// 0 | L | 7
|
|
91
|
+
// 1 | M | 15
|
|
92
|
+
// 2 | Q | 25
|
|
93
|
+
// 3 | H | 30
|
|
94
|
+
this.append(config.correctionLevel);
|
|
95
|
+
// [Name] Set QR code cell size
|
|
96
|
+
// [Code] Hex. 1B 1D 79 53 32 n
|
|
97
|
+
// [Defined Area] 1 ≤ n ≤ 8
|
|
98
|
+
// [Initial Value] n = 3
|
|
99
|
+
// [Function] Sets the cell size.
|
|
100
|
+
// • Parameter details
|
|
101
|
+
// • n: Cell size (Units: Dots)
|
|
102
|
+
// • It is recommended that the specification using this command be 3 ≤ n.
|
|
103
|
+
// If n = 1 or 2, check by actually using.
|
|
104
|
+
this.append(config.cellSize);
|
|
105
|
+
// [Name] Set QR code cell size (Auto Setting)
|
|
106
|
+
// [Code] Hex. 1B 1D 79 44 31 m nL nH d1 d2 … dk
|
|
107
|
+
// [Defined Area]
|
|
108
|
+
// m = 0
|
|
109
|
+
// 0 ≤ nL ≤ 255,
|
|
110
|
+
// 0 ≤ nH ≤ 255
|
|
111
|
+
// 1 ≤ nL + nH x 256 ≤ 7089 (k = nL + nH x 256)
|
|
112
|
+
// 0 ≤ d ≤ 255
|
|
113
|
+
// [Function]
|
|
114
|
+
// Automatically expands the data type of the bar code and sets the data.
|
|
115
|
+
// • Parameter details
|
|
116
|
+
// • nL + nH x 256: Byte count of bar code data
|
|
117
|
+
// • dk: Bar code data (Max. 7089 bytes)
|
|
118
|
+
// • When using this command, the printer receives data for the number of bytes (k) specified by nL and nH.
|
|
119
|
+
// The data automatically expands to be set as the qr code data.
|
|
120
|
+
// • Indicates the number bytes of data specified by the nL and nH. Bar code data is cleared at this time.
|
|
121
|
+
// • The data storage region of this command is shared with the manual setting command so data is updated
|
|
122
|
+
// each time either command is executed.
|
|
123
|
+
const s = str.length;
|
|
124
|
+
const lsb = parseInt(`${s % 256}`);
|
|
125
|
+
const msb = parseInt(`${s / 256}`);
|
|
126
|
+
this.append(Buffer.from([lsb, msb])); // nL, nH
|
|
127
|
+
this.append(Buffer.from(str.toString())); // Data
|
|
128
|
+
this.append(Buffer.from([0x0a])); // NL (new line)
|
|
129
|
+
// [Name] Print QR code
|
|
130
|
+
// [Code] 1B 1D 79 50
|
|
131
|
+
// [Function] Prints bar code data.
|
|
132
|
+
// When receiving this command, if there is unprinted data in the image buffer,
|
|
133
|
+
// the printer will print the bar code after printing the unprinted print data.
|
|
134
|
+
// A margin of more than 4 cells is required around the QR code. The user should ensure that space.
|
|
135
|
+
// Always check printed bar codes in actual use.
|
|
136
|
+
this.append(this.config.QRCODE_PRINT);
|
|
137
|
+
return this.buffer;
|
|
138
|
+
}
|
|
139
|
+
// ------------------------------ PDF417 ------------------------------
|
|
140
|
+
pdf417(data, settings) {
|
|
141
|
+
this.buffer = null;
|
|
142
|
+
if (settings) {
|
|
143
|
+
throw new Error('PDF417 settings not yet available for star printers!');
|
|
144
|
+
}
|
|
145
|
+
// (1) Bar code type setting (<ESC> <GS> “x” “S”)
|
|
146
|
+
// (2) Bar code data setting (<ESC> <GS> “x” “D”)
|
|
147
|
+
// (3) Bar code printing (<ESC> <GS> “x” “P”)
|
|
148
|
+
// (4) Bar code expansion information acquisition (<ESC> <GS> “x” “I”)
|
|
149
|
+
// Set PDF417 bar code size
|
|
150
|
+
// 1B 1D 78 53 30 n p1 p2
|
|
151
|
+
this.append(Buffer.from([0x1b, 0x1d, 0x78, 0x53, 0x30, 0x00, 0x01, 0x02]));
|
|
152
|
+
// Set PDF417 ECC (security level)
|
|
153
|
+
// 1B 1D 78 53 31 n
|
|
154
|
+
this.append(Buffer.from([0x1b, 0x1d, 0x78, 0x53, 0x31, 0x02]));
|
|
155
|
+
// Set PDF417 module X direction size
|
|
156
|
+
// 1B 1D 78 53 32 n
|
|
157
|
+
this.append(Buffer.from([0x1b, 0x1d, 0x78, 0x53, 0x32, 0x02]));
|
|
158
|
+
// Set PDF417 module aspect ratio
|
|
159
|
+
// 1B 1D 78 53 33 n
|
|
160
|
+
this.append(Buffer.from([0x1b, 0x1d, 0x78, 0x53, 0x33, 0x03]));
|
|
161
|
+
// Set PDF417 bar code data
|
|
162
|
+
// 1B 1D 78 44 nL nH d1 d2 … dk
|
|
163
|
+
const s = data.length;
|
|
164
|
+
const lsb = parseInt(`${s % 256}`);
|
|
165
|
+
const msb = parseInt(`${s / 256}`);
|
|
166
|
+
this.append(Buffer.from([0x1b, 0x1d, 0x78, 0x44]));
|
|
167
|
+
this.append(Buffer.from([lsb, msb])); // nL, nH
|
|
168
|
+
this.append(Buffer.from(data.toString())); // Data
|
|
169
|
+
this.append(Buffer.from([0x0a])); // NL (new line)
|
|
170
|
+
// Print PDF417 bar code
|
|
171
|
+
// 1B 1D 78 50
|
|
172
|
+
this.append(Buffer.from([0x1b, 0x1d, 0x78, 0x50]));
|
|
173
|
+
return this.buffer;
|
|
174
|
+
}
|
|
175
|
+
// ------------------------------ CODE128 ------------------------------
|
|
176
|
+
code128(data, settings) {
|
|
177
|
+
this.buffer = null;
|
|
178
|
+
this.append(this.config.BARCODE_CODE128);
|
|
179
|
+
// Barcode option
|
|
180
|
+
// 1 - No text
|
|
181
|
+
// 2 - Text on bottom
|
|
182
|
+
// 3 - No text inline
|
|
183
|
+
// 4 - Text on bottom inline
|
|
184
|
+
if (settings) {
|
|
185
|
+
if (settings.text === 1)
|
|
186
|
+
this.append(this.config.BARCODE_CODE128_TEXT_1);
|
|
187
|
+
else if (settings.text === 2)
|
|
188
|
+
this.append(this.config.BARCODE_CODE128_TEXT_2);
|
|
189
|
+
else if (settings.text === 3)
|
|
190
|
+
this.append(this.config.BARCODE_CODE128_TEXT_3);
|
|
191
|
+
else if (settings.text === 4)
|
|
192
|
+
this.append(this.config.BARCODE_CODE128_TEXT_4);
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
this.append(this.config.BARCODE_CODE128_TEXT_2);
|
|
196
|
+
}
|
|
197
|
+
// Barcode width
|
|
198
|
+
// 31 - Small
|
|
199
|
+
// 32 - Medium
|
|
200
|
+
// 33 - Large
|
|
201
|
+
if (settings) {
|
|
202
|
+
if (settings.width === 'SMALL')
|
|
203
|
+
this.append(this.config.BARCODE_CODE128_WIDTH_SMALL);
|
|
204
|
+
else if (settings.width === 'MEDIUM')
|
|
205
|
+
this.append(this.config.BARCODE_CODE128_WIDTH_MEDIUM);
|
|
206
|
+
else if (settings.width === 'LARGE')
|
|
207
|
+
this.append(this.config.BARCODE_CODE128_WIDTH_LARGE);
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
this.append(this.config.BARCODE_CODE128_WIDTH_LARGE);
|
|
211
|
+
}
|
|
212
|
+
// Barcode height
|
|
213
|
+
if (settings?.height)
|
|
214
|
+
this.append(Buffer.from([settings.height]));
|
|
215
|
+
else
|
|
216
|
+
this.append(Buffer.from([0x50]));
|
|
217
|
+
// Barcode data
|
|
218
|
+
this.append(Buffer.from(data.toString()));
|
|
219
|
+
// Append RS(record separator)
|
|
220
|
+
this.append(Buffer.from([0x1e]));
|
|
221
|
+
return this.buffer;
|
|
222
|
+
}
|
|
223
|
+
// ----------------------------------------------------- PRINT IMAGE -----------------------------------------------------
|
|
224
|
+
async printImage(image) {
|
|
225
|
+
try {
|
|
226
|
+
// Lazy Node-only deps: keeps browser/Capacitor bundles free of `fs`/`pngjs`
|
|
227
|
+
// unless file-based image printing is actually used.
|
|
228
|
+
const { readFileSync } = await import('fs');
|
|
229
|
+
const { PNG } = await import('pngjs');
|
|
230
|
+
const data = readFileSync(image);
|
|
231
|
+
const png = PNG.sync.read(data);
|
|
232
|
+
const buff = this.printImageBuffer(png.width, png.height, png.data);
|
|
233
|
+
return buff;
|
|
234
|
+
}
|
|
235
|
+
catch (error) {
|
|
236
|
+
throw error;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
printImageBuffer(width, height, data) {
|
|
240
|
+
this.buffer = null;
|
|
241
|
+
// Get pixel rgba in 2D array
|
|
242
|
+
const pixels = [];
|
|
243
|
+
for (let i = 0; i < height; i++) {
|
|
244
|
+
const line = [];
|
|
245
|
+
for (let j = 0; j < width; j++) {
|
|
246
|
+
const idx = (width * i + j) << 2;
|
|
247
|
+
line.push({
|
|
248
|
+
r: data[idx],
|
|
249
|
+
g: data[idx + 1],
|
|
250
|
+
b: data[idx + 2],
|
|
251
|
+
a: data[idx + 3],
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
pixels.push(line);
|
|
255
|
+
}
|
|
256
|
+
this.append(Buffer.from([0x1b, 0x30]));
|
|
257
|
+
// v3
|
|
258
|
+
for (let i = 0; i < Math.ceil(height / 24); i++) {
|
|
259
|
+
let imageBuffer = Buffer.from([]);
|
|
260
|
+
for (let y = 0; y < 24; y++) {
|
|
261
|
+
for (let j = 0; j < Math.ceil(width / 8); j++) {
|
|
262
|
+
let byte = 0x0;
|
|
263
|
+
for (let x = 0; x < 8; x++) {
|
|
264
|
+
if (i * 24 + y < pixels.length && j * 8 + x < pixels[i * 24 + y].length) {
|
|
265
|
+
const pixel = pixels[i * 24 + y][j * 8 + x];
|
|
266
|
+
if (pixel.a > 126) {
|
|
267
|
+
// checking transparency
|
|
268
|
+
const grayscale = parseInt(`${0.2126 * pixel.r + 0.7152 * pixel.g + 0.0722 * pixel.b}`);
|
|
269
|
+
if (grayscale < 128) {
|
|
270
|
+
// checking color
|
|
271
|
+
const mask = 1 << (7 - x); // setting bitwise mask
|
|
272
|
+
byte |= mask; // setting the correct bit to 1
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
imageBuffer = Buffer.concat([imageBuffer, Buffer.from([byte])]);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
this.append(Buffer.from([0x1b, 0x6b, parseInt(`${imageBuffer.length / 24}`), 0x00]));
|
|
281
|
+
this.append(imageBuffer);
|
|
282
|
+
this.append(Buffer.from('\n'));
|
|
283
|
+
}
|
|
284
|
+
this.append(Buffer.from([0x1b, 0x7a, 0x01]));
|
|
285
|
+
return this.buffer;
|
|
286
|
+
}
|
|
287
|
+
// ------------------------------ BARCODE ------------------------------
|
|
288
|
+
printBarcode(data, type, settings) {
|
|
289
|
+
this.buffer = null;
|
|
290
|
+
if (!settings) {
|
|
291
|
+
settings = {};
|
|
292
|
+
}
|
|
293
|
+
// [Name] ESC b n1 n2 n3 n4 d1...dk RS
|
|
294
|
+
// [Code] Hex. 1B 62 n1 n2 n3 n4 d1 ... dk 1E
|
|
295
|
+
// [Defined Area]
|
|
296
|
+
// n1 (Barcode type): 0≤n1≤8, 48≤n1≤56 (0≤n1≤8)
|
|
297
|
+
// n2 (Barcode under-bar): 1≤n2≤4, 49≤n2≤52 (1≤n2≤4)
|
|
298
|
+
// n3 (Barcode mode),
|
|
299
|
+
// n4 (Barcode height) 1≤n4≤255
|
|
300
|
+
// d (Barcode data),
|
|
301
|
+
// k (Barcode data count) definitions differ according to the type of barcode.
|
|
302
|
+
// RS
|
|
303
|
+
// [Function]
|
|
304
|
+
// Barcode printing is executed according to the following parameters.
|
|
305
|
+
// If n1, n2, n3 and n4 are acquired and detected to be out of the defined area, data up to RS is discarded.
|
|
306
|
+
this.append(Buffer.from([0x1b, 0x62]));
|
|
307
|
+
// n1 - Barcode type selection
|
|
308
|
+
// +-----------------------+
|
|
309
|
+
// | n1 | Barcode type |
|
|
310
|
+
// |-----------------------|
|
|
311
|
+
// | 0, 48 | UPC-E |
|
|
312
|
+
// | 1, 49 | UPC-A |
|
|
313
|
+
// | 2, 50 | JAN/EAN8 |
|
|
314
|
+
// | 3, 51 | JAN/EAN13 |
|
|
315
|
+
// | 4, 52 | Code39 |
|
|
316
|
+
// | 5, 53 | ITF |
|
|
317
|
+
// | 6, 54 | Code128 |
|
|
318
|
+
// | 7, 55 | Code93 |
|
|
319
|
+
// | 8, 56 | NW-7 |
|
|
320
|
+
// +-----------------------+
|
|
321
|
+
this.append(Buffer.from([type || 7]));
|
|
322
|
+
// n2 - Under-bar character selection and added line feed selection
|
|
323
|
+
// +--------------------------------------------------------------------------------------------+
|
|
324
|
+
// | n2 | Selection |
|
|
325
|
+
// |--------------------------------------------------------------------------------------------|
|
|
326
|
+
// | 1, 49 | No added under-bar charactersExecutes line feed after printing a bar code |
|
|
327
|
+
// | 2, 50 | Adds under-bar characters Executes line feed after printing a bar code |
|
|
328
|
+
// | 3, 51 | No added under-bar charactersDoes not execute line feed after printing a bar code |
|
|
329
|
+
// | 4, 52 | Adds under-bar characters Does not execute line feed after printing a bar code |
|
|
330
|
+
// +--------------------------------------------------------------------------------------------+
|
|
331
|
+
this.append(Buffer.from([settings.characters || 1]));
|
|
332
|
+
// n3 - Barcode mode selection
|
|
333
|
+
// +-------------------------------------------------------------------------------------------+
|
|
334
|
+
// | n3 | Bar code type |
|
|
335
|
+
// | +-----------------------------------------------------------------------------------+
|
|
336
|
+
// | | UPC-E, UPC-A, JAN/EAN8 | Code39, NW-7 | ITF |
|
|
337
|
+
// | | JAN/EAN13, Code128, Code93 | | |
|
|
338
|
+
// +-------------------------------------------------------------------------------------------+
|
|
339
|
+
// | 1, 49 | Minimum module 2 dots | Narrow: Wide = 2:6 dots | Narrow: Wide = 2:5 dots |
|
|
340
|
+
// | 2, 50 | Minimum module 3 dots | Narrow: Wide = 3:9 dots | Narrow: Wide = 4:10 dots |
|
|
341
|
+
// | 3, 51 | Minimum module 4 dots | Narrow: Wide = 4:12 dots | Narrow: Wide = 6:15 dots |
|
|
342
|
+
// | 4, 52 | - - - | Narrow: Wide = 2:5 dots | Narrow: Wide = 2:4 dots |
|
|
343
|
+
// | 5, 53 | - - - | Narrow: Wide = 3:8 dots | Narrow: Wide = 4:8 dots |
|
|
344
|
+
// | 6, 54 | - - - | Narrow: Wide = 4:10 dots | Narrow: Wide = 6:12 dots |
|
|
345
|
+
// | 7, 55 | - - - | Narrow: Wide = 2:4 dots | Narrow: Wide = 2:6 dots |
|
|
346
|
+
// | 8, 56 | - - - | Narrow: Wide = 3:6 dots | Narrow: Wide = 3:9 dots |
|
|
347
|
+
// | 9, 57 | - - - | Narrow: Wide = 4:8 dots | Narrow: Wide = 4:12 dots |
|
|
348
|
+
// +-------------------------------------------------------------------------------------------+
|
|
349
|
+
this.append(Buffer.from([settings.mode || 2]));
|
|
350
|
+
// n4 - Barcode height (dot count)
|
|
351
|
+
// +-------------------------------------------------------------------------------------------------------+
|
|
352
|
+
// | Specification A | Specification B |
|
|
353
|
+
// +-------------------------------------------------------------------------------------------------------+
|
|
354
|
+
// | When the height of the bar code is more than | Form feed at (Bar code height + underbar characters) |
|
|
355
|
+
// | the form feed amount, the form feed amount is | |
|
|
356
|
+
// | automatically doubled. | |
|
|
357
|
+
// +-------------------------------------------------------------------------------------------------------+
|
|
358
|
+
this.append(Buffer.from([settings.height || 150]));
|
|
359
|
+
// d - Barcode data
|
|
360
|
+
// +----------------------------------------------------------------------------------------------------------------+
|
|
361
|
+
// | Bar code type | Defined area of k | Defined area of d |
|
|
362
|
+
// +----------------------------------------------------------------------------------------------------------------+
|
|
363
|
+
// | UPC-E | 11≤k≤12 | 48≤d≤57 (”0”≤d≤”9”) |
|
|
364
|
+
// | UPC-A | 11≤k≤12 | 48≤d≤57 (”0”≤d≤”9”) |
|
|
365
|
+
// | JAN/EAN8 | 7≤k≤8 | 48≤d≤57 (”0”≤d≤”9”) |
|
|
366
|
+
// | JAN/EAN13 | 12≤k≤13 | 48≤d≤57 (”0”≤d≤”9”) |
|
|
367
|
+
// | Code39 | 1≤k | 48≤d≤57 (”0”≤d≤”9”) |
|
|
368
|
+
// | | | 65≤d≤90 (”A”≤d≤”Z”) |
|
|
369
|
+
// | | | 32, 36, 37, 43, 45, 46, 47 (SP, ”$”, ”%”, ”+”, ”-“, ”.”, ”/”) |
|
|
370
|
+
// | ITF | 1≤k | 48≤d≤57 (“0”≤d≤”9”) |
|
|
371
|
+
// | | When an odd number: 0 is | |
|
|
372
|
+
// | | automatically applied to the | |
|
|
373
|
+
// | | top. | |
|
|
374
|
+
// | Code128 | 1≤k | 0≤d≤127 |
|
|
375
|
+
// | Code93 | 1≤k | 0≤d≤127 |
|
|
376
|
+
// | NW-7 | 1≤k | 48≤d≤57 (”0”≤d≤”9”) |
|
|
377
|
+
// | | | 65≤d≤68 (”A”≤d≤”D”) |
|
|
378
|
+
// | | | 36, 43, 45, 46, 47, 58 (”$”, ”+”, ”-“, ”.”, ”/”, ”:”) |
|
|
379
|
+
// | | | 97, 98, 99, 100 (”a”, ”b”, ”c”, ”d”) |
|
|
380
|
+
// +----------------------------------------------------------------------------------------------------------------+
|
|
381
|
+
this.append(Buffer.from(data));
|
|
382
|
+
// k - Barcode data count
|
|
383
|
+
// • UPC – E: k = 11 (or 12)
|
|
384
|
+
// The 12th check digit is automatically applied, so it is specified and ignored.
|
|
385
|
+
// The command is ignored for data that cannot be shortened.
|
|
386
|
+
// Automatically converts data to shortened form.
|
|
387
|
+
//
|
|
388
|
+
// • UPC – A: k = 11 (or 12)
|
|
389
|
+
// The 12th check digit is automatically applied, so it is specified and ignored.
|
|
390
|
+
//
|
|
391
|
+
// • JAN/EAN – 8: k = 7 (or 8)
|
|
392
|
+
// The 8th check digit is automatically applied, so it is specified and ignored.
|
|
393
|
+
//
|
|
394
|
+
// • JAN/EAN -13: k = 12 (or 13)
|
|
395
|
+
// The 13th check digit cannot be automatically applied, so it is specified and ignored.
|
|
396
|
+
//
|
|
397
|
+
// • CODE 39: k is freely set, and maximum value differs according to the mode.
|
|
398
|
+
// Start/stop code (“*”) is automatically applied.
|
|
399
|
+
//
|
|
400
|
+
// • ITF: k is freely set, and maximum value differs according to the mode.
|
|
401
|
+
// If data is oddly numbered, a 0 is applied to the top.
|
|
402
|
+
//
|
|
403
|
+
// • CODE 128: k is freely set, and maximum value differs according to the mode and the print character type.
|
|
404
|
+
// The check character is automatically applied.
|
|
405
|
+
//
|
|
406
|
+
// • CODE 93: k is freely set, and maximum value differs according to the mode and the print character type.
|
|
407
|
+
// The check character (“□”) is automatically applied.
|
|
408
|
+
//
|
|
409
|
+
// • NW7: k is freely set, and maximum value differs according to the mode and the print character type.
|
|
410
|
+
// NOTE: Not needed.
|
|
411
|
+
// this.append(Buffer.from([data.length]));
|
|
412
|
+
// Start/stop codes included in the data (not automatically applied).
|
|
413
|
+
this.append(Buffer.from([0x1e]));
|
|
414
|
+
return this.buffer;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
//# sourceMappingURL=star.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"star.js","sourceRoot":"","sources":["../../lib/types/star.ts"],"names":[],"mappings":"AAAA,OAAO,WAAqG,MAAM,mBAAmB,CAAC;AACtI,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAE1C,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,WAAW;IAC3C;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC;IAC3B,CAAC;IAED,uEAAuE;IACvE,MAAM,CAAC,YAAoB;QACzB,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;QAC3D,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,8EAA8E;IAC9E,WAAW,CAAC,MAAc,EAAE,KAAa;QACvC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,GAAG,C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I,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAEjC,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tanca-config.d.ts","sourceRoot":"","sources":["../../lib/types/tanca-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,QAAA,MAAM,MAAM,EAAE,aA+Mb,CAAC;eAEa,MAAM"}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
const config = {
|
|
2
|
+
// Feed control sequences
|
|
3
|
+
CTL_LF: Buffer.from([0x0a]), // Print and line feed
|
|
4
|
+
CTL_FF: Buffer.from([0x0c]), // Form feed
|
|
5
|
+
CTL_CR: Buffer.from([0x0d]), // Carriage return
|
|
6
|
+
CTL_HT: Buffer.from([0x09]), // Horizontal tab
|
|
7
|
+
CTL_SET_HT: Buffer.from([0x1b, 0x44]), // Set horizontal tab positions
|
|
8
|
+
CTL_VT: Buffer.from([0x1b, 0x64, 0x04]), // Vertical tab
|
|
9
|
+
// Printer hardware
|
|
10
|
+
HW_INIT: Buffer.from([0x1b, 0x40]), // Clear data in buffer and reset modes
|
|
11
|
+
HW_SELECT: Buffer.from([0x1b, 0x3d, 0x01]), // Printer select
|
|
12
|
+
HW_RESET: Buffer.from([0x1b, 0x3f, 0x0a, 0x00]), // Reset printer hardware
|
|
13
|
+
BEEP: Buffer.from([0x1b, 0x42, 0x5, 0x1]), // Sounds built-in buzzer (if equipped)
|
|
14
|
+
UPSIDE_DOWN_ON: Buffer.from([0x1b, 0x7b, 0x01]), // Upside down printing ON (rotated 180 degrees).
|
|
15
|
+
UPSIDE_DOWN_OFF: Buffer.from([0x1b, 0x7b, 0x00]), // Upside down printing OFF (default).
|
|
16
|
+
// Cash Drawer
|
|
17
|
+
CD_KICK_2: Buffer.from([0x1b, 0x70, 0x00]), // Sends a pulse to pin 2 []
|
|
18
|
+
CD_KICK_5: Buffer.from([0x1b, 0x70, 0x01]), // Sends a pulse to pin 5 []
|
|
19
|
+
// Paper
|
|
20
|
+
PAPER_FULL_CUT: Buffer.from([0x1d, 0x56, 0x00]), // Full cut paper
|
|
21
|
+
PAPER_PART_CUT: Buffer.from([0x1d, 0x56, 0x01]), // Partial cut paper
|
|
22
|
+
// Text format
|
|
23
|
+
TXT_NORMAL: Buffer.from([0x1b, 0x21, 0x00]), // Normal text
|
|
24
|
+
TXT_2HEIGHT: Buffer.from([0x1b, 0x21, 0x10]), // Double height text
|
|
25
|
+
TXT_2WIDTH: Buffer.from([0x1b, 0x21, 0x20]), // Double width text
|
|
26
|
+
TXT_4SQUARE: Buffer.from([0x1b, 0x21, 0x30]), // Quad area text
|
|
27
|
+
TXT_UNDERL_OFF: Buffer.from([0x1b, 0x2d, 0x00]), // Underline font OFF
|
|
28
|
+
TXT_UNDERL_ON: Buffer.from([0x1b, 0x2d, 0x01]), // Underline font 1-dot ON
|
|
29
|
+
TXT_UNDERL2_ON: Buffer.from([0x1b, 0x2d, 0x02]), // Underline font 2-dot ON
|
|
30
|
+
TXT_BOLD_OFF: Buffer.from([0x1b, 0x45, 0x00]), // Bold font OFF
|
|
31
|
+
TXT_BOLD_ON: Buffer.from([0x1b, 0x45, 0x01]), // Bold font ON
|
|
32
|
+
TXT_INVERT_OFF: Buffer.from([0x1d, 0x42, 0x00]), // Invert font OFF (eg. white background)
|
|
33
|
+
TXT_INVERT_ON: Buffer.from([0x1d, 0x42, 0x01]), // Invert font ON (eg. black background)
|
|
34
|
+
TXT_FONT_A: Buffer.from([0x1b, 0x4d, 0x00]), // Font type A
|
|
35
|
+
TXT_FONT_B: Buffer.from([0x1b, 0x4d, 0x01]), // Font type B
|
|
36
|
+
TXT_ALIGN_LT: Buffer.from([0x1b, 0x61, 0x00]), // Left justification
|
|
37
|
+
TXT_ALIGN_CT: Buffer.from([0x1b, 0x61, 0x01]), // Centering
|
|
38
|
+
TXT_ALIGN_RT: Buffer.from([0x1b, 0x61, 0x02]), // Right justification
|
|
39
|
+
// All code pages supported by printer.
|
|
40
|
+
CODE_PAGE_PC437_USA: Buffer.from([0x1b, 0x74, 0]),
|
|
41
|
+
CODE_PAGE_KATAKANA: Buffer.from([0x1b, 0x74, 1]),
|
|
42
|
+
CODE_PAGE_PC850_MULTILINGUAL: Buffer.from([0x1b, 0x74, 2]),
|
|
43
|
+
CODE_PAGE_PC860_PORTUGUESE: Buffer.from([0x1b, 0x74, 3]),
|
|
44
|
+
CODE_PAGE_PC863_CANADIAN_FRENCH: Buffer.from([0x1b, 0x74, 4]),
|
|
45
|
+
CODE_PAGE_PC865_NORDIC: Buffer.from([0x1b, 0x74, 5]),
|
|
46
|
+
CODE_PAGE_PC851_GREEK: Buffer.from([0x1b, 0x74, 11]),
|
|
47
|
+
CODE_PAGE_PC853_TURKISH: Buffer.from([0x1b, 0x74, 12]),
|
|
48
|
+
CODE_PAGE_PC857_TURKISH: Buffer.from([0x1b, 0x74, 13]),
|
|
49
|
+
CODE_PAGE_PC737_GREEK: Buffer.from([0x1b, 0x74, 14]),
|
|
50
|
+
CODE_PAGE_ISO8859_7_GREEK: Buffer.from([0x1b, 0x74, 15]),
|
|
51
|
+
CODE_PAGE_WPC1252: Buffer.from([0x1b, 0x74, 16]),
|
|
52
|
+
CODE_PAGE_PC866_CYRILLIC2: Buffer.from([0x1b, 0x74, 17]),
|
|
53
|
+
CODE_PAGE_PC852_LATIN2: Buffer.from([0x1b, 0x74, 18]),
|
|
54
|
+
CODE_PAGE_SLOVENIA: Buffer.from([0x1b, 0x74, 18]),
|
|
55
|
+
CODE_PAGE_PC858_EURO: Buffer.from([0x1b, 0x74, 19]),
|
|
56
|
+
CODE_PAGE_KU42_THAI: Buffer.from([0x1b, 0x74, 20]),
|
|
57
|
+
CODE_PAGE_TIS11_THAI: Buffer.from([0x1b, 0x74, 21]),
|
|
58
|
+
CODE_PAGE_TIS18_THAI: Buffer.from([0x1b, 0x74, 26]),
|
|
59
|
+
CODE_PAGE_TCVN3_VIETNAMESE_L: Buffer.from([0x1b, 0x74, 30]),
|
|
60
|
+
CODE_PAGE_TCVN3_VIETNAMESE_U: Buffer.from([0x1b, 0x74, 31]),
|
|
61
|
+
CODE_PAGE_PC720_ARABIC: Buffer.from([0x1b, 0x74, 32]),
|
|
62
|
+
CODE_PAGE_WPC775_BALTIC_RIM: Buffer.from([0x1b, 0x74, 33]),
|
|
63
|
+
CODE_PAGE_PC855_CYRILLIC: Buffer.from([0x1b, 0x74, 34]),
|
|
64
|
+
CODE_PAGE_PC861_ICELANDIC: Buffer.from([0x1b, 0x74, 35]),
|
|
65
|
+
CODE_PAGE_PC862_HEBREW: Buffer.from([0x1b, 0x74, 36]),
|
|
66
|
+
CODE_PAGE_PC864_ARABIC: Buffer.from([0x1b, 0x74, 37]),
|
|
67
|
+
CODE_PAGE_PC869_GREEK: Buffer.from([0x1b, 0x74, 38]),
|
|
68
|
+
CODE_PAGE_ISO8859_2_LATIN2: Buffer.from([0x1b, 0x74, 39]),
|
|
69
|
+
CODE_PAGE_ISO8859_15_LATIN9: Buffer.from([0x1b, 0x74, 40]),
|
|
70
|
+
CODE_PAGE_PC1098_FARCI: Buffer.from([0x1b, 0x74, 41]),
|
|
71
|
+
CODE_PAGE_PC1118_LITHUANIAN: Buffer.from([0x1b, 0x74, 42]),
|
|
72
|
+
CODE_PAGE_PC1119_LITHUANIAN: Buffer.from([0x1b, 0x74, 43]),
|
|
73
|
+
CODE_PAGE_PC1125_UKRANIAN: Buffer.from([0x1b, 0x74, 44]),
|
|
74
|
+
CODE_PAGE_WPC1250_LATIN2: Buffer.from([0x1b, 0x74, 45]),
|
|
75
|
+
CODE_PAGE_WPC1251_CYRILLIC: Buffer.from([0x1b, 0x74, 46]),
|
|
76
|
+
CODE_PAGE_WPC1253_GREEK: Buffer.from([0x1b, 0x74, 47]),
|
|
77
|
+
CODE_PAGE_WPC1254_TURKISH: Buffer.from([0x1b, 0x74, 48]),
|
|
78
|
+
CODE_PAGE_WPC1255_HEBREW: Buffer.from([0x1b, 0x74, 49]),
|
|
79
|
+
CODE_PAGE_WPC1256_ARABIC: Buffer.from([0x1b, 0x74, 50]),
|
|
80
|
+
CODE_PAGE_WPC1257_BALTIC_RIM: Buffer.from([0x1b, 0x74, 51]),
|
|
81
|
+
CODE_PAGE_WPC1258_VIETNAMESE: Buffer.from([0x1b, 0x74, 52]),
|
|
82
|
+
CODE_PAGE_KZ1048_KAZAKHSTAN: Buffer.from([0x1b, 0x74, 53]),
|
|
83
|
+
CODE_PAGE_JAPAN: Buffer.from([0x1b, 0x52, 0x08]),
|
|
84
|
+
CODE_PAGE_KOREA: Buffer.from([0x1b, 0x52, 0x0d]),
|
|
85
|
+
CODE_PAGE_CHINA: Buffer.from([0x1b, 0x52, 0x0f]),
|
|
86
|
+
CODE_PAGE_HK_TW: Buffer.from([0x1b, 0x52, 0x00]),
|
|
87
|
+
// Character code pages / iconv name of code table.
|
|
88
|
+
// Only code pages supported by iconv-lite:
|
|
89
|
+
// https://github.com/ashtuchkin/iconv-lite/wiki/Supported-Encodings
|
|
90
|
+
CODE_PAGES: {
|
|
91
|
+
PC437_USA: 'CP437',
|
|
92
|
+
PC850_MULTILINGUAL: 'CP850',
|
|
93
|
+
PC860_PORTUGUESE: 'CP860',
|
|
94
|
+
PC863_CANADIAN_FRENCH: 'CP863',
|
|
95
|
+
PC865_NORDIC: 'CP865',
|
|
96
|
+
PC851_GREEK: 'CP860',
|
|
97
|
+
PC857_TURKISH: 'CP857',
|
|
98
|
+
PC737_GREEK: 'CP737',
|
|
99
|
+
ISO8859_7_GREEK: 'ISO-8859-7',
|
|
100
|
+
WPC1252: 'CP1252',
|
|
101
|
+
PC866_CYRILLIC2: 'CP866',
|
|
102
|
+
PC852_LATIN2: 'CP852',
|
|
103
|
+
SLOVENIA: 'CP852',
|
|
104
|
+
PC858_EURO: 'CP858',
|
|
105
|
+
WPC775_BALTIC_RIM: 'CP775',
|
|
106
|
+
PC855_CYRILLIC: 'CP855',
|
|
107
|
+
PC861_ICELANDIC: 'CP861',
|
|
108
|
+
PC862_HEBREW: 'CP862',
|
|
109
|
+
PC864_ARABIC: 'CP864',
|
|
110
|
+
PC869_GREEK: 'CP869',
|
|
111
|
+
ISO8859_2_LATIN2: 'ISO-8859-2',
|
|
112
|
+
ISO8859_15_LATIN9: 'ISO-8859-15',
|
|
113
|
+
PC1125_UKRANIAN: 'CP1125',
|
|
114
|
+
WPC1250_LATIN2: 'WIN1250',
|
|
115
|
+
WPC1251_CYRILLIC: 'WIN1251',
|
|
116
|
+
WPC1253_GREEK: 'WIN1253',
|
|
117
|
+
WPC1254_TURKISH: 'WIN1254',
|
|
118
|
+
WPC1255_HEBREW: 'WIN1255',
|
|
119
|
+
WPC1256_ARABIC: 'WIN1256',
|
|
120
|
+
WPC1257_BALTIC_RIM: 'WIN1257',
|
|
121
|
+
WPC1258_VIETNAMESE: 'WIN1258',
|
|
122
|
+
KZ1048_KAZAKHSTAN: 'RK1048',
|
|
123
|
+
JAPAN: 'EUC-JP',
|
|
124
|
+
KOREA: 'EUC-KR',
|
|
125
|
+
CHINA: 'EUC-CN',
|
|
126
|
+
HK_TW: 'Big5-HKSCS',
|
|
127
|
+
},
|
|
128
|
+
// Barcode format
|
|
129
|
+
BARCODE_TXT_OFF: Buffer.from([0x1d, 0x48, 0x00]), // HRI barcode chars OFF
|
|
130
|
+
BARCODE_TXT_ABV: Buffer.from([0x1d, 0x48, 0x01]), // HRI barcode chars above
|
|
131
|
+
BARCODE_TXT_BLW: Buffer.from([0x1d, 0x48, 0x02]), // HRI barcode chars below
|
|
132
|
+
BARCODE_TXT_BTH: Buffer.from([0x1d, 0x48, 0x03]), // HRI barcode chars both above and below
|
|
133
|
+
BARCODE_FONT_A: Buffer.from([0x1d, 0x66, 0x00]), // Font type A for HRI barcode chars
|
|
134
|
+
BARCODE_FONT_B: Buffer.from([0x1d, 0x66, 0x01]), // Font type B for HRI barcode chars
|
|
135
|
+
BARCODE_HEIGHT: Buffer.from([0x1d, 0x68, 0x64]), // Barcode Height [1-255]
|
|
136
|
+
BARCODE_WIDTH: Buffer.from([0x1d, 0x77, 0x03]), // Barcode Width [2-6]
|
|
137
|
+
BARCODE_UPC_A: Buffer.from([0x1d, 0x6b, 0x00]), // Barcode type UPC-A
|
|
138
|
+
BARCODE_UPC_E: Buffer.from([0x1d, 0x6b, 0x01]), // Barcode type UPC-E
|
|
139
|
+
BARCODE_EAN13: Buffer.from([0x1d, 0x6b, 0x02]), // Barcode type EAN13
|
|
140
|
+
BARCODE_EAN8: Buffer.from([0x1d, 0x6b, 0x03]), // Barcode type EAN8
|
|
141
|
+
BARCODE_CODE39: Buffer.from([0x1d, 0x6b, 0x04]), // Barcode type CODE39
|
|
142
|
+
BARCODE_ITF: Buffer.from([0x1d, 0x6b, 0x05]), // Barcode type ITF
|
|
143
|
+
BARCODE_NW7: Buffer.from([0x1d, 0x6b, 0x06]), // Barcode type NW7
|
|
144
|
+
// QR Code
|
|
145
|
+
QRCODE_MODEL1: Buffer.from([0x1d, 0x28, 0x6b, 0x04, 0x00, 0x31, 0x41, 0x31, 0x00]), // Model 1
|
|
146
|
+
QRCODE_MODEL2: Buffer.from([0x1d, 0x28, 0x6b, 0x04, 0x00, 0x31, 0x41, 0x32, 0x00]), // Model 2
|
|
147
|
+
QRCODE_MODEL3: Buffer.from([0x1d, 0x28, 0x6b, 0x04, 0x00, 0x31, 0x41, 0x33, 0x00]), // Model 3
|
|
148
|
+
QRCODE_CORRECTION_L: Buffer.from([0x1d, 0x28, 0x6b, 0x03, 0x00, 0x31, 0x45, 0x30]), // Correction level: L - 7%
|
|
149
|
+
QRCODE_CORRECTION_M: Buffer.from([0x1d, 0x28, 0x6b, 0x03, 0x00, 0x31, 0x45, 0x31]), // Correction level: M - 15%
|
|
150
|
+
QRCODE_CORRECTION_Q: Buffer.from([0x1d, 0x28, 0x6b, 0x03, 0x00, 0x31, 0x45, 0x32]), // Correction level: Q - 25%
|
|
151
|
+
QRCODE_CORRECTION_H: Buffer.from([0x1d, 0x28, 0x6b, 0x03, 0x00, 0x31, 0x45, 0x33]), // Correction level: H - 30%
|
|
152
|
+
QRCODE_CELLSIZE_1: Buffer.from([0x1d, 0x28, 0x6b, 0x03, 0x00, 0x31, 0x43, 0x01]), // Cell size 1
|
|
153
|
+
QRCODE_CELLSIZE_2: Buffer.from([0x1d, 0x28, 0x6b, 0x03, 0x00, 0x31, 0x43, 0x02]), // Cell size 2
|
|
154
|
+
QRCODE_CELLSIZE_3: Buffer.from([0x1d, 0x28, 0x6b, 0x03, 0x00, 0x31, 0x43, 0x03]), // Cell size 3
|
|
155
|
+
QRCODE_CELLSIZE_4: Buffer.from([0x1d, 0x28, 0x6b, 0x03, 0x00, 0x31, 0x43, 0x04]), // Cell size 4
|
|
156
|
+
QRCODE_CELLSIZE_5: Buffer.from([0x1d, 0x28, 0x6b, 0x03, 0x00, 0x31, 0x43, 0x05]), // Cell size 5
|
|
157
|
+
QRCODE_CELLSIZE_6: Buffer.from([0x1d, 0x28, 0x6b, 0x03, 0x00, 0x31, 0x43, 0x06]), // Cell size 6
|
|
158
|
+
QRCODE_CELLSIZE_7: Buffer.from([0x1d, 0x28, 0x6b, 0x03, 0x00, 0x31, 0x43, 0x07]), // Cell size 7
|
|
159
|
+
QRCODE_CELLSIZE_8: Buffer.from([0x1d, 0x28, 0x6b, 0x03, 0x00, 0x31, 0x43, 0x08]), // Cell size 8
|
|
160
|
+
QRCODE_PRINT: Buffer.from([0x1d, 0x28, 0x6b, 0x03, 0x00, 0x31, 0x51, 0x30]), // Print QR code
|
|
161
|
+
// PDF417
|
|
162
|
+
PDF417_CORRECTION: Buffer.from([0x1d, 0x28, 0x6b, 0x04, 0x00, 0x30, 0x45, 0x31]), // Append 1-40 for ratio
|
|
163
|
+
PDF417_ROW_HEIGHT: Buffer.from([0x1d, 0x28, 0x6b, 0x03, 0x00, 0x30, 0x44]), // Append 2-8 for height
|
|
164
|
+
PDF417_WIDTH: Buffer.from([0x1d, 0x28, 0x6b, 0x03, 0x00, 0x30, 0x43]), // Append 2-8 for width
|
|
165
|
+
PDF417_COLUMNS: Buffer.from([0x1d, 0x28, 0x6b, 0x03, 0x00, 0x30, 0x41]),
|
|
166
|
+
PDF417_OPTION_STANDARD: Buffer.from([0x1d, 0x28, 0x6b, 0x03, 0x00, 0x30, 0x46, 0x00]), // Standard barcode
|
|
167
|
+
PDF417_OPTION_TRUNCATED: Buffer.from([0x1d, 0x28, 0x6b, 0x03, 0x00, 0x30, 0x46, 0x01]), // Truncated barcode
|
|
168
|
+
PDF417_PRINT: Buffer.from([0x1d, 0x28, 0x6b, 0x03, 0x00, 0x30, 0x51, 0x30]),
|
|
169
|
+
// MaxiCode
|
|
170
|
+
// Formatted data containing a structured Carrier Message with a numeric postal code. (US)
|
|
171
|
+
MAXI_MODE2: Buffer.from([0x1d, 0x28, 0x6b, 0x03, 0x00, 0x32, 0x41, 0x32]),
|
|
172
|
+
// Formatted data containing a structured Carrier Message with an alphanumeric postal code. (International)
|
|
173
|
+
MAXI_MODE3: Buffer.from([0x1d, 0x28, 0x6b, 0x03, 0x00, 0x32, 0x41, 0x33]),
|
|
174
|
+
MAXI_MODE4: Buffer.from([0x1d, 0x28, 0x6b, 0x03, 0x00, 0x32, 0x41, 0x34]), // Unformatted data with Standard Error Correction.
|
|
175
|
+
MAXI_MODE5: Buffer.from([0x1d, 0x28, 0x6b, 0x03, 0x00, 0x32, 0x41, 0x35]), // Unformatted data with Enhanced Error Correction.
|
|
176
|
+
MAXI_MODE6: Buffer.from([0x1d, 0x28, 0x6b, 0x03, 0x00, 0x32, 0x41, 0x36]), // For programming hardware devices.
|
|
177
|
+
MAXI_PRINT: Buffer.from([0x1d, 0x28, 0x6b, 0x03, 0x00, 0x32, 0x51, 0x30]),
|
|
178
|
+
// Image format
|
|
179
|
+
S_RASTER_N: Buffer.from([0x1d, 0x76, 0x30, 0x00]), // Set raster image normal size
|
|
180
|
+
S_RASTER_2W: Buffer.from([0x1d, 0x76, 0x30, 0x01]), // Set raster image double width
|
|
181
|
+
S_RASTER_2H: Buffer.from([0x1d, 0x76, 0x30, 0x02]), // Set raster image double height
|
|
182
|
+
S_RASTER_Q: Buffer.from([0x1d, 0x76, 0x30, 0x03]), // Set raster image quadruple
|
|
183
|
+
// Printing Density
|
|
184
|
+
PD_N50: Buffer.from([0x1d, 0x7c, 0x00]), // Printing Density -50%
|
|
185
|
+
PD_N37: Buffer.from([0x1d, 0x7c, 0x01]), // Printing Density -37.5%
|
|
186
|
+
PD_N25: Buffer.from([0x1d, 0x7c, 0x02]), // Printing Density -25%
|
|
187
|
+
PD_N12: Buffer.from([0x1d, 0x7c, 0x03]), // Printing Density -12.5%
|
|
188
|
+
PD_0: Buffer.from([0x1d, 0x7c, 0x04]), // Printing Density 0%
|
|
189
|
+
PD_P50: Buffer.from([0x1d, 0x7c, 0x08]), // Printing Density +50%
|
|
190
|
+
PD_P37: Buffer.from([0x1d, 0x7c, 0x07]), // Printing Density +37.5%
|
|
191
|
+
PD_P25: Buffer.from([0x1d, 0x7c, 0x06]), // Printing Density +25%
|
|
192
|
+
};
|
|
193
|
+
export default config;
|
|
194
|
+
//# sourceMappingURL=tanca-config.js.map
|