@connexup/react-native-xprinter 0.1.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.
Files changed (145) hide show
  1. package/LICENSE +20 -0
  2. package/NativeXPrinter.podspec +23 -0
  3. package/README.md +24 -0
  4. package/android/build.gradle +73 -0
  5. package/android/gradle.properties +5 -0
  6. package/android/libs/printer-lib-3.4.7.aar +0 -0
  7. package/android/src/main/AndroidManifest.xml +2 -0
  8. package/android/src/main/java/com/connexup/xprinter/Errors.kt +11 -0
  9. package/android/src/main/java/com/connexup/xprinter/Util.kt +106 -0
  10. package/android/src/main/java/com/connexup/xprinter/XPrinterPackage.kt +77 -0
  11. package/android/src/main/java/com/connexup/xprinter/esc/Convert.kt +211 -0
  12. package/android/src/main/java/com/connexup/xprinter/esc/XPrinterESCModule.kt +1995 -0
  13. package/android/src/main/java/com/connexup/xprinter/printer/Convert.kt +46 -0
  14. package/android/src/main/java/com/connexup/xprinter/printer/DeviceConnection.kt +14 -0
  15. package/android/src/main/java/com/connexup/xprinter/printer/Printers.kt +153 -0
  16. package/android/src/main/java/com/connexup/xprinter/printer/XPrinterPrinterModule.kt +295 -0
  17. package/android/src/main/java/com/connexup/xprinter/tspl/Convert.kt +151 -0
  18. package/android/src/main/java/com/connexup/xprinter/tspl/XPrinterTSPLModule.kt +1408 -0
  19. package/android/src/main/java/com/connexup/xprinter/utils/XPrinterUtilsModule.kt +54 -0
  20. package/ios/ESC/ESCConvert.swift +283 -0
  21. package/ios/ESC/Models/RCTESCPrintBarCodeRequest.swift +23 -0
  22. package/ios/ESC/Models/RCTESCPrintBitmapRequest.swift +23 -0
  23. package/ios/ESC/Models/RCTESCPrintPDF417Request.swift +27 -0
  24. package/ios/ESC/Models/RCTESCPrintQRCodeRequest.swift +19 -0
  25. package/ios/ESC/Models/RCTESCPrintTableBarcode.swift +23 -0
  26. package/ios/ESC/Models/RCTESCPrintTableRequest.swift +19 -0
  27. package/ios/ESC/Models/RCTESCPrintTableRow.swift +19 -0
  28. package/ios/ESC/Models/RCTESCPrintTextRequest.swift +21 -0
  29. package/ios/ESC/Models/RCTESCPrintTextSizeRequest.swift +17 -0
  30. package/ios/ESC/Models/RCTESCSelectBitmapModelRequest.swift +17 -0
  31. package/ios/ESC/Models/RCTESCSetNetAllRequest.swift +19 -0
  32. package/ios/ESC/Models/RCTESCSetPrintAreaRequest.swift +19 -0
  33. package/ios/ESC/Models/RCTESCSetTextStyleRequest.swift +17 -0
  34. package/ios/ESC/Models/RCTESCWifiConfigRequest.swift +23 -0
  35. package/ios/ESC/NativeXPrinterESC.swift +1339 -0
  36. package/ios/ESC/RCTNativeXPrinterESC.h +10 -0
  37. package/ios/ESC/RCTNativeXPrinterESC.mm +541 -0
  38. package/ios/Errors.swift +11 -0
  39. package/ios/NativeErrorInfo.swift +21 -0
  40. package/ios/Printer/Connecter.swift +214 -0
  41. package/ios/Printer/Models/RCTDeviceConnectStatusChangeEvent.swift +19 -0
  42. package/ios/Printer/Models/RCTNetDevice.swift +21 -0
  43. package/ios/Printer/Models/RCTUSBDevice.swift +17 -0
  44. package/ios/Printer/Models/RCTUpdateUdpNetConfigRequest.swift +21 -0
  45. package/ios/Printer/NativeXPrinterPrinter.swift +209 -0
  46. package/ios/Printer/Printers.swift +59 -0
  47. package/ios/Printer/RCTNativeXPrinterPrinter.h +12 -0
  48. package/ios/Printer/RCTNativeXPrinterPrinter.mm +123 -0
  49. package/ios/PrinterSDK/Headers/CPCLCommand.h +324 -0
  50. package/ios/PrinterSDK/Headers/KDS_Log.h +47 -0
  51. package/ios/PrinterSDK/Headers/LabelDocument.h +32 -0
  52. package/ios/PrinterSDK/Headers/LabelImageTranster.h +19 -0
  53. package/ios/PrinterSDK/Headers/POSBLEManager.h +164 -0
  54. package/ios/PrinterSDK/Headers/POSCommand.h +760 -0
  55. package/ios/PrinterSDK/Headers/POSImageTranster.h +34 -0
  56. package/ios/PrinterSDK/Headers/POSPrinter.h +47 -0
  57. package/ios/PrinterSDK/Headers/POSPrinterSDK.h +13 -0
  58. package/ios/PrinterSDK/Headers/POSWIFIManager.h +162 -0
  59. package/ios/PrinterSDK/Headers/PTable.h +50 -0
  60. package/ios/PrinterSDK/Headers/PrinterProfile.h +28 -0
  61. package/ios/PrinterSDK/Headers/TSCBLEManager.h +142 -0
  62. package/ios/PrinterSDK/Headers/TSCCommand.h +701 -0
  63. package/ios/PrinterSDK/Headers/TSCPrinterSDK.h +15 -0
  64. package/ios/PrinterSDK/Headers/TSCWIFIManager.h +99 -0
  65. package/ios/PrinterSDK/Headers/WIFIConnecter.h +131 -0
  66. package/ios/PrinterSDK/Headers/ZPLCommand.h +372 -0
  67. package/ios/PrinterSDK/libPrinterSDK.a +0 -0
  68. package/ios/TSPL/Models/RCTTSPLBarRequest.swift +19 -0
  69. package/ios/TSPL/Models/RCTTSPLBarcodeRequest.swift +29 -0
  70. package/ios/TSPL/Models/RCTTSPLBitmapCompressionRequest.swift +25 -0
  71. package/ios/TSPL/Models/RCTTSPLBitmapRequest.swift +25 -0
  72. package/ios/TSPL/Models/RCTTSPLBoxRequest.swift +21 -0
  73. package/ios/TSPL/Models/RCTTSPLEraseRequest.swift +19 -0
  74. package/ios/TSPL/Models/RCTTSPLPDFBase64Request.swift +21 -0
  75. package/ios/TSPL/Models/RCTTSPLPutBMPRequest.swift +17 -0
  76. package/ios/TSPL/Models/RCTTSPLQRCodeRequest.swift +29 -0
  77. package/ios/TSPL/Models/RCTTSPLReverseRequest.swift +19 -0
  78. package/ios/TSPL/Models/RCTTSPLTextRequest.swift +25 -0
  79. package/ios/TSPL/NativeXPrinterTSPL.swift +831 -0
  80. package/ios/TSPL/RCTNativeXPrinterTSPL.h +10 -0
  81. package/ios/TSPL/RCTNativeXPrinterTSPL.mm +445 -0
  82. package/ios/TSPL/TSPLConvert.swift +140 -0
  83. package/ios/Utils/Models/RCTCheckIsPureWhiteImageRequest.swift +16 -0
  84. package/ios/Utils/NativeXPrinterUtils.swift +17 -0
  85. package/ios/Utils/RCTNativeXPrinterUtils.h +10 -0
  86. package/ios/Utils/RCTNativeXPrinterUtils.mm +38 -0
  87. package/ios/Utils.swift +126 -0
  88. package/lib/module/esc/NativeXPrinterESC.js +218 -0
  89. package/lib/module/esc/NativeXPrinterESC.js.map +1 -0
  90. package/lib/module/esc/index.js +324 -0
  91. package/lib/module/esc/index.js.map +1 -0
  92. package/lib/module/index.js +8 -0
  93. package/lib/module/index.js.map +1 -0
  94. package/lib/module/package.json +1 -0
  95. package/lib/module/printer/NativeXPrinterPrinter.js +30 -0
  96. package/lib/module/printer/NativeXPrinterPrinter.js.map +1 -0
  97. package/lib/module/printer/index.js +110 -0
  98. package/lib/module/printer/index.js.map +1 -0
  99. package/lib/module/tspl/NativeXPrinterTSPL.js +143 -0
  100. package/lib/module/tspl/NativeXPrinterTSPL.js.map +1 -0
  101. package/lib/module/tspl/index.js +347 -0
  102. package/lib/module/tspl/index.js.map +1 -0
  103. package/lib/module/type.js +12 -0
  104. package/lib/module/type.js.map +1 -0
  105. package/lib/module/util.js +4 -0
  106. package/lib/module/util.js.map +1 -0
  107. package/lib/module/utils/NativeXPrinterUtils.js +5 -0
  108. package/lib/module/utils/NativeXPrinterUtils.js.map +1 -0
  109. package/lib/module/utils/index.js +17 -0
  110. package/lib/module/utils/index.js.map +1 -0
  111. package/lib/typescript/package.json +1 -0
  112. package/lib/typescript/src/esc/NativeXPrinterESC.d.ts +343 -0
  113. package/lib/typescript/src/esc/NativeXPrinterESC.d.ts.map +1 -0
  114. package/lib/typescript/src/esc/index.d.ts +122 -0
  115. package/lib/typescript/src/esc/index.d.ts.map +1 -0
  116. package/lib/typescript/src/index.d.ts +6 -0
  117. package/lib/typescript/src/index.d.ts.map +1 -0
  118. package/lib/typescript/src/printer/NativeXPrinterPrinter.d.ts +61 -0
  119. package/lib/typescript/src/printer/NativeXPrinterPrinter.d.ts.map +1 -0
  120. package/lib/typescript/src/printer/index.d.ts +32 -0
  121. package/lib/typescript/src/printer/index.d.ts.map +1 -0
  122. package/lib/typescript/src/tspl/NativeXPrinterTSPL.d.ts +261 -0
  123. package/lib/typescript/src/tspl/NativeXPrinterTSPL.d.ts.map +1 -0
  124. package/lib/typescript/src/tspl/index.d.ts +128 -0
  125. package/lib/typescript/src/tspl/index.d.ts.map +1 -0
  126. package/lib/typescript/src/type.d.ts +9 -0
  127. package/lib/typescript/src/type.d.ts.map +1 -0
  128. package/lib/typescript/src/util.d.ts +2 -0
  129. package/lib/typescript/src/util.d.ts.map +1 -0
  130. package/lib/typescript/src/utils/NativeXPrinterUtils.d.ts +10 -0
  131. package/lib/typescript/src/utils/NativeXPrinterUtils.d.ts.map +1 -0
  132. package/lib/typescript/src/utils/index.d.ts +9 -0
  133. package/lib/typescript/src/utils/index.d.ts.map +1 -0
  134. package/package.json +178 -0
  135. package/src/esc/NativeXPrinterESC.ts +516 -0
  136. package/src/esc/index.ts +489 -0
  137. package/src/index.ts +5 -0
  138. package/src/printer/NativeXPrinterPrinter.ts +84 -0
  139. package/src/printer/index.ts +160 -0
  140. package/src/tspl/NativeXPrinterTSPL.ts +388 -0
  141. package/src/tspl/index.ts +535 -0
  142. package/src/type.ts +11 -0
  143. package/src/util.ts +1 -0
  144. package/src/utils/NativeXPrinterUtils.ts +14 -0
  145. package/src/utils/index.ts +27 -0
@@ -0,0 +1,701 @@
1
+ //
2
+ // TSCCommand.h
3
+ // Printer
4
+ //
5
+
6
+ #import <Foundation/Foundation.h>
7
+ #import <UIKit/UIKit.h>
8
+
9
+ typedef NS_ENUM (NSUInteger,AutoResponse){
10
+ OFF = 0,//关闭自动返回状态功能
11
+ ON = 1,//打开自动返回状态功能,每打印完一张返回一次
12
+ BATCH = 2,//打开自动返回状态功能,打印完毕后返回一次
13
+ };
14
+
15
+ @interface TSCCommand : NSObject
16
+
17
+ /**
18
+ Defines the label width and length in millimeters.
19
+ 设定标签纸的宽度及长度(单位:毫米)
20
+ @param m Label width
21
+ @param n Label length
22
+ @return Data command
23
+ */
24
+ + (NSData *)sizeBymmWithWidth:(double)m andHeight:(double)n;
25
+
26
+ /**
27
+ Defines the label width and length in inches.
28
+ 设定标签纸的宽度及长度(单位:英寸)
29
+ @param m Label width
30
+ @param n Label length
31
+ @return Data command
32
+ */
33
+ + (NSData *)sizeByinchWithWidth:(double)m andHeight:(double)n;
34
+
35
+ /**
36
+ Defines the label width and height in dots.
37
+ 设定标签纸的宽度及高度(单位:点)
38
+ @param m Label width
39
+ @param n Label height
40
+ @return Data command
41
+ */
42
+ + (NSData *)sizeBydotWithWidth:(int)m andHeight:(int)n;
43
+
44
+ /**
45
+ Defines the gap distance between two labels vertically.
46
+ 设置标签纸的垂直间距(单位:毫米)
47
+ @param m Gap distance between two labels
48
+ @param n Offset distance of the gap
49
+ @return Data command
50
+ */
51
+ + (NSData *)gapBymmWithWidth:(double)m andHeight:(double)n;
52
+
53
+ /**
54
+ Defines the gap distance between two labels vertically.
55
+ 设置标签纸的垂直间距(单位:英寸)
56
+ @param m Gap distance between two labels
57
+ @param n Offset distance of the gap
58
+ @return Data command
59
+ */
60
+ + (NSData *)gapByinchWithWidth:(double)m andHeight:(double)n;
61
+
62
+ /**
63
+ Defines the gap distance between two labels vertically.
64
+ 设置标签纸的垂直间距(单位:点)
65
+ @param m Gap distance between two labels
66
+ @param n Offset distance of the gap
67
+ @return Data command
68
+ */
69
+ + (NSData *)gapBydotWithWidth:(int)m andHeight:(int)n;
70
+
71
+ /**
72
+ Feeds the paper through the gap sensor to determine the paper and gap sizes.
73
+ 在通过间隙传感器的努力下,对纸张和间隙的大小进行测量(单位:点)
74
+ @param x Paper length in dots
75
+ @param y Gap length in dots
76
+ @return Data command
77
+ */
78
+ + (NSData *)gapDetectWithX:(int)x andY:(int)y;
79
+
80
+ /**
81
+ Feeds the paper through the gap sensor to determine the paper and gap sizes.
82
+ 通过间隙传感器将纸张送出,以确定纸张和间隙的大小
83
+ @return Data command
84
+ */
85
+ + (NSData *)gapDetect;
86
+
87
+ /**
88
+ Feeds the paper through the black mark sensor to determine the paper and black mark size.
89
+ 通过黑标传感器将纸张送出,以确定纸张和黑标的大小(单位:点)
90
+ @param x Paper length in dots
91
+ @param y Black mark length in dots
92
+ @return Data command
93
+ */
94
+ + (NSData *)blinedDetectWithX:(int)x andY:(int)y;
95
+
96
+ /**
97
+ Feeds the paper through the gap/black mark sensor to determine the paper and gap/black mark size.
98
+ 通过间隙/黑标传感器将纸张送出,以确定纸张和间隙/黑标的大小(单位:点)
99
+ @param x Paper length in dots
100
+ @param y Gap/Black mark length in dots
101
+ @return Data command
102
+ */
103
+ + (NSData *)autoDetectWithX:(int)x andY:(int)y;
104
+
105
+ /**
106
+ Sets the height of the black line and the extra label feeding length.
107
+ 设置黑线的高度和用户定义的每次进纸所需的额外标签进纸长度(单位:英寸)
108
+ @param m Height of black line in millimeters
109
+ @param n Extra label feeding length
110
+ @return Data command
111
+ */
112
+ + (NSData *)blineByinchWithM:(double)m andN:(double)n;
113
+
114
+
115
+ /**
116
+ Sets the height of the black line and the user-defined extra label feeding length for each feed action.
117
+ 设定黑标的高度及偏移位置(单位:毫米)
118
+ @param m Height of black line in inches
119
+ @param n Extra label feeding length
120
+ @return Data command
121
+ */
122
+ + (NSData *)blineBymmWithM:(double)m andN:(double)n;
123
+
124
+ /**
125
+ Sets the height of the black line and the user-defined extra label feeding length for each feed action.
126
+ 设定黑标的高度及偏移位置(单位:点)
127
+ @param m Height of black line in dots
128
+ @param n Extra label feeding length
129
+ @return Data command
130
+ */
131
+ + (NSData *)blineBydotWithM:(int)m andN:(int)n;
132
+
133
+ /**
134
+ Sets the position of label under the peel-off mode.
135
+ 在剥离模式下,设置每张标签停止的位置(单位:英寸)
136
+ @param m Offset distance (in inches)
137
+ @return Data command
138
+ */
139
+ + (NSData *)offSetByinchWithM:(double)m;
140
+
141
+ /**
142
+ Sets the position of label under the peel-off mode.
143
+ 在剥离模式下,设置每张标签停止的位置(单位:毫米)
144
+ @param m Offset distance (in millimeters)
145
+ @return Data command
146
+ */
147
+ + (NSData *)offSetBymmWithM:(double)m;
148
+
149
+ /**
150
+ Sets the position of label under the peel-off mode.
151
+ 在剥离模式下,设置每张标签停止的位置(单位:点)
152
+ @param m Offset distance (in dots)
153
+ @return Data command
154
+ */
155
+ + (NSData *)offSetBydotWithM:(int)m;
156
+
157
+ /**
158
+ Defines the print speed.
159
+ 设置走纸速度(单位:英寸/秒)
160
+ @param n Printing speed in inches per second
161
+ @return Data command
162
+ */
163
+ + (NSData *)speed:(double)n;
164
+
165
+ /**
166
+ Sets the printing darkness.
167
+ 设置打印浓度
168
+ @param n Specifies the lightest/darkest level
169
+ @return Data command
170
+ */
171
+ + (NSData *)density:(int)n;
172
+
173
+
174
+ /**
175
+ Defines the printout direction and mirror image. This will be stored in the printer memory.
176
+ 定义打印时出纸方向
177
+ DIRECTION n
178
+ @param n 0 or 1, please refer to the illustrations below.
179
+ @return Data command
180
+ */
181
+ + (NSData *)direction:(int)n;
182
+
183
+ /**
184
+ Defines the reference point of the label. The reference (origin) point varies with the print direction, as shown.
185
+ 用于定义标签的参考坐标原点
186
+ REFERENCE x,y
187
+ @param x Horizontal coordinate (in dots)
188
+ @param y Vertical coordinate (in dots)
189
+ @return Data command
190
+ */
191
+ + (NSData *)referenceWithX:(int)x andY:(int)y;
192
+
193
+ /**
194
+ Moves the label's vertical position.
195
+ 移动标签的垂直位置
196
+ SHIFT n
197
+ @param n The maximum value is 1 inch. For 200 dpi printers, this range is -203 to 203; for 300 dpi printers, the range is -300 to 300. This unit is dots.
198
+ @return Data command
199
+ */
200
+ + (NSData *)shift:(int)n;
201
+
202
+ /**
203
+ Orients the keyboard for use in different countries via defining special characters on the KP-200 series portable LCD keyboard (option).
204
+ 用于选择国际字符集
205
+ COUNTRY n
206
+ @param countryCoding The keyboard for use in different countries via defining special characters
207
+ @return Data command
208
+ */
209
+ + (NSData *)country:(NSString *)countryCoding;
210
+
211
+ /**
212
+ Orients the keyboard for use in different countries via defining special characters on the KP-200 series portable LCD keyboard (option).
213
+ 指定字符编码
214
+ CODEPAGE n
215
+ @param str The name of codepage
216
+ @return Data command
217
+ */
218
+ + (NSData *)codePage:(NSString *)str;
219
+
220
+ /**
221
+ Clears the image buffer.
222
+ 清除缓存
223
+ CLS
224
+ @return Data command
225
+ */
226
+ + (NSData *)cls;
227
+
228
+ /**
229
+ Feeds label with the specified length. The length is specified by dots.
230
+ 控制进纸距离,单位dot
231
+ FEED n
232
+ @param n The length label feeds
233
+ @return Data command
234
+ */
235
+ + (NSData *)feed:(int)n;
236
+
237
+ /**
238
+ Feeds the label in reverse. The length is specified by dots.
239
+ 后退进纸,单位dot
240
+ BACKFEED n
241
+ @param n The length label feeds in reverse
242
+ @return Data command
243
+ */
244
+ + (NSData *)backFeed:(int)n;
245
+
246
+ /**
247
+ Feeds label to the beginning of next label.
248
+ FORMFEED
249
+ @return Data command
250
+ */
251
+ + (NSData *)formFeed;
252
+
253
+
254
+ /**
255
+ This command will feed label until the sensor has determined origin.
256
+ HOME
257
+ */
258
+ + (NSData *)home;
259
+
260
+ /**
261
+ This command prints the label format currently stored in the image buffer.
262
+ PRINT m,n
263
+ @param m Specifies how many sets of labels will be printed
264
+ @param n Specifies how many copies should be printed for each particular label set
265
+ */
266
+ + (NSData *)printWithM:(int)m andN:(int)n;
267
+
268
+ /**
269
+ This command prints the label format currently stored in the image buffer.
270
+ PRINT m
271
+ @param m Specifies how many sets of labels will be printed
272
+ */
273
+ + (NSData *)print:(int)m;
274
+
275
+ /**
276
+ This command controls the sound frequency of the beeper. There are 10 levels of sounds.
277
+ SOUND level,interval
278
+ @param level Sound level: 0-9
279
+ @param interval Sound interval: 1-4095
280
+ */
281
+ + (NSData *)soundWithLevel:(int)level andInterval:(int)interval;
282
+
283
+ /**
284
+ This command activates the cutter to immediately cut the labels without back feeding the label.
285
+ CUT
286
+ */
287
+ + (NSData *)cut;
288
+
289
+ /**
290
+ This command is used to stop feeding paper while feed paper wrong.
291
+ LIMITFEED n
292
+ @param n The limit length of wrong (in inch)
293
+ */
294
+ + (NSData *)limitFeedByinch:(double)n;
295
+
296
+ /**
297
+ This command is used to stop feeding paper while feed paper wrong.
298
+ LIMITFEED n
299
+ @param n The limit length of wrong (in mm)
300
+ */
301
+ + (NSData *)limitFeedBymm:(double)n;
302
+
303
+ /**
304
+ This command is used to stop feeding paper while feed paper wrong.
305
+ LIMITFEED n
306
+ @param n The limit length of wrong (in dots)
307
+ */
308
+ + (NSData *)limitFeedBydot:(int)n;
309
+
310
+ /**
311
+ At this command, the printer will print out the printer information.
312
+ SELFTEST
313
+ */
314
+ + (NSData *)selfTest;
315
+
316
+ /**
317
+ At this command, the printer will print out the printer information.
318
+ SELFTEST page
319
+ @param page The type of printer information
320
+ */
321
+ + (NSData *)selfTest:(NSString *)page;
322
+
323
+ /**
324
+ Let the printer wait until process of commands (before EOJ) be then go on the next command.
325
+ EOJ
326
+ */
327
+ + (NSData *)eoj;
328
+
329
+ /**
330
+ Let the printer wait specific period of time then go on next command.
331
+ DELAY ms
332
+ @param ms Print delay how many seconds
333
+ */
334
+ + (NSData *)delay:(int)ms;
335
+
336
+ /**
337
+ This command can show the image, which is in printer's image buffer, on LCD panel.
338
+ DISPLAY IMAGE/OFF
339
+ @param str IMAGE: Show the image in printer's image buffer on LCD panel
340
+ OFF: Disable this function
341
+ */
342
+ + (NSData *)display:(NSString *)str;
343
+
344
+ /**
345
+ This command can restore printer settings to defaults.
346
+ INITIALPRINTER
347
+ */
348
+ + (NSData *)initialPrinter;
349
+
350
+ /**
351
+ This command draws a bar on the label format.
352
+ BAR x,y,w,h
353
+ @param x The upper left corner x-coordinate (in dots)
354
+ @param y The upper left corner y-coordinate (in dots)
355
+ @param w Bar width (in dots)
356
+ @param h Bar height (in dots)
357
+ */
358
+ + (NSData *)barWithX:(int)x andY:(int)y andWidth:(int)w andHeigt:(int)h;
359
+
360
+
361
+ /**
362
+ This command prints 1D barcodes.
363
+ 绘制一维码
364
+ @param x Specify the x-coordinate
365
+ @param y Specify the y-coordinate
366
+ @param codetype Type of barcode
367
+ @param height Height of barcode
368
+ @param readable HRI readable, 0-3
369
+ @param rotation Graphic rotation, 0-90-180-270
370
+ @param narrow Space in unit
371
+ @param wide Width of unit
372
+ @param content Barcode's content
373
+ @param strEnCoding Barcode's content's encoding
374
+ */
375
+ + (NSData *)barcodeWithX:(int)x
376
+ andY:(int)y
377
+ andCodeType:(NSString *)codetype
378
+ andHeight:(int)height
379
+ andHunabReadable:(int)readable
380
+ andRotation:(int)rotation
381
+ andNarrow:(int)narrow
382
+ andWide:(int)wide
383
+ andContent:(NSString *)content
384
+ usStrEnCoding:(NSStringEncoding)strEnCoding;
385
+
386
+ /**
387
+ This command draws bitmap images.
388
+ 绘制bitmap图像
389
+ @param x Specify the x-coordinate
390
+ @param y Specify the y-coordinate
391
+ @param mode Graphic modes listed below:
392
+ 0: OVERWRITE
393
+ 1: OR
394
+ 2: XOR
395
+ @param image The graphic you want to print
396
+ */
397
+ + (NSData *)bitmapWithX:(int)x
398
+ andY:(int)y
399
+ andMode:(int)mode
400
+ andImage:(UIImage *)image;
401
+
402
+ /**
403
+ This command draws rectangles on the label.
404
+ 绘制一个方框
405
+ @param x Specify x-coordinate of upper left corner (in dots)
406
+ @param y Specify y-coordinate of upper left corner (in dots)
407
+ @param x_end Specify x-coordinate of lower right corner (in dots)
408
+ @param y_end Specify y-coordinate of lower right corner (in dots)
409
+ @param thickness Specify the round corner, default is 0
410
+ */
411
+ + (NSData *)boxWithX:(int)x
412
+ andY:(int)y
413
+ andEndX:(int)x_end
414
+ andEndY:(int)y_end
415
+ andThickness:(int)thickness;
416
+
417
+ /**
418
+ This command draws an ellipse on the label.
419
+ 绘制一个椭圆
420
+ @param x Specify x-coordinate of upper left corner (in dots)
421
+ @param y Specify y-coordinate of upper left corner (in dots)
422
+ @param width Specify the width of the ellipse (in dots)
423
+ @param height Specify the height of the ellipse (in dots)
424
+ @param thickness Specify the thickness
425
+ */
426
+ + (NSData *)ellipseWithX:(int)x
427
+ andY:(int)y
428
+ andWidth:(int)width
429
+ andHeight:(int)height
430
+ andThickness:(int)thickness;
431
+
432
+ /**
433
+ This command draws CODEBLOCK F mode barcode.
434
+ 绘制CODEBLOCK F模式的条形码
435
+ @param x Specify the x-coordinate
436
+ @param y Specify the y-coordinate
437
+ @param rotation Rotate rotation degrees clockwise
438
+ @param content Content of codablock barcode
439
+ */
440
+ + (NSData *)codaBlockFModeWithX:(int)x
441
+ andY:(int)y
442
+ andRotation:(int)rotation
443
+ andContent:(NSString *)content;
444
+
445
+ /**
446
+ This command draws a DataMatrix 2d barcode.
447
+ 绘制DataMatrix 2d条码
448
+ @param x Specify x-coordinate of upper left corner (in dots)
449
+ @param y Specify y-coordinate of upper left corner (in dots)
450
+ @param width Specify the width of DataMatrix
451
+ @param height Specify the height of DataMatrix
452
+ @param content The content of DataMatrix
453
+ @param strEnCoding Barcode's content's encoding
454
+ */
455
+ + (NSData *)dmateixWithX:(int)x
456
+ andY:(int)y
457
+ andWidth:(int)width
458
+ andHeight:(int)height
459
+ andContent:(NSString *)content
460
+ usStrEnCoding:(NSStringEncoding)strEnCoding;
461
+
462
+ /**
463
+ This command clears a specified region in the image buffer.
464
+ 清除对应区域图像缓存
465
+ @param x The x-coordinate of the starting point (in dots)
466
+ @param y The y-coordinate of the starting point (in dots)
467
+ @param width The region width in x-axis direction (in dots)
468
+ @param height The region height in y-axis direction (in dots)
469
+ */
470
+ + (NSData *)eraseWithX:(int)x
471
+ andY:(int)y
472
+ andWidth:(int)width
473
+ andHeight:(int)height;
474
+
475
+ /**
476
+ This command defines a PDF417 2d barcode.
477
+ 绘制PDF417 2d条码
478
+ */
479
+ + (NSData *)pdf417WithX:(int)x
480
+ andY:(int)y
481
+ andWidth:(int)width
482
+ andHeight:(int)height
483
+ andRotate:(int)rotate
484
+ andContent:(NSString *)content
485
+ usStrEnCoding:(NSStringEncoding)strEnCoding;
486
+
487
+ /**
488
+ This command prints BMP format images.
489
+ 打印BMP格式的图像
490
+ */
491
+ + (NSData *)pubBmpWithX:(int)x
492
+ andY:(int)y
493
+ andFileName:(NSString *)filename
494
+ andContrast:(int)contrast;
495
+
496
+
497
+ /**
498
+ This command prints BMP format images.
499
+ 打印 BMP 格式的图像
500
+ @param x The x-coordinate of the BMP format image
501
+ @param y The y-coordinate of the BMP format image
502
+ @param filename The download BMP filename
503
+ */
504
+ + (NSData *)putBmpWithX:(int)x
505
+ andY:(int)y
506
+ andFileName:(NSString *)filename;
507
+
508
+ /**
509
+ This command prints PCX format images.
510
+ 打印 PCX 格式图片
511
+ @param x The x-coordinate of the BMP format image
512
+ @param y The y-coordinate of the BMP format image
513
+ @param filename The download pcx filename
514
+ */
515
+ + (NSData *)putPcxWithX:(int)x
516
+ andY:(int)y
517
+ andFileName:(NSString *)filename;
518
+
519
+ /**
520
+ This command prints QR code.
521
+ 打印二维码
522
+ @param x The upper left corner x-coordinate of the QRcode
523
+ @param y The upper left corner y-coordinate of the QRcode
524
+ @param ecclevel Error correction recovery level
525
+ @param cellwidth Width of each cell (1~10)
526
+ @param mode A or M
527
+ @param rotation Rotation angle (0, 90, 180, 270)
528
+ @param content The content of QRcode
529
+ @param strEnCoding The encoding of content
530
+ */
531
+ + (NSData *)qrCodeWithX:(int)x
532
+ andY:(int)y
533
+ andEccLevel:(NSString *)ecclevel
534
+ andCellWidth:(int)cellwidth
535
+ andMode:(NSString *)mode
536
+ andRotation:(int)rotation
537
+ andContent:(NSString *)content
538
+ usStrEnCoding:(NSStringEncoding)strEnCoding;
539
+
540
+ /**
541
+ This command reverses a region in image buffer.
542
+ 将指定区域的图像缓存反白
543
+ @param x The x-coordinate of the starting point (in dots)
544
+ @param y The y-coordinate of the starting point (in dots)
545
+ @param width The x-axis region width (in dots)
546
+ @param height The y-axis region height (in dots)
547
+ */
548
+ + (NSData *)reverseWithX:(int)x
549
+ andY:(int)y
550
+ andWidth:(int)width
551
+ andHeight:(int)height;
552
+
553
+ /**
554
+ This command prints text on label.
555
+ 在标签上打印文本
556
+ @param x The x-coordinate of text
557
+ @param y The y-coordinate of text
558
+ @param font Font name
559
+ @param rotation Rotation angle of text
560
+ @param x_mul Horizontal multiplication, up to 10x
561
+ @param y_mul Vertical multiplication, up to 10x
562
+ @param content The content of text string
563
+ @param strEnCoding The encoding of the content string
564
+ */
565
+ + (NSData *)textWithX:(int)x
566
+ andY:(int)y
567
+ andFont:(NSString *)font
568
+ andRotation:(int)rotation
569
+ andX_mul:(int)x_mul
570
+ andY_mul:(int)y_mul
571
+ andContent:(NSString *)content
572
+ usStrEnCoding:(NSStringEncoding)strEnCoding;
573
+
574
+ /**
575
+ This command prints paragraph on label.
576
+ 在标签上打印段落
577
+ */
578
+ + (NSData *)blockWithX:(int)x
579
+ andY:(int)y
580
+ andWidth:(int)width
581
+ andHeight:(int)height
582
+ andFont:(NSString *)font
583
+ andRotation:(int)rotaion
584
+ andX_mul:(int)x_mul
585
+ andY_mul:(int)y_mul
586
+ andConten:(NSString *)content
587
+ usStrEnCoding:(NSStringEncoding)strEnCoding;
588
+
589
+ /**
590
+ This command obtains the printer status at any time.
591
+ 获取打印机状态
592
+ */
593
+ + (NSData *)checkPrinterStatusByPort9100;
594
+
595
+ /**
596
+ This command obtains the printer status at any time.
597
+ 获取打印机状态
598
+ */
599
+ + (NSData *)checkPrinterStatusByPort4000;
600
+
601
+ /**
602
+ Download 程序档.
603
+ 下载程序档
604
+ @param filename The filename to download
605
+ */
606
+ + (NSData *)download:(NSString *)filename;
607
+
608
+
609
+
610
+ /**
611
+ Download 文本档.
612
+ DOWNLOAD "FILENAME",DATASIZE,CONTENT
613
+ @param filename The filename to download
614
+ @param size The size of the data
615
+ @param content The content of the file
616
+ */
617
+ + (NSData *)download:(NSString *)filename
618
+ andSize:(int)size
619
+ andConten:(NSString *)content;
620
+
621
+
622
+ /**
623
+ Download 文本文件档.
624
+ DOWNLOAD "FILENAME",FILE SIZE,DATA CONTENT
625
+ @param filename The filename to download
626
+ @param url The file URL
627
+ */
628
+ + (NSData *)download:(NSString *)filename
629
+ andPath:(NSURL *)url;
630
+
631
+ /**
632
+ End of program, to declare the start and the end of BASIC language used in program.
633
+ EOP
634
+ */
635
+ + (NSData *)eop;
636
+
637
+ /**
638
+ This command prints out the total memory size, available memory size and files lists in the printer memory.
639
+ FILES
640
+ */
641
+ + (NSData *)files;
642
+
643
+ /**
644
+ This command deletes a file in the printer memory.
645
+ 此命令会删除打印机记忆体中的文件
646
+ @param filename The name of the file to be deleted
647
+ */
648
+ + (NSData *)kill:(NSString *)filename;
649
+
650
+ /**
651
+ This command moves download files from DRAM to FLASH memory.
652
+ 此命令可以将 DRAM 中的文件移动到 FLASH 中
653
+ */
654
+ + (NSData *)move;
655
+
656
+ /**
657
+ This command executes a program resident in the printer memory. It is available for TSPL2 printers only.
658
+ 此命令用来执行打印机内存中所保存的文件
659
+ @param filename The name of the program file to be executed
660
+ */
661
+ + (NSData *)run:(NSString *)filename;
662
+
663
+ /**
664
+ This command sets the printer to automatically return information.
665
+ 设定打印机自动返回信息
666
+ @param response The type of auto response to set
667
+ */
668
+ + (NSData *)setAutoResponse:(AutoResponse)response;
669
+
670
+ /**
671
+ This command draws bitmap images.
672
+ 绘制bitmap图像
673
+ @param x The x-coordinate
674
+ @param y The y-coordinate
675
+ @param mode Graphic modes listed below:
676
+ 0: OVERWRITE
677
+ 1: OR
678
+ 2: XOR
679
+ 3: OVERWRITE + zlib
680
+ 4: OR + zlib
681
+ 5: XOR + zlib
682
+ @param image The graphic you want to print
683
+ */
684
+ + (NSData *)zlibBitmapWithX:(int)x
685
+ andY:(int)y
686
+ andMode:(int)mode
687
+ andImage:(UIImage *)image;
688
+
689
+ /**
690
+ 设定开启/关闭送纸至撕纸线的功能
691
+ @param isOpen YES 标签打印结束时将送纸至撕纸位置 NO 标签打印结束时会将标签起印点停留至打印线位置
692
+ */
693
+ + (NSData *)setTear:(BOOL)isOpen;
694
+
695
+ /**
696
+ 设定启动/关闭自动剥纸器功能
697
+ @param isOpen YES 开启自动剥纸器的功能 NO 关闭自动剥纸器的功能
698
+ */
699
+ + (NSData *)setPeel:(BOOL)isOpen;
700
+
701
+ @end
@@ -0,0 +1,15 @@
1
+ //
2
+ // TSCPrinterSDK.h
3
+ // Printer
4
+ //
5
+
6
+ #ifndef TSCPrinterSDK_h
7
+ #define TSCPrinterSDK_h
8
+
9
+ #import "TSCBLEManager.h"
10
+ #import "TSCWIFIManager.h"
11
+ #import "TSCCommand.h"
12
+ #import "ZPLCommand.h"
13
+ #import "CPCLCommand.h"
14
+ #import "KDS_Log.h"
15
+ #endif /* TSCPrinterSDK_h */