@urovotest/urovosdk-docs-mcp 1.0.1
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/README.md +176 -0
- package/docs/00-overview.md +37 -0
- package/docs/01-integration/android-permissions.md +22 -0
- package/docs/01-integration/quickstart-zh.md +54 -0
- package/docs/02-reference/emv/emv-api.md +3308 -0
- package/docs/02-reference/emv/emv-appendix.md +112 -0
- package/docs/02-reference/emv/emv-callback.md +1155 -0
- package/docs/02-reference/emv/emv-enum.md +324 -0
- package/docs/02-reference/error-codes.md +59 -0
- package/docs/02-reference/general/beeper.md +160 -0
- package/docs/02-reference/general/devicemanager.md +460 -0
- package/docs/02-reference/general/insertcardreader.md +307 -0
- package/docs/02-reference/general/install-manager.md +202 -0
- package/docs/02-reference/general/led-light.md +144 -0
- package/docs/02-reference/general/magcardreader.md +191 -0
- package/docs/02-reference/general/pinpad.md +3309 -0
- package/docs/02-reference/general/printer.md +1410 -0
- package/docs/02-reference/general/psam2.md +55 -0
- package/docs/02-reference/general/rfcardreader.md +1090 -0
- package/docs/02-reference/general/scanner-custom.md +196 -0
- package/docs/02-reference/general/scanner.md +214 -0
- package/docs/02-reference/general/sdk-log-output-management.md +124 -0
- package/docs/02-reference/general/serial-port-deprecated-suggest-using-module-14-serialtool.md +406 -0
- package/docs/02-reference/general/serial-port.md +326 -0
- package/docs/02-reference/general/sle4428-4436-4442.md +1890 -0
- package/docs/02-reference/general/system-manager.md +212 -0
- package/docs/02-reference/module-index.md +30 -0
- package/docs/02-reference/source-emv_sdk.md +3927 -0
- package/docs/02-reference/source-general_sdk.md +8978 -0
- package/docs/02-reference/undocumented/kiosk-lock-task.md +92 -0
- package/docs/03-demo/activity-map.md +27 -0
- package/docs/api-registry.json +4733 -0
- package/docs/search-index.json +2688 -0
- package/docs/source/emv_sdk.md +3927 -0
- package/docs/source/general_sdk.md +8978 -0
- package/docs/source/kiosk_lock_task.md +86 -0
- package/package.json +36 -0
- package/src/launch.js +22 -0
- package/src/lib/check-update.js +92 -0
- package/src/lib/create-mcp-server.js +90 -0
- package/src/lib/docs-tools.js +206 -0
- package/src/server.js +10 -0
|
@@ -0,0 +1,1410 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Printer API
|
|
3
|
+
module: Printer
|
|
4
|
+
domain: general
|
|
5
|
+
tags: ["general", "printer", "printer"]
|
|
6
|
+
---
|
|
7
|
+
# Printer
|
|
8
|
+
|
|
9
|
+
共 **20** 个 API/条目,来源 `general_sdk.md`。
|
|
10
|
+
|
|
11
|
+
## API 索引
|
|
12
|
+
|
|
13
|
+
| 方法 | 类路径 | Demo Activity |
|
|
14
|
+
|------|--------|---------------|
|
|
15
|
+
| [getStatus](#getstatus) | `com.urovo.sdk.print.PrinterProviderImpl` | PrintActivity |
|
|
16
|
+
| [setGrayLevel](#setgraylevel) | `com.urovo.sdk.print.PrinterProviderImpl` | PrintActivity |
|
|
17
|
+
| [addText](#addtext) | `com.urovo.sdk.print.PrinterProviderImpl` | PrintActivity |
|
|
18
|
+
| [addText_Left_Right(Deprecated)](#addtext-left-right-deprecated) | `com.urovo.sdk.print.PrinterProviderImpl` | PrintActivity |
|
|
19
|
+
| [addText_Left_Right](#addtext-left-right) | `com.urovo.sdk.print.PrinterProviderImpl` | PrintActivity |
|
|
20
|
+
| [addText_Left_Right_Center(Deprecated)](#addtext-left-right-center-deprecated) | `com.urovo.sdk.print.PrinterProviderImpl` | PrintActivity |
|
|
21
|
+
| [addText_Left_Right_Center](#addtext-left-right-center) | `com.urovo.sdk.print.PrinterProviderImpl` | PrintActivity |
|
|
22
|
+
| [addBarCode](#addbarcode) | `com.urovo.sdk.print.PrinterProviderImpl` | PrintActivity |
|
|
23
|
+
| [addQrCode](#addqrcode) | `com.urovo.sdk.print.PrinterProviderImpl` | PrintActivity |
|
|
24
|
+
| [addImage](#addimage) | `com.urovo.sdk.print.PrinterProviderImpl` | PrintActivity |
|
|
25
|
+
| [feedLine](#feedline) | `com.urovo.sdk.print.PrinterProviderImpl` | PrintActivity |
|
|
26
|
+
| [startPrint](#startprint) | `com.urovo.sdk.print.PrinterProviderImpl` | PrintActivity |
|
|
27
|
+
| [addImageWithText](#addimagewithtext) | `com.urovo.sdk.print.PrinterProviderImpl` | PrintActivity |
|
|
28
|
+
| [addHtml](#addhtml) | `com.urovo.sdk.print.PrinterProviderImpl` | PrintActivity |
|
|
29
|
+
| [addBlankLine](#addblankline) | `com.urovo.sdk.print.PrinterProviderImpl` | PrintActivity |
|
|
30
|
+
| [setSpeed](#setspeed) | `com.urovo.sdk.print.PrinterProviderImpl` | PrintActivity |
|
|
31
|
+
| [addBlackLine](#addblackline) | `com.urovo.sdk.print.PrinterProviderImpl` | PrintActivity |
|
|
32
|
+
| [supportLabelPrint](#supportlabelprint) | `com.urovo.sdk.print.PrinterProviderImpl` | PrintActivity |
|
|
33
|
+
| [setPrinterMode](#setprintermode) | `com.urovo.sdk.print.PrinterProviderImpl` | PrintActivity |
|
|
34
|
+
| [setLabelFeed](#setlabelfeed) | `com.urovo.sdk.print.PrinterProviderImpl` | PrintActivity |
|
|
35
|
+
|
|
36
|
+
## getStatus
|
|
37
|
+
|
|
38
|
+
Get printer status
|
|
39
|
+
|
|
40
|
+
```java
|
|
41
|
+
int getStatus()
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
- **类路径:** `com.urovo.sdk.print.PrinterProviderImpl`
|
|
45
|
+
- **Demo Activity(参考):** PrintActivity
|
|
46
|
+
- **源文档章节:** 4.1
|
|
47
|
+
|
|
48
|
+
- Source section: `4.1`
|
|
49
|
+
|
|
50
|
+
- Package/class path: `com.urovo.sdk.print.PrinterProviderImpl`
|
|
51
|
+
|
|
52
|
+
- Demo reference: `UrovoPosSdkDemo/app/src/main/java/com/urovo/sdk/view/PrintActivity.java`
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
Purpose:
|
|
57
|
+
Get printer status
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
Signature/prototype:
|
|
61
|
+
```java
|
|
62
|
+
int getStatus()
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
Parameters:
|
|
67
|
+
input
|
|
68
|
+
None
|
|
69
|
+
output
|
|
70
|
+
None
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
Return value:
|
|
74
|
+
Printer status.
|
|
75
|
+
/**
|
|
76
|
+
0x00-success;
|
|
77
|
+
0xF0-no paper;
|
|
78
|
+
0xF3-over heart;
|
|
79
|
+
0xE1-low val;
|
|
80
|
+
0xF7-printer busy;
|
|
81
|
+
0xFB-printer error;
|
|
82
|
+
0xF2-hardware error;
|
|
83
|
+
others:print failed;
|
|
84
|
+
**/
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
Usage notes:
|
|
88
|
+
Refer to com.urovo.sdk.print.PrintStatus.
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
Source details:
|
|
92
|
+
```text
|
|
93
|
+
Prototype
|
|
94
|
+
int getStatus()
|
|
95
|
+
Description
|
|
96
|
+
Get printer status
|
|
97
|
+
Parameters
|
|
98
|
+
input
|
|
99
|
+
None
|
|
100
|
+
output
|
|
101
|
+
None
|
|
102
|
+
Return
|
|
103
|
+
Printer status.
|
|
104
|
+
/**
|
|
105
|
+
0x00-success;
|
|
106
|
+
0xF0-no paper;
|
|
107
|
+
0xF3-over heart;
|
|
108
|
+
0xE1-low val;
|
|
109
|
+
0xF7-printer busy;
|
|
110
|
+
0xFB-printer error;
|
|
111
|
+
0xF2-hardware error;
|
|
112
|
+
others:print failed;
|
|
113
|
+
**/
|
|
114
|
+
Remark
|
|
115
|
+
Refer to com.urovo.sdk.print.PrintStatus.
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## setGrayLevel
|
|
119
|
+
|
|
120
|
+
Set printer grayscale
|
|
121
|
+
|
|
122
|
+
```java
|
|
123
|
+
void setGray(int gray)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
- **类路径:** `com.urovo.sdk.print.PrinterProviderImpl`
|
|
127
|
+
- **Demo Activity(参考):** PrintActivity
|
|
128
|
+
- **源文档章节:** 4.2
|
|
129
|
+
|
|
130
|
+
- Source section: `4.2`
|
|
131
|
+
|
|
132
|
+
- Package/class path: `com.urovo.sdk.print.PrinterProviderImpl`
|
|
133
|
+
|
|
134
|
+
- Demo reference: `UrovoPosSdkDemo/app/src/main/java/com/urovo/sdk/view/PrintActivity.java`
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
Purpose:
|
|
139
|
+
Set printer grayscale
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
Signature/prototype:
|
|
143
|
+
```java
|
|
144
|
+
void setGray(int gray)
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
Parameters:
|
|
149
|
+
input
|
|
150
|
+
Gray-print grayscale,-6~6 level
|
|
151
|
+
output
|
|
152
|
+
None
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
Source details:
|
|
156
|
+
```text
|
|
157
|
+
Prototype
|
|
158
|
+
void setGray(int gray)
|
|
159
|
+
Description
|
|
160
|
+
Set printer grayscale
|
|
161
|
+
Parameters
|
|
162
|
+
input
|
|
163
|
+
Gray-print grayscale,-6~6 level
|
|
164
|
+
output
|
|
165
|
+
None
|
|
166
|
+
Return
|
|
167
|
+
|
|
168
|
+
Remark
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## addText
|
|
172
|
+
|
|
173
|
+
Add a line of printed text in the specified format
|
|
174
|
+
|
|
175
|
+
```java
|
|
176
|
+
void addText(Bundle format, String text)
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
- **类路径:** `com.urovo.sdk.print.PrinterProviderImpl`
|
|
180
|
+
- **Demo Activity(参考):** PrintActivity
|
|
181
|
+
- **源文档章节:** 4.3
|
|
182
|
+
|
|
183
|
+
- Source section: `4.3`
|
|
184
|
+
|
|
185
|
+
- Package/class path: `com.urovo.sdk.print.PrinterProviderImpl`
|
|
186
|
+
|
|
187
|
+
- Demo reference: `UrovoPosSdkDemo/app/src/main/java/com/urovo/sdk/view/PrintActivity.java`
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
Purpose:
|
|
192
|
+
Add a line of printed text in the specified format
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
Signature/prototype:
|
|
196
|
+
```java
|
|
197
|
+
void addText(Bundle format, String text)
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
Parameters:
|
|
202
|
+
input
|
|
203
|
+
format - Specify print font format
|
|
204
|
+
*font(int): 0:small,1:normal,2:large,
|
|
205
|
+
default: 1:normal font.
|
|
206
|
+
*fontBold(boolean): default: false.
|
|
207
|
+
*align(int): alignment, default left, 0: left, 1: center, 2: right
|
|
208
|
+
*fontName(string):the path of customization ttf file. eg: /sdcard/xxx.ttf.
|
|
209
|
+
*fontSize(int):if this parameter exist, will ignore the font.
|
|
210
|
+
*lineHeight(int): the distance of each line.
|
|
211
|
+
text - print text
|
|
212
|
+
output
|
|
213
|
+
None
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
Usage notes:
|
|
217
|
+
Refer to com.urovo.sdk.print.PrintFormat.
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
Source details:
|
|
221
|
+
```text
|
|
222
|
+
Prototype
|
|
223
|
+
void addText(Bundle format, String text)
|
|
224
|
+
Description
|
|
225
|
+
Add a line of printed text in the specified format
|
|
226
|
+
Parameters
|
|
227
|
+
input
|
|
228
|
+
format - Specify print font format
|
|
229
|
+
*font(int): 0:small,1:normal,2:large,
|
|
230
|
+
default: 1:normal font.
|
|
231
|
+
*fontBold(boolean): default: false.
|
|
232
|
+
*align(int): alignment, default left, 0: left, 1: center, 2: right
|
|
233
|
+
*fontName(string):the path of customization ttf file. eg: /sdcard/xxx.ttf.
|
|
234
|
+
*fontSize(int):if this parameter exist, will ignore the font.
|
|
235
|
+
*lineHeight(int): the distance of each line.
|
|
236
|
+
text - print text
|
|
237
|
+
output
|
|
238
|
+
None
|
|
239
|
+
Return
|
|
240
|
+
|
|
241
|
+
Remark
|
|
242
|
+
Refer to com.urovo.sdk.print.PrintFormat.
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## addText_Left_Right(Deprecated)
|
|
246
|
+
|
|
247
|
+
Add a line of printed text in the specified format
|
|
248
|
+
|
|
249
|
+
```java
|
|
250
|
+
void addTextLeft_Right(String textLeft, String textRight,
|
|
251
|
+
int font, boolean fontBold)
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
- **类路径:** `com.urovo.sdk.print.PrinterProviderImpl`
|
|
255
|
+
- **Demo Activity(参考):** PrintActivity
|
|
256
|
+
- **源文档章节:** 4.4
|
|
257
|
+
|
|
258
|
+
- Source section: `4.4`
|
|
259
|
+
|
|
260
|
+
- Package/class path: `com.urovo.sdk.print.PrinterProviderImpl`
|
|
261
|
+
|
|
262
|
+
- Demo reference: `UrovoPosSdkDemo/app/src/main/java/com/urovo/sdk/view/PrintActivity.java`
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
Purpose:
|
|
267
|
+
Add a line of printed text in the specified format
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
Signature/prototype:
|
|
271
|
+
```java
|
|
272
|
+
void addTextLeft_Right(String textLeft, String textRight,
|
|
273
|
+
int font, boolean fontBold)
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
Parameters:
|
|
278
|
+
input
|
|
279
|
+
textLeft - print left content.
|
|
280
|
+
textRight - print right content.
|
|
281
|
+
font(int) - font,0:small,1:normal,2:large,
|
|
282
|
+
default :normal font.
|
|
283
|
+
fontBold(boolean) - default: false.
|
|
284
|
+
output
|
|
285
|
+
None
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
Usage notes:
|
|
289
|
+
Refer to com.urovo.sdk.print.PrintFormat.
|
|
290
|
+
Suggest using method 4.5.
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
Source details:
|
|
294
|
+
```text
|
|
295
|
+
Prototype
|
|
296
|
+
void addTextLeft_Right(String textLeft, String textRight,
|
|
297
|
+
int font, boolean fontBold)
|
|
298
|
+
Description
|
|
299
|
+
Add a line of printed text in the specified format
|
|
300
|
+
Parameters
|
|
301
|
+
input
|
|
302
|
+
textLeft - print left content.
|
|
303
|
+
textRight - print right content.
|
|
304
|
+
font(int) - font,0:small,1:normal,2:large,
|
|
305
|
+
default :normal font.
|
|
306
|
+
fontBold(boolean) - default: false.
|
|
307
|
+
output
|
|
308
|
+
None
|
|
309
|
+
Return
|
|
310
|
+
|
|
311
|
+
Remark
|
|
312
|
+
Refer to com.urovo.sdk.print.PrintFormat.
|
|
313
|
+
Suggest using method 4.5.
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
## addText_Left_Right
|
|
317
|
+
|
|
318
|
+
Add a line of printed text in the specified format
|
|
319
|
+
|
|
320
|
+
```java
|
|
321
|
+
void addTextLeft_Right(Bundle format, String textLeft,
|
|
322
|
+
String textRigh)
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
- **类路径:** `com.urovo.sdk.print.PrinterProviderImpl`
|
|
326
|
+
- **Demo Activity(参考):** PrintActivity
|
|
327
|
+
- **源文档章节:** 4.5
|
|
328
|
+
|
|
329
|
+
- Source section: `4.5`
|
|
330
|
+
|
|
331
|
+
- Package/class path: `com.urovo.sdk.print.PrinterProviderImpl`
|
|
332
|
+
|
|
333
|
+
- Demo reference: `UrovoPosSdkDemo/app/src/main/java/com/urovo/sdk/view/PrintActivity.java`
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
Purpose:
|
|
338
|
+
Add a line of printed text in the specified format
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
Signature/prototype:
|
|
342
|
+
```java
|
|
343
|
+
void addTextLeft_Right(Bundle format, String textLeft,
|
|
344
|
+
String textRigh)
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
Parameters:
|
|
349
|
+
input
|
|
350
|
+
format - Specify print font format
|
|
351
|
+
/**
|
|
352
|
+
*font(int):font,0:small,1:normal,2:large,
|
|
353
|
+
default: 1:normal font.
|
|
354
|
+
*fontBold(boolean):,default: false.
|
|
355
|
+
*align(int): alignment, default left, 0: left, 1: center, 2: right
|
|
356
|
+
*fontName(string) : font to be used, otherwise, default system font is used. Or custom fonts i.e. /mnt/sdcard/xxx.ttf the path.
|
|
357
|
+
*fontSize(int):if this parameter exist, will ignore the font.
|
|
358
|
+
*lineHeight(int): the distance of each line.
|
|
359
|
+
**/
|
|
360
|
+
textLeft - print left contet.
|
|
361
|
+
textRight - print right content.
|
|
362
|
+
output
|
|
363
|
+
None
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
Usage notes:
|
|
367
|
+
Refer to com.urovo.sdk.print.PrintFormat.
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
Source details:
|
|
371
|
+
```text
|
|
372
|
+
Prototype
|
|
373
|
+
void addTextLeft_Right(Bundle format, String textLeft,
|
|
374
|
+
String textRigh)
|
|
375
|
+
Description
|
|
376
|
+
Add a line of printed text in the specified format
|
|
377
|
+
Parameters
|
|
378
|
+
input
|
|
379
|
+
format - Specify print font format
|
|
380
|
+
/**
|
|
381
|
+
*font(int):font,0:small,1:normal,2:large,
|
|
382
|
+
default: 1:normal font.
|
|
383
|
+
*fontBold(boolean):,default: false.
|
|
384
|
+
*align(int): alignment, default left, 0: left, 1: center, 2: right
|
|
385
|
+
*fontName(string) : font to be used, otherwise, default system font is used. Or custom fonts i.e. /mnt/sdcard/xxx.ttf the path.
|
|
386
|
+
*fontSize(int):if this parameter exist, will ignore the font.
|
|
387
|
+
*lineHeight(int): the distance of each line.
|
|
388
|
+
**/
|
|
389
|
+
textLeft - print left contet.
|
|
390
|
+
textRight - print right content.
|
|
391
|
+
output
|
|
392
|
+
None
|
|
393
|
+
Return
|
|
394
|
+
|
|
395
|
+
Remark
|
|
396
|
+
Refer to com.urovo.sdk.print.PrintFormat.
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
## addText_Left_Right_Center(Deprecated)
|
|
400
|
+
|
|
401
|
+
Add a line of printed text in the specified format
|
|
402
|
+
|
|
403
|
+
```java
|
|
404
|
+
void addTextLeft_Right_Center(String textLeft,
|
|
405
|
+
String textCenter, String textRight, int font,
|
|
406
|
+
boolean fontBold)
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
- **类路径:** `com.urovo.sdk.print.PrinterProviderImpl`
|
|
410
|
+
- **Demo Activity(参考):** PrintActivity
|
|
411
|
+
- **源文档章节:** 4.6
|
|
412
|
+
|
|
413
|
+
- Source section: `4.6`
|
|
414
|
+
|
|
415
|
+
- Package/class path: `com.urovo.sdk.print.PrinterProviderImpl`
|
|
416
|
+
|
|
417
|
+
- Demo reference: `UrovoPosSdkDemo/app/src/main/java/com/urovo/sdk/view/PrintActivity.java`
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
Purpose:
|
|
422
|
+
Add a line of printed text in the specified format
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
Signature/prototype:
|
|
426
|
+
```java
|
|
427
|
+
void addTextLeft_Right_Center(String textLeft,
|
|
428
|
+
String textCenter, String textRight, int font,
|
|
429
|
+
boolean fontBold)
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
Parameters:
|
|
434
|
+
input
|
|
435
|
+
textLeft - print left content.
|
|
436
|
+
textCenter - print center contet.
|
|
437
|
+
textRigh - print right content.
|
|
438
|
+
font(int) - font,0:small,1:normal,2:large.
|
|
439
|
+
default: normal font.
|
|
440
|
+
fontBold(boolean) - default: false.
|
|
441
|
+
output
|
|
442
|
+
None
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
Usage notes:
|
|
446
|
+
Refer to com.urovo.sdk.print.PrintFormat.
|
|
447
|
+
Suggest using method 4.7.
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
Source details:
|
|
451
|
+
```text
|
|
452
|
+
Prototype
|
|
453
|
+
void addTextLeft_Right_Center(String textLeft,
|
|
454
|
+
String textCenter, String textRight, int font,
|
|
455
|
+
boolean fontBold)
|
|
456
|
+
Description
|
|
457
|
+
Add a line of printed text in the specified format
|
|
458
|
+
Parameters
|
|
459
|
+
input
|
|
460
|
+
textLeft - print left content.
|
|
461
|
+
textCenter - print center contet.
|
|
462
|
+
textRigh - print right content.
|
|
463
|
+
font(int) - font,0:small,1:normal,2:large.
|
|
464
|
+
default: normal font.
|
|
465
|
+
fontBold(boolean) - default: false.
|
|
466
|
+
output
|
|
467
|
+
None
|
|
468
|
+
Return
|
|
469
|
+
|
|
470
|
+
Remark
|
|
471
|
+
Refer to com.urovo.sdk.print.PrintFormat.
|
|
472
|
+
Suggest using method 4.7.
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
## addText_Left_Right_Center
|
|
476
|
+
|
|
477
|
+
Add a line of printed text in the specified format
|
|
478
|
+
|
|
479
|
+
```java
|
|
480
|
+
void addTextLeft_Right_Center(Bundle format,
|
|
481
|
+
String textLeft, String textCenter, String textRight)
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
- **类路径:** `com.urovo.sdk.print.PrinterProviderImpl`
|
|
485
|
+
- **Demo Activity(参考):** PrintActivity
|
|
486
|
+
- **源文档章节:** 4.7
|
|
487
|
+
|
|
488
|
+
- Source section: `4.7`
|
|
489
|
+
|
|
490
|
+
- Package/class path: `com.urovo.sdk.print.PrinterProviderImpl`
|
|
491
|
+
|
|
492
|
+
- Demo reference: `UrovoPosSdkDemo/app/src/main/java/com/urovo/sdk/view/PrintActivity.java`
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
Purpose:
|
|
497
|
+
Add a line of printed text in the specified format
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
Signature/prototype:
|
|
501
|
+
```java
|
|
502
|
+
void addTextLeft_Right_Center(Bundle format,
|
|
503
|
+
String textLeft, String textCenter, String textRight)
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
Parameters:
|
|
508
|
+
input
|
|
509
|
+
format - Specify print font format
|
|
510
|
+
/**
|
|
511
|
+
*font(int):font,0:small,1:normal,2:large,
|
|
512
|
+
default: 1:normal font.
|
|
513
|
+
*fontBold(boolean):,default: false.
|
|
514
|
+
*align(int): alignment, default left, 0: left, 1: center, 2: right
|
|
515
|
+
*fontName(string) : font to be used, otherwise, default system font is used. Or custom fonts i.e. /mnt/sdcard/xxx.ttf the path.
|
|
516
|
+
*fontSize(int):if this parameter exist, will ignore the font.
|
|
517
|
+
*lineHeight(int): the distance of each line.
|
|
518
|
+
**/
|
|
519
|
+
textLeft - print left content.
|
|
520
|
+
textCenter - print center content.
|
|
521
|
+
textRigh - print right content.
|
|
522
|
+
output
|
|
523
|
+
None
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
Usage notes:
|
|
527
|
+
Refer to com.urovo.sdk.print.PrintFormat.
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
Source details:
|
|
531
|
+
```text
|
|
532
|
+
Prototype
|
|
533
|
+
void addTextLeft_Right_Center(Bundle format,
|
|
534
|
+
String textLeft, String textCenter, String textRight)
|
|
535
|
+
Description
|
|
536
|
+
Add a line of printed text in the specified format
|
|
537
|
+
Parameters
|
|
538
|
+
input
|
|
539
|
+
format - Specify print font format
|
|
540
|
+
/**
|
|
541
|
+
*font(int):font,0:small,1:normal,2:large,
|
|
542
|
+
default: 1:normal font.
|
|
543
|
+
*fontBold(boolean):,default: false.
|
|
544
|
+
*align(int): alignment, default left, 0: left, 1: center, 2: right
|
|
545
|
+
*fontName(string) : font to be used, otherwise, default system font is used. Or custom fonts i.e. /mnt/sdcard/xxx.ttf the path.
|
|
546
|
+
*fontSize(int):if this parameter exist, will ignore the font.
|
|
547
|
+
*lineHeight(int): the distance of each line.
|
|
548
|
+
**/
|
|
549
|
+
textLeft - print left content.
|
|
550
|
+
textCenter - print center content.
|
|
551
|
+
textRigh - print right content.
|
|
552
|
+
output
|
|
553
|
+
None
|
|
554
|
+
Return
|
|
555
|
+
|
|
556
|
+
Remark
|
|
557
|
+
Refer to com.urovo.sdk.print.PrintFormat.
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
## addBarCode
|
|
561
|
+
|
|
562
|
+
Add barcode print.
|
|
563
|
+
|
|
564
|
+
```java
|
|
565
|
+
void addBarCode(Bundle format, String barcode)
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
- **类路径:** `com.urovo.sdk.print.PrinterProviderImpl`
|
|
569
|
+
- **Demo Activity(参考):** PrintActivity
|
|
570
|
+
- **源文档章节:** 4.8
|
|
571
|
+
|
|
572
|
+
- Source section: `4.8`
|
|
573
|
+
|
|
574
|
+
- Package/class path: `com.urovo.sdk.print.PrinterProviderImpl`
|
|
575
|
+
|
|
576
|
+
- Demo reference: `UrovoPosSdkDemo/app/src/main/java/com/urovo/sdk/view/PrintActivity.java`
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
Purpose:
|
|
581
|
+
Add barcode print.
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
Signature/prototype:
|
|
585
|
+
```java
|
|
586
|
+
void addBarCode(Bundle format, String barcode)
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
|
|
590
|
+
Parameters:
|
|
591
|
+
input
|
|
592
|
+
format - print format.
|
|
593
|
+
align(int): 0: left,1: center,2: right
|
|
594
|
+
width(int): width
|
|
595
|
+
height(int): height
|
|
596
|
+
barcode_type: the barcode type.
|
|
597
|
+
barcode - barcode content.
|
|
598
|
+
output
|
|
599
|
+
None
|
|
600
|
+
|
|
601
|
+
|
|
602
|
+
Usage notes:
|
|
603
|
+
Refer to com.urovo.sdk.print.PrintFormat.
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
Source details:
|
|
607
|
+
```text
|
|
608
|
+
Prototype
|
|
609
|
+
void addBarCode(Bundle format, String barcode)
|
|
610
|
+
Description
|
|
611
|
+
Add barcode print.
|
|
612
|
+
Parameters
|
|
613
|
+
input
|
|
614
|
+
format - print format.
|
|
615
|
+
align(int): 0: left,1: center,2: right
|
|
616
|
+
width(int): width
|
|
617
|
+
height(int): height
|
|
618
|
+
barcode_type: the barcode type.
|
|
619
|
+
barcode - barcode content.
|
|
620
|
+
output
|
|
621
|
+
None
|
|
622
|
+
Return
|
|
623
|
+
|
|
624
|
+
Remark
|
|
625
|
+
Refer to com.urovo.sdk.print.PrintFormat.
|
|
626
|
+
```
|
|
627
|
+
|
|
628
|
+
## addQrCode
|
|
629
|
+
|
|
630
|
+
Add QR code print
|
|
631
|
+
|
|
632
|
+
```java
|
|
633
|
+
void addQrCode(Bundle format, String qrCode)
|
|
634
|
+
```
|
|
635
|
+
|
|
636
|
+
- **类路径:** `com.urovo.sdk.print.PrinterProviderImpl`
|
|
637
|
+
- **Demo Activity(参考):** PrintActivity
|
|
638
|
+
- **源文档章节:** 4.9
|
|
639
|
+
|
|
640
|
+
- Source section: `4.9`
|
|
641
|
+
|
|
642
|
+
- Package/class path: `com.urovo.sdk.print.PrinterProviderImpl`
|
|
643
|
+
|
|
644
|
+
- Demo reference: `UrovoPosSdkDemo/app/src/main/java/com/urovo/sdk/view/PrintActivity.java`
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
Purpose:
|
|
649
|
+
Add QR code print
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+
Signature/prototype:
|
|
653
|
+
```java
|
|
654
|
+
void addQrCode(Bundle format, String qrCode)
|
|
655
|
+
```
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
Parameters:
|
|
659
|
+
input
|
|
660
|
+
format - print format
|
|
661
|
+
align(int): 0: left,1: center,2: right.
|
|
662
|
+
(Takes effect when offset=-1).
|
|
663
|
+
offset(int): print start position.
|
|
664
|
+
expectedHeight(int): expected height
|
|
665
|
+
qrCode - QR code content.
|
|
666
|
+
output
|
|
667
|
+
None
|
|
668
|
+
|
|
669
|
+
|
|
670
|
+
Usage notes:
|
|
671
|
+
Refer to com.urovo.sdk.print.PrintFormat.
|
|
672
|
+
|
|
673
|
+
|
|
674
|
+
Source details:
|
|
675
|
+
```text
|
|
676
|
+
Prototype
|
|
677
|
+
void addQrCode(Bundle format, String qrCode)
|
|
678
|
+
Description
|
|
679
|
+
Add QR code print
|
|
680
|
+
Parameters
|
|
681
|
+
input
|
|
682
|
+
format - print format
|
|
683
|
+
align(int): 0: left,1: center,2: right.
|
|
684
|
+
(Takes effect when offset=-1).
|
|
685
|
+
offset(int): print start position.
|
|
686
|
+
expectedHeight(int): expected height
|
|
687
|
+
qrCode - QR code content.
|
|
688
|
+
output
|
|
689
|
+
None
|
|
690
|
+
Return
|
|
691
|
+
|
|
692
|
+
Remark
|
|
693
|
+
Refer to com.urovo.sdk.print.PrintFormat.
|
|
694
|
+
```
|
|
695
|
+
|
|
696
|
+
## addImage
|
|
697
|
+
|
|
698
|
+
Add bitmap image print.
|
|
699
|
+
|
|
700
|
+
```java
|
|
701
|
+
void addImage(Bundle format, byte[] imageData)
|
|
702
|
+
```
|
|
703
|
+
|
|
704
|
+
- **类路径:** `com.urovo.sdk.print.PrinterProviderImpl`
|
|
705
|
+
- **Demo Activity(参考):** PrintActivity
|
|
706
|
+
- **源文档章节:** 4.10
|
|
707
|
+
|
|
708
|
+
- Source section: `4.10`
|
|
709
|
+
|
|
710
|
+
- Package/class path: `com.urovo.sdk.print.PrinterProviderImpl`
|
|
711
|
+
|
|
712
|
+
- Demo reference: `UrovoPosSdkDemo/app/src/main/java/com/urovo/sdk/view/PrintActivity.java`
|
|
713
|
+
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
Purpose:
|
|
717
|
+
Add bitmap image print.
|
|
718
|
+
|
|
719
|
+
|
|
720
|
+
Signature/prototype:
|
|
721
|
+
```java
|
|
722
|
+
void addImage(Bundle format, byte[] imageData)
|
|
723
|
+
```
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
Parameters:
|
|
727
|
+
input
|
|
728
|
+
format - print format, set print position, height,width.
|
|
729
|
+
offset(int): print start position, if offset<=0, aligh, align takes effect.
|
|
730
|
+
width(int): width.(max is 380)
|
|
731
|
+
height(int): height
|
|
732
|
+
imageData - image content.
|
|
733
|
+
output
|
|
734
|
+
None
|
|
735
|
+
|
|
736
|
+
|
|
737
|
+
Source details:
|
|
738
|
+
```text
|
|
739
|
+
Prototype
|
|
740
|
+
void addImage(Bundle format, byte[] imageData)
|
|
741
|
+
Description
|
|
742
|
+
Add bitmap image print.
|
|
743
|
+
Parameters
|
|
744
|
+
input
|
|
745
|
+
format - print format, set print position, height,width.
|
|
746
|
+
offset(int): print start position, if offset<=0, aligh, align takes effect.
|
|
747
|
+
width(int): width.(max is 380)
|
|
748
|
+
height(int): height
|
|
749
|
+
imageData - image content.
|
|
750
|
+
output
|
|
751
|
+
None
|
|
752
|
+
Return
|
|
753
|
+
|
|
754
|
+
Remark
|
|
755
|
+
```
|
|
756
|
+
|
|
757
|
+
## feedLine
|
|
758
|
+
|
|
759
|
+
Add feedline.
|
|
760
|
+
|
|
761
|
+
```java
|
|
762
|
+
void feedLine(int lines)
|
|
763
|
+
```
|
|
764
|
+
|
|
765
|
+
- **类路径:** `com.urovo.sdk.print.PrinterProviderImpl`
|
|
766
|
+
- **Demo Activity(参考):** PrintActivity
|
|
767
|
+
- **源文档章节:** 4.11
|
|
768
|
+
|
|
769
|
+
- Source section: `4.11`
|
|
770
|
+
|
|
771
|
+
- Package/class path: `com.urovo.sdk.print.PrinterProviderImpl`
|
|
772
|
+
|
|
773
|
+
- Demo reference: `UrovoPosSdkDemo/app/src/main/java/com/urovo/sdk/view/PrintActivity.java`
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
|
|
777
|
+
Purpose:
|
|
778
|
+
Add feedline.
|
|
779
|
+
|
|
780
|
+
|
|
781
|
+
Signature/prototype:
|
|
782
|
+
```java
|
|
783
|
+
void feedLine(int lines)
|
|
784
|
+
```
|
|
785
|
+
|
|
786
|
+
|
|
787
|
+
Parameters:
|
|
788
|
+
input
|
|
789
|
+
lines - number of lines.
|
|
790
|
+
//If lines=0, add blank space at the bottom.
|
|
791
|
+
//If lines=-1, no blank space at the bottom.
|
|
792
|
+
output
|
|
793
|
+
None
|
|
794
|
+
|
|
795
|
+
|
|
796
|
+
Usage notes:
|
|
797
|
+
Refer to com.urovo.sdk.print.PrintFormat.
|
|
798
|
+
|
|
799
|
+
|
|
800
|
+
Source details:
|
|
801
|
+
```text
|
|
802
|
+
Prototype
|
|
803
|
+
void feedLine(int lines)
|
|
804
|
+
Description
|
|
805
|
+
Add feedline.
|
|
806
|
+
Parameters
|
|
807
|
+
input
|
|
808
|
+
lines - number of lines.
|
|
809
|
+
//If lines=0, add blank space at the bottom.
|
|
810
|
+
//If lines=-1, no blank space at the bottom.
|
|
811
|
+
output
|
|
812
|
+
None
|
|
813
|
+
Return
|
|
814
|
+
|
|
815
|
+
Remark
|
|
816
|
+
Refer to com.urovo.sdk.print.PrintFormat.
|
|
817
|
+
```
|
|
818
|
+
|
|
819
|
+
## startPrint
|
|
820
|
+
|
|
821
|
+
Start the printing process.
|
|
822
|
+
|
|
823
|
+
```java
|
|
824
|
+
int startPrint()
|
|
825
|
+
```
|
|
826
|
+
|
|
827
|
+
- **类路径:** `com.urovo.sdk.print.PrinterProviderImpl`
|
|
828
|
+
- **Demo Activity(参考):** PrintActivity
|
|
829
|
+
- **源文档章节:** 4.12
|
|
830
|
+
|
|
831
|
+
- Source section: `4.12`
|
|
832
|
+
|
|
833
|
+
- Package/class path: `com.urovo.sdk.print.PrinterProviderImpl`
|
|
834
|
+
|
|
835
|
+
- Demo reference: `UrovoPosSdkDemo/app/src/main/java/com/urovo/sdk/view/PrintActivity.java`
|
|
836
|
+
|
|
837
|
+
|
|
838
|
+
|
|
839
|
+
Purpose:
|
|
840
|
+
Start the printing process.
|
|
841
|
+
|
|
842
|
+
|
|
843
|
+
Signature/prototype:
|
|
844
|
+
```java
|
|
845
|
+
int startPrint()
|
|
846
|
+
```
|
|
847
|
+
|
|
848
|
+
|
|
849
|
+
Return value:
|
|
850
|
+
printStatus -Refer to com.urovo.sdk.print.PrintStatus.
|
|
851
|
+
/**
|
|
852
|
+
0x00-success;
|
|
853
|
+
0xF0-no paper;
|
|
854
|
+
0xF3-over heart;
|
|
855
|
+
0xE1-low val;
|
|
856
|
+
0xF7-printer busy;
|
|
857
|
+
0xF2-hardware error;
|
|
858
|
+
others:print failed;
|
|
859
|
+
**/
|
|
860
|
+
|
|
861
|
+
|
|
862
|
+
Simplified example:
|
|
863
|
+
```java
|
|
864
|
+
PrinterProviderImpl printer = PrinterProviderImpl.getInstance(context);
|
|
865
|
+
printer.addText("APPROVED", 24, Align.CENTER, true);
|
|
866
|
+
printer.feedLine(3);
|
|
867
|
+
printer.startPrint();
|
|
868
|
+
```
|
|
869
|
+
|
|
870
|
+
|
|
871
|
+
Source details:
|
|
872
|
+
```text
|
|
873
|
+
Prototype
|
|
874
|
+
int startPrint()
|
|
875
|
+
Description
|
|
876
|
+
Start the printing process.
|
|
877
|
+
Return
|
|
878
|
+
printStatus -Refer to com.urovo.sdk.print.PrintStatus.
|
|
879
|
+
/**
|
|
880
|
+
0x00-success;
|
|
881
|
+
0xF0-no paper;
|
|
882
|
+
0xF3-over heart;
|
|
883
|
+
0xE1-low val;
|
|
884
|
+
0xF7-printer busy;
|
|
885
|
+
0xF2-hardware error;
|
|
886
|
+
others:print failed;
|
|
887
|
+
**/
|
|
888
|
+
```
|
|
889
|
+
|
|
890
|
+
## addImageWithText
|
|
891
|
+
|
|
892
|
+
Add bitmap image print
|
|
893
|
+
|
|
894
|
+
```java
|
|
895
|
+
void addImageWithText(Bundle format, byte[] imageData)
|
|
896
|
+
```
|
|
897
|
+
|
|
898
|
+
- **类路径:** `com.urovo.sdk.print.PrinterProviderImpl`
|
|
899
|
+
- **Demo Activity(参考):** PrintActivity
|
|
900
|
+
- **源文档章节:** 4.13
|
|
901
|
+
|
|
902
|
+
- Source section: `4.13`
|
|
903
|
+
|
|
904
|
+
- Package/class path: `com.urovo.sdk.print.PrinterProviderImpl`
|
|
905
|
+
|
|
906
|
+
- Demo reference: `UrovoPosSdkDemo/app/src/main/java/com/urovo/sdk/view/PrintActivity.java`
|
|
907
|
+
|
|
908
|
+
|
|
909
|
+
|
|
910
|
+
Purpose:
|
|
911
|
+
Add bitmap image print
|
|
912
|
+
|
|
913
|
+
|
|
914
|
+
Signature/prototype:
|
|
915
|
+
```java
|
|
916
|
+
void addImageWithText(Bundle format, byte[] imageData)
|
|
917
|
+
```
|
|
918
|
+
|
|
919
|
+
|
|
920
|
+
Parameters:
|
|
921
|
+
input
|
|
922
|
+
format - print format, set print position, height,width.
|
|
923
|
+
align: for image, 0-left, 1-center, 2-right.
|
|
924
|
+
offset(int): print start position, if offset<=0, aligh, align takes effect.
|
|
925
|
+
width(int): width.
|
|
926
|
+
height(int): height.
|
|
927
|
+
YAlign(int): for text, 0-top, 1-center, 2-bottom.
|
|
928
|
+
text(String): text to content.
|
|
929
|
+
font(int): font size, 0-samll, 1-normal, 2-large.
|
|
930
|
+
fontBold(boolean): default: false.
|
|
931
|
+
align(int): alignment, default left, 0: left, 1: center, 2: right
|
|
932
|
+
fontName(string) : font to be used, otherwise, default system font is used. Or custom fonts i.e. /mnt/sdcard/xxx.ttf the path.
|
|
933
|
+
imageData - image content.
|
|
934
|
+
output
|
|
935
|
+
None
|
|
936
|
+
|
|
937
|
+
|
|
938
|
+
Source details:
|
|
939
|
+
```text
|
|
940
|
+
Prototype
|
|
941
|
+
void addImageWithText(Bundle format, byte[] imageData)
|
|
942
|
+
Description
|
|
943
|
+
Add bitmap image print
|
|
944
|
+
Parameters
|
|
945
|
+
input
|
|
946
|
+
format - print format, set print position, height,width.
|
|
947
|
+
align: for image, 0-left, 1-center, 2-right.
|
|
948
|
+
offset(int): print start position, if offset<=0, aligh, align takes effect.
|
|
949
|
+
width(int): width.
|
|
950
|
+
height(int): height.
|
|
951
|
+
YAlign(int): for text, 0-top, 1-center, 2-bottom.
|
|
952
|
+
text(String): text to content.
|
|
953
|
+
font(int): font size, 0-samll, 1-normal, 2-large.
|
|
954
|
+
fontBold(boolean): default: false.
|
|
955
|
+
align(int): alignment, default left, 0: left, 1: center, 2: right
|
|
956
|
+
fontName(string) : font to be used, otherwise, default system font is used. Or custom fonts i.e. /mnt/sdcard/xxx.ttf the path.
|
|
957
|
+
imageData - image content.
|
|
958
|
+
output
|
|
959
|
+
None
|
|
960
|
+
Return
|
|
961
|
+
|
|
962
|
+
Remark
|
|
963
|
+
```
|
|
964
|
+
|
|
965
|
+
## addHtml
|
|
966
|
+
|
|
967
|
+
Add html content.
|
|
968
|
+
|
|
969
|
+
```java
|
|
970
|
+
void addHtml(Bundle format, String content)
|
|
971
|
+
```
|
|
972
|
+
|
|
973
|
+
- **类路径:** `com.urovo.sdk.print.PrinterProviderImpl`
|
|
974
|
+
- **Demo Activity(参考):** PrintActivity
|
|
975
|
+
- **源文档章节:** 4.14
|
|
976
|
+
|
|
977
|
+
- Source section: `4.14`
|
|
978
|
+
|
|
979
|
+
- Package/class path: `com.urovo.sdk.print.PrinterProviderImpl`
|
|
980
|
+
|
|
981
|
+
- Demo reference: `UrovoPosSdkDemo/app/src/main/java/com/urovo/sdk/view/PrintActivity.java`
|
|
982
|
+
|
|
983
|
+
|
|
984
|
+
|
|
985
|
+
Purpose:
|
|
986
|
+
Add html content.
|
|
987
|
+
|
|
988
|
+
|
|
989
|
+
Signature/prototype:
|
|
990
|
+
```java
|
|
991
|
+
void addHtml(Bundle format, String content)
|
|
992
|
+
```
|
|
993
|
+
|
|
994
|
+
|
|
995
|
+
Parameters:
|
|
996
|
+
input
|
|
997
|
+
format - print format, set print position, height,width
|
|
998
|
+
offset(int): print start position, if offset<=0, aligh, align takes effect.
|
|
999
|
+
width(int): width.(max is 380)
|
|
1000
|
+
height(int): height
|
|
1001
|
+
content: html content.
|
|
1002
|
+
output
|
|
1003
|
+
None
|
|
1004
|
+
|
|
1005
|
+
|
|
1006
|
+
Source details:
|
|
1007
|
+
```text
|
|
1008
|
+
Prototype
|
|
1009
|
+
void addHtml(Bundle format, String content)
|
|
1010
|
+
Description
|
|
1011
|
+
Add html content.
|
|
1012
|
+
Parameters
|
|
1013
|
+
input
|
|
1014
|
+
format - print format, set print position, height,width
|
|
1015
|
+
offset(int): print start position, if offset<=0, aligh, align takes effect.
|
|
1016
|
+
width(int): width.(max is 380)
|
|
1017
|
+
height(int): height
|
|
1018
|
+
content: html content.
|
|
1019
|
+
output
|
|
1020
|
+
None
|
|
1021
|
+
Return
|
|
1022
|
+
|
|
1023
|
+
Remark
|
|
1024
|
+
```
|
|
1025
|
+
|
|
1026
|
+
## addBlankLine
|
|
1027
|
+
|
|
1028
|
+
Add blank line.
|
|
1029
|
+
|
|
1030
|
+
```java
|
|
1031
|
+
void addBlankLine(int height)
|
|
1032
|
+
```
|
|
1033
|
+
|
|
1034
|
+
- **类路径:** `com.urovo.sdk.print.PrinterProviderImpl`
|
|
1035
|
+
- **Demo Activity(参考):** PrintActivity
|
|
1036
|
+
- **源文档章节:** 4.15
|
|
1037
|
+
|
|
1038
|
+
- Source section: `4.15`
|
|
1039
|
+
|
|
1040
|
+
- Package/class path: `com.urovo.sdk.print.PrinterProviderImpl`
|
|
1041
|
+
|
|
1042
|
+
- Demo reference: `UrovoPosSdkDemo/app/src/main/java/com/urovo/sdk/view/PrintActivity.java`
|
|
1043
|
+
|
|
1044
|
+
|
|
1045
|
+
|
|
1046
|
+
Purpose:
|
|
1047
|
+
Add blank line.
|
|
1048
|
+
|
|
1049
|
+
|
|
1050
|
+
Signature/prototype:
|
|
1051
|
+
```java
|
|
1052
|
+
void addBlankLine(int height)
|
|
1053
|
+
```
|
|
1054
|
+
|
|
1055
|
+
|
|
1056
|
+
Parameters:
|
|
1057
|
+
input
|
|
1058
|
+
height - the blank height.
|
|
1059
|
+
output
|
|
1060
|
+
None
|
|
1061
|
+
|
|
1062
|
+
|
|
1063
|
+
Source details:
|
|
1064
|
+
```text
|
|
1065
|
+
Prototype
|
|
1066
|
+
void addBlankLine(int height)
|
|
1067
|
+
Description
|
|
1068
|
+
Add blank line.
|
|
1069
|
+
Parameters
|
|
1070
|
+
input
|
|
1071
|
+
height - the blank height.
|
|
1072
|
+
output
|
|
1073
|
+
None
|
|
1074
|
+
Return
|
|
1075
|
+
|
|
1076
|
+
Remark
|
|
1077
|
+
```
|
|
1078
|
+
|
|
1079
|
+
## setSpeed
|
|
1080
|
+
|
|
1081
|
+
Set printer speed.
|
|
1082
|
+
|
|
1083
|
+
```java
|
|
1084
|
+
int setSpeed(int speedLevel)
|
|
1085
|
+
```
|
|
1086
|
+
|
|
1087
|
+
- **类路径:** `com.urovo.sdk.print.PrinterProviderImpl`
|
|
1088
|
+
- **Demo Activity(参考):** PrintActivity
|
|
1089
|
+
- **源文档章节:** 4.16
|
|
1090
|
+
|
|
1091
|
+
- Source section: `4.16`
|
|
1092
|
+
|
|
1093
|
+
- Package/class path: `com.urovo.sdk.print.PrinterProviderImpl`
|
|
1094
|
+
|
|
1095
|
+
- Demo reference: `UrovoPosSdkDemo/app/src/main/java/com/urovo/sdk/view/PrintActivity.java`
|
|
1096
|
+
|
|
1097
|
+
|
|
1098
|
+
|
|
1099
|
+
Purpose:
|
|
1100
|
+
Set printer speed.
|
|
1101
|
+
|
|
1102
|
+
|
|
1103
|
+
Signature/prototype:
|
|
1104
|
+
```java
|
|
1105
|
+
int setSpeed(int speedLevel)
|
|
1106
|
+
```
|
|
1107
|
+
|
|
1108
|
+
|
|
1109
|
+
Parameters:
|
|
1110
|
+
input
|
|
1111
|
+
speedLevel - 10-20.
|
|
1112
|
+
output
|
|
1113
|
+
None
|
|
1114
|
+
|
|
1115
|
+
|
|
1116
|
+
Return value:
|
|
1117
|
+
0-success, others:failed.
|
|
1118
|
+
|
|
1119
|
+
|
|
1120
|
+
Source details:
|
|
1121
|
+
```text
|
|
1122
|
+
Prototype
|
|
1123
|
+
int setSpeed(int speedLevel)
|
|
1124
|
+
Description
|
|
1125
|
+
Set printer speed.
|
|
1126
|
+
Parameters
|
|
1127
|
+
input
|
|
1128
|
+
speedLevel - 10-20.
|
|
1129
|
+
output
|
|
1130
|
+
None
|
|
1131
|
+
Return
|
|
1132
|
+
0-success, others:failed.
|
|
1133
|
+
Remark
|
|
1134
|
+
```
|
|
1135
|
+
|
|
1136
|
+
## addBlackLine
|
|
1137
|
+
|
|
1138
|
+
Add blank line.
|
|
1139
|
+
|
|
1140
|
+
```java
|
|
1141
|
+
void addBlackLine(int... lineHeight)
|
|
1142
|
+
```
|
|
1143
|
+
|
|
1144
|
+
- **类路径:** `com.urovo.sdk.print.PrinterProviderImpl`
|
|
1145
|
+
- **Demo Activity(参考):** PrintActivity
|
|
1146
|
+
- **源文档章节:** 4.17
|
|
1147
|
+
|
|
1148
|
+
- Source section: `4.17`
|
|
1149
|
+
|
|
1150
|
+
- Package/class path: `com.urovo.sdk.print.PrinterProviderImpl`
|
|
1151
|
+
|
|
1152
|
+
- Demo reference: `UrovoPosSdkDemo/app/src/main/java/com/urovo/sdk/view/PrintActivity.java`
|
|
1153
|
+
|
|
1154
|
+
|
|
1155
|
+
|
|
1156
|
+
Purpose:
|
|
1157
|
+
Add blank line.
|
|
1158
|
+
|
|
1159
|
+
|
|
1160
|
+
Signature/prototype:
|
|
1161
|
+
```java
|
|
1162
|
+
void addBlackLine(int... lineHeight)
|
|
1163
|
+
```
|
|
1164
|
+
|
|
1165
|
+
|
|
1166
|
+
Parameters:
|
|
1167
|
+
input
|
|
1168
|
+
lineHeight - the distance of each line.
|
|
1169
|
+
//Opitional, variable length.
|
|
1170
|
+
output
|
|
1171
|
+
None
|
|
1172
|
+
|
|
1173
|
+
|
|
1174
|
+
Source details:
|
|
1175
|
+
```text
|
|
1176
|
+
Prototype
|
|
1177
|
+
void addBlackLine(int... lineHeight)
|
|
1178
|
+
Description
|
|
1179
|
+
Add blank line.
|
|
1180
|
+
Parameters
|
|
1181
|
+
input
|
|
1182
|
+
lineHeight - the distance of each line.
|
|
1183
|
+
//Opitional, variable length.
|
|
1184
|
+
output
|
|
1185
|
+
None
|
|
1186
|
+
Return
|
|
1187
|
+
|
|
1188
|
+
Remark
|
|
1189
|
+
```
|
|
1190
|
+
|
|
1191
|
+
## supportLabelPrint
|
|
1192
|
+
|
|
1193
|
+
Return whether label printing function is supported.
|
|
1194
|
+
|
|
1195
|
+
```java
|
|
1196
|
+
boolean supportLabelPrint()
|
|
1197
|
+
```
|
|
1198
|
+
|
|
1199
|
+
- **类路径:** `com.urovo.sdk.print.PrinterProviderImpl`
|
|
1200
|
+
- **Demo Activity(参考):** PrintActivity
|
|
1201
|
+
- **源文档章节:** 4.18
|
|
1202
|
+
|
|
1203
|
+
- Source section: `4.18`
|
|
1204
|
+
|
|
1205
|
+
- Package/class path: `com.urovo.sdk.print.PrinterProviderImpl`
|
|
1206
|
+
|
|
1207
|
+
- Demo reference: `UrovoPosSdkDemo/app/src/main/java/com/urovo/sdk/view/PrintActivity.java`
|
|
1208
|
+
|
|
1209
|
+
|
|
1210
|
+
|
|
1211
|
+
Purpose:
|
|
1212
|
+
Return whether label printing function is supported.
|
|
1213
|
+
|
|
1214
|
+
|
|
1215
|
+
Signature/prototype:
|
|
1216
|
+
```java
|
|
1217
|
+
boolean supportLabelPrint()
|
|
1218
|
+
```
|
|
1219
|
+
|
|
1220
|
+
|
|
1221
|
+
Return value:
|
|
1222
|
+
True:Supported
|
|
1223
|
+
False:Not supported
|
|
1224
|
+
|
|
1225
|
+
|
|
1226
|
+
Source details:
|
|
1227
|
+
```text
|
|
1228
|
+
Prototype
|
|
1229
|
+
boolean supportLabelPrint()
|
|
1230
|
+
Description
|
|
1231
|
+
Return whether label printing function is supported.
|
|
1232
|
+
Return
|
|
1233
|
+
True:Supported
|
|
1234
|
+
False:Not supported
|
|
1235
|
+
```
|
|
1236
|
+
|
|
1237
|
+
## setPrinterMode
|
|
1238
|
+
|
|
1239
|
+
Set printer mode.
|
|
1240
|
+
|
|
1241
|
+
```java
|
|
1242
|
+
int setPrinterMode(boolean data)
|
|
1243
|
+
```
|
|
1244
|
+
|
|
1245
|
+
- **类路径:** `com.urovo.sdk.print.PrinterProviderImpl`
|
|
1246
|
+
- **Demo Activity(参考):** PrintActivity
|
|
1247
|
+
- **源文档章节:** 4.19
|
|
1248
|
+
|
|
1249
|
+
- Source section: `4.19`
|
|
1250
|
+
|
|
1251
|
+
- Package/class path: `com.urovo.sdk.print.PrinterProviderImpl`
|
|
1252
|
+
|
|
1253
|
+
- Demo reference: `UrovoPosSdkDemo/app/src/main/java/com/urovo/sdk/view/PrintActivity.java`
|
|
1254
|
+
|
|
1255
|
+
|
|
1256
|
+
|
|
1257
|
+
Purpose:
|
|
1258
|
+
Set printer mode.
|
|
1259
|
+
|
|
1260
|
+
|
|
1261
|
+
Signature/prototype:
|
|
1262
|
+
```java
|
|
1263
|
+
int setPrinterMode(boolean data)
|
|
1264
|
+
```
|
|
1265
|
+
|
|
1266
|
+
|
|
1267
|
+
Parameters:
|
|
1268
|
+
input
|
|
1269
|
+
true - Label mode
|
|
1270
|
+
false - Normal mode.
|
|
1271
|
+
output
|
|
1272
|
+
None
|
|
1273
|
+
|
|
1274
|
+
|
|
1275
|
+
Return value:
|
|
1276
|
+
True:Setting successful
|
|
1277
|
+
False:Setting failed.
|
|
1278
|
+
|
|
1279
|
+
|
|
1280
|
+
Source details:
|
|
1281
|
+
```text
|
|
1282
|
+
Prototype
|
|
1283
|
+
int setPrinterMode(boolean data)
|
|
1284
|
+
Description
|
|
1285
|
+
Set printer mode.
|
|
1286
|
+
Parameters
|
|
1287
|
+
input
|
|
1288
|
+
true - Label mode
|
|
1289
|
+
false - Normal mode.
|
|
1290
|
+
output
|
|
1291
|
+
None
|
|
1292
|
+
Return
|
|
1293
|
+
True:Setting successful
|
|
1294
|
+
False:Setting failed.
|
|
1295
|
+
```
|
|
1296
|
+
|
|
1297
|
+
## setLabelFeed
|
|
1298
|
+
|
|
1299
|
+
Set label printing mode.
|
|
1300
|
+
Before executing label printing each time, you need to set PRN_LABEL_LOCATION or PRN_LABEL_CONTINUE. After printing is completed, you need to set PRN_LABEL_END.
|
|
1301
|
+
|
|
1302
|
+
```java
|
|
1303
|
+
int setLabelFeed(byte state)
|
|
1304
|
+
```
|
|
1305
|
+
|
|
1306
|
+
- **类路径:** `com.urovo.sdk.print.PrinterProviderImpl`
|
|
1307
|
+
- **Demo Activity(参考):** PrintActivity
|
|
1308
|
+
- **源文档章节:** 4.20
|
|
1309
|
+
|
|
1310
|
+
- Source section: `4.20`
|
|
1311
|
+
|
|
1312
|
+
- Package/class path: `com.urovo.sdk.print.PrinterProviderImpl`
|
|
1313
|
+
|
|
1314
|
+
- Demo reference: `UrovoPosSdkDemo/app/src/main/java/com/urovo/sdk/view/PrintActivity.java`
|
|
1315
|
+
|
|
1316
|
+
|
|
1317
|
+
|
|
1318
|
+
Purpose:
|
|
1319
|
+
Set label printing mode.
|
|
1320
|
+
Before executing label printing each time, you need to set PRN_LABEL_LOCATION or PRN_LABEL_CONTINUE. After printing is completed, you need to set PRN_LABEL_END.
|
|
1321
|
+
|
|
1322
|
+
|
|
1323
|
+
Signature/prototype:
|
|
1324
|
+
```java
|
|
1325
|
+
int setLabelFeed(byte state)
|
|
1326
|
+
```
|
|
1327
|
+
|
|
1328
|
+
|
|
1329
|
+
Parameters:
|
|
1330
|
+
input
|
|
1331
|
+
com.urovo.sdk.print.PrinterLabelState
|
|
1332
|
+
PRN_LABEL_STUDY = 0x00;
|
|
1333
|
+
(Learning label height, this feature is not available.)
|
|
1334
|
+
|
|
1335
|
+
PRN_LABEL_LOCATION = 0x01;
|
|
1336
|
+
(Label positioning, can be set for both single and multiple prints.)
|
|
1337
|
+
|
|
1338
|
+
PRN_LABEL_CONTINUE = 0x02;
|
|
1339
|
+
(Label continuous printing settings.)
|
|
1340
|
+
|
|
1341
|
+
PRN_LABEL_END = 0x03;
|
|
1342
|
+
(Settings after label printing is completed.)
|
|
1343
|
+
output
|
|
1344
|
+
None
|
|
1345
|
+
|
|
1346
|
+
|
|
1347
|
+
Return value:
|
|
1348
|
+
0:Setting successful
|
|
1349
|
+
Other:Setting failed.
|
|
1350
|
+
|
|
1351
|
+
Printer Error Code Definition
|
|
1352
|
+
Error Code
|
|
1353
|
+
Error Description
|
|
1354
|
+
0x00
|
|
1355
|
+
Success
|
|
1356
|
+
0xF0
|
|
1357
|
+
No paper
|
|
1358
|
+
0xF3
|
|
1359
|
+
Over heart
|
|
1360
|
+
0xE1
|
|
1361
|
+
Low val
|
|
1362
|
+
0xF2
|
|
1363
|
+
Hardware error
|
|
1364
|
+
0xF7
|
|
1365
|
+
Printer busy
|
|
1366
|
+
|
|
1367
|
+
|
|
1368
|
+
Source details:
|
|
1369
|
+
```text
|
|
1370
|
+
Prototype
|
|
1371
|
+
int setLabelFeed(byte state)
|
|
1372
|
+
Description
|
|
1373
|
+
Set label printing mode.
|
|
1374
|
+
Before executing label printing each time, you need to set PRN_LABEL_LOCATION or PRN_LABEL_CONTINUE. After printing is completed, you need to set PRN_LABEL_END.
|
|
1375
|
+
Parameters
|
|
1376
|
+
input
|
|
1377
|
+
com.urovo.sdk.print.PrinterLabelState
|
|
1378
|
+
PRN_LABEL_STUDY = 0x00;
|
|
1379
|
+
(Learning label height, this feature is not available.)
|
|
1380
|
+
|
|
1381
|
+
PRN_LABEL_LOCATION = 0x01;
|
|
1382
|
+
(Label positioning, can be set for both single and multiple prints.)
|
|
1383
|
+
|
|
1384
|
+
PRN_LABEL_CONTINUE = 0x02;
|
|
1385
|
+
(Label continuous printing settings.)
|
|
1386
|
+
|
|
1387
|
+
PRN_LABEL_END = 0x03;
|
|
1388
|
+
(Settings after label printing is completed.)
|
|
1389
|
+
output
|
|
1390
|
+
None
|
|
1391
|
+
Return
|
|
1392
|
+
0:Setting successful
|
|
1393
|
+
Other:Setting failed.
|
|
1394
|
+
|
|
1395
|
+
Printer Error Code Definition
|
|
1396
|
+
Error Code
|
|
1397
|
+
Error Description
|
|
1398
|
+
0x00
|
|
1399
|
+
Success
|
|
1400
|
+
0xF0
|
|
1401
|
+
No paper
|
|
1402
|
+
0xF3
|
|
1403
|
+
Over heart
|
|
1404
|
+
0xE1
|
|
1405
|
+
Low val
|
|
1406
|
+
0xF2
|
|
1407
|
+
Hardware error
|
|
1408
|
+
0xF7
|
|
1409
|
+
Printer busy
|
|
1410
|
+
```
|