@posx/capacitor-imin-printer 0.0.3 → 0.0.6
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/android/build.gradle +32 -25
- package/android/src/main/AndroidManifest.xml +3 -3
- package/android/src/main/java/ai/posx/capacitor/iminprinter/IminPrinterPlugin.java +304 -304
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.js.map +1 -1
- package/package.json +1 -1
package/android/build.gradle
CHANGED
|
@@ -1,25 +1,32 @@
|
|
|
1
|
-
apply plugin: 'com.android.library'
|
|
2
|
-
|
|
3
|
-
android {
|
|
4
|
-
namespace "ai.posx.capacitor.iminprinter"
|
|
5
|
-
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35
|
|
6
|
-
defaultConfig {
|
|
7
|
-
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 25
|
|
8
|
-
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35
|
|
9
|
-
}
|
|
10
|
-
compileOptions {
|
|
11
|
-
sourceCompatibility JavaVersion.VERSION_1_8
|
|
12
|
-
targetCompatibility JavaVersion.VERSION_1_8
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
repositories {
|
|
17
|
-
flatDir { dirs 'libs' }
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
dependencies {
|
|
21
|
-
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
22
|
-
implementation(name: 'IminPrinterLibrary-V2.0.0.18', ext: 'aar')
|
|
23
|
-
implementation "com.getcapacitor:core:5.7.8"
|
|
24
|
-
implementation "androidx.appcompat:appcompat:1.6.1"
|
|
25
|
-
}
|
|
1
|
+
apply plugin: 'com.android.library'
|
|
2
|
+
|
|
3
|
+
android {
|
|
4
|
+
namespace "ai.posx.capacitor.iminprinter"
|
|
5
|
+
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35
|
|
6
|
+
defaultConfig {
|
|
7
|
+
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 25
|
|
8
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35
|
|
9
|
+
}
|
|
10
|
+
compileOptions {
|
|
11
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
12
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
repositories {
|
|
17
|
+
flatDir { dirs 'libs' }
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
dependencies {
|
|
21
|
+
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
|
22
|
+
implementation(name: 'IminPrinterLibrary-V2.0.0.18', ext: 'aar')
|
|
23
|
+
implementation "com.getcapacitor:core:5.7.8"
|
|
24
|
+
implementation "androidx.appcompat:appcompat:1.6.1"
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// 导出库文件给依赖者
|
|
28
|
+
configurations.all {
|
|
29
|
+
resolutionStrategy.dependencySubstitution {
|
|
30
|
+
substitute module('ai.posx:IminPrinterLibrary-V2.0.0.18') `with` project(':.')
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
3
|
-
</manifest>
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
3
|
+
</manifest>
|
|
@@ -1,304 +1,304 @@
|
|
|
1
|
-
package ai.posx.capacitor.iminprinter;
|
|
2
|
-
|
|
3
|
-
import android.graphics.Bitmap;
|
|
4
|
-
import android.graphics.BitmapFactory;
|
|
5
|
-
import android.util.Base64;
|
|
6
|
-
|
|
7
|
-
import com.getcapacitor.JSArray;
|
|
8
|
-
import com.getcapacitor.JSObject;
|
|
9
|
-
import com.getcapacitor.Plugin;
|
|
10
|
-
import com.getcapacitor.PluginCall;
|
|
11
|
-
import com.getcapacitor.PluginMethod;
|
|
12
|
-
import com.getcapacitor.annotation.CapacitorPlugin;
|
|
13
|
-
|
|
14
|
-
import com.imin.printer.INeoPrinterCallback;
|
|
15
|
-
import com.imin.printer.IPrinterCallback;
|
|
16
|
-
import com.imin.printer.InitPrinterCallback;
|
|
17
|
-
import com.imin.printer.PrinterHelper;
|
|
18
|
-
|
|
19
|
-
import java.util.List;
|
|
20
|
-
import java.util.ArrayList;
|
|
21
|
-
|
|
22
|
-
@CapacitorPlugin(name = "IminPrinter")
|
|
23
|
-
public class IminPrinterPlugin extends Plugin {
|
|
24
|
-
|
|
25
|
-
// ── Helpers: callbacks ─────────────────────────────────────────────────────
|
|
26
|
-
|
|
27
|
-
/** Wraps IPrinterCallback into a PluginCall resolve/reject. Use for SDK methods that report success via callback. */
|
|
28
|
-
private IPrinterCallback printCallback(PluginCall call) {
|
|
29
|
-
return new IPrinterCallback() {
|
|
30
|
-
@Override public void onRunResult(boolean isSuccess) throws Exception {
|
|
31
|
-
if (isSuccess) call.resolve(); else call.reject("Print failed");
|
|
32
|
-
}
|
|
33
|
-
@Override public void onRaiseException(int code, String msg) throws Exception {
|
|
34
|
-
call.reject(msg, String.valueOf(code));
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// ── Lifecycle ──────────────────────────────────────────────────────────────
|
|
40
|
-
|
|
41
|
-
@PluginMethod
|
|
42
|
-
public void initPrinter(PluginCall call) {
|
|
43
|
-
PrinterHelper.getInstance().initPrinterService(getContext(), new InitPrinterCallback() {
|
|
44
|
-
@Override public void onConnected() { call.resolve(); }
|
|
45
|
-
@Override public void onDisconnected() {}
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
@PluginMethod
|
|
50
|
-
public void deInitPrinter(PluginCall call) {
|
|
51
|
-
PrinterHelper.getInstance().deInitPrinterService(getContext());
|
|
52
|
-
call.resolve();
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// ── Printer info (sync) ────────────────────────────────────────────────────
|
|
56
|
-
|
|
57
|
-
@PluginMethod
|
|
58
|
-
public void getPrinterStatus(PluginCall call) {
|
|
59
|
-
JSObject r = new JSObject();
|
|
60
|
-
r.put("code", PrinterHelper.getInstance().getPrinterStatus());
|
|
61
|
-
call.resolve(r);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
@PluginMethod
|
|
65
|
-
public void getPrinterSupplierName(PluginCall call) {
|
|
66
|
-
JSObject r = new JSObject(); r.put("value", PrinterHelper.getInstance().getPrinterSupplierName()); call.resolve(r);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
@PluginMethod
|
|
70
|
-
public void getServiceVersion(PluginCall call) {
|
|
71
|
-
JSObject r = new JSObject(); r.put("value", PrinterHelper.getInstance().getServiceVersion()); call.resolve(r);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
@PluginMethod
|
|
75
|
-
public void getSDKVersion(PluginCall call) {
|
|
76
|
-
JSObject r = new JSObject(); r.put("value", PrinterHelper.getSDKVersionName()); call.resolve(r);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
@PluginMethod
|
|
80
|
-
public void getConnectInternalPrinter(PluginCall call) {
|
|
81
|
-
JSObject r = new JSObject(); r.put("value", PrinterHelper.getInstance().getConnectInternalPrinter()); call.resolve(r);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
@PluginMethod
|
|
85
|
-
public void getPrinterDensity(PluginCall call) {
|
|
86
|
-
JSObject r = new JSObject(); r.put("value", PrinterHelper.getInstance().getPrinterDensity()); call.resolve(r);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
@PluginMethod
|
|
90
|
-
public void getPrinterSpeed(PluginCall call) {
|
|
91
|
-
JSObject r = new JSObject(); r.put("value", PrinterHelper.getInstance().getPrinterSpeed()); call.resolve(r);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
@PluginMethod
|
|
95
|
-
public void getPrinterMode(PluginCall call) {
|
|
96
|
-
JSObject r = new JSObject(); r.put("value", PrinterHelper.getInstance().getPrinterMode()); call.resolve(r);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
@PluginMethod
|
|
100
|
-
public void getPrinterPaperType(PluginCall call) {
|
|
101
|
-
JSObject r = new JSObject(); r.put("value", PrinterHelper.getInstance().getPrinterPaperType()); call.resolve(r);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
@PluginMethod
|
|
105
|
-
public void getDrawerStatus(PluginCall call) {
|
|
106
|
-
JSObject r = new JSObject(); r.put("open", PrinterHelper.getInstance().getDrawerStatus()); call.resolve(r);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
@PluginMethod
|
|
110
|
-
public void getOpenDrawerTimes(PluginCall call) {
|
|
111
|
-
JSObject r = new JSObject(); r.put("times", PrinterHelper.getInstance().getOpenDrawerTimes()); call.resolve(r);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// ── Printer info (async callback) ──────────────────────────────────────────
|
|
115
|
-
|
|
116
|
-
private INeoPrinterCallback stringCallback(PluginCall call) {
|
|
117
|
-
return new INeoPrinterCallback() {
|
|
118
|
-
@Override public void onRunResult(boolean ok) throws Exception {}
|
|
119
|
-
@Override public void onReturnString(String result) throws Exception {
|
|
120
|
-
JSObject r = new JSObject(); r.put("value", result); call.resolve(r);
|
|
121
|
-
}
|
|
122
|
-
@Override public void onRaiseException(int code, String msg) throws Exception {
|
|
123
|
-
call.reject(msg, String.valueOf(code));
|
|
124
|
-
}
|
|
125
|
-
@Override public void onPrintResult(int code, String msg) throws Exception {}
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
@PluginMethod public void getPrinterModelName(PluginCall call) { PrinterHelper.getInstance().getPrinterModelName(stringCallback(call)); }
|
|
130
|
-
@PluginMethod public void getPrinterSerialNumber(PluginCall call) { PrinterHelper.getInstance().getPrinterSerialNumber(stringCallback(call)); }
|
|
131
|
-
@PluginMethod public void getPrinterFirmwareVersion(PluginCall call) { PrinterHelper.getInstance().getPrinterFirmwareVersion(stringCallback(call)); }
|
|
132
|
-
@PluginMethod public void getPrinterHardwareVersion(PluginCall call) { PrinterHelper.getInstance().getPrinterHardwareVersion(stringCallback(call)); }
|
|
133
|
-
@PluginMethod public void getPrinterThermalHead(PluginCall call) { PrinterHelper.getInstance().getPrinterThermalHead(stringCallback(call)); }
|
|
134
|
-
@PluginMethod public void getPrinterCutTimes(PluginCall call) { PrinterHelper.getInstance().getPrinterCutTimes(stringCallback(call)); }
|
|
135
|
-
@PluginMethod public void getPrinterPaperDistance(PluginCall call) { PrinterHelper.getInstance().getPrinterPaperDistance(stringCallback(call)); }
|
|
136
|
-
@PluginMethod public void getPrinterTemperature(PluginCall call) { PrinterHelper.getInstance().getPrinterTemperature(stringCallback(call)); }
|
|
137
|
-
|
|
138
|
-
// ── Raw data / feed / cut ──────────────────────────────────────────────────
|
|
139
|
-
|
|
140
|
-
@PluginMethod
|
|
141
|
-
public void sendRawData(PluginCall call) {
|
|
142
|
-
String hex = call.getString("data", "");
|
|
143
|
-
if (hex.isEmpty()) { call.reject("No data"); return; }
|
|
144
|
-
PrinterHelper.getInstance().sendRAWData(hexToBytes(hex), null);
|
|
145
|
-
call.resolve();
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/** Compatibility alias — same hex string interface as capacitor-usb-printer */
|
|
149
|
-
@PluginMethod
|
|
150
|
-
public void print(PluginCall call) {
|
|
151
|
-
String hex = call.getString("data", "");
|
|
152
|
-
if (hex.isEmpty()) { call.reject("No data"); return; }
|
|
153
|
-
PrinterHelper.getInstance().sendRAWData(hexToBytes(hex), null);
|
|
154
|
-
call.resolve();
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
@PluginMethod public void printAndLineFeed(PluginCall call) { PrinterHelper.getInstance().printAndLineFeed(); call.resolve(); }
|
|
158
|
-
@PluginMethod public void printAndFeedPaper(PluginCall call) { PrinterHelper.getInstance().printAndFeedPaper(call.getInt("value", 40)); call.resolve(); }
|
|
159
|
-
@PluginMethod public void printAndQuitPaper(PluginCall call) { PrinterHelper.getInstance().printAndQuitPaper(call.getInt("value", 40)); call.resolve(); }
|
|
160
|
-
@PluginMethod public void partialCut(PluginCall call) { PrinterHelper.getInstance().partialCut(); call.resolve(); }
|
|
161
|
-
@PluginMethod public void fullCut(PluginCall call) { PrinterHelper.getInstance().fullCut(); call.resolve(); }
|
|
162
|
-
@PluginMethod public void partialCutAndFeedPaper(PluginCall call) { PrinterHelper.getInstance().partialCutAndFeedPaper(call.getInt("length", 0)); call.resolve(); }
|
|
163
|
-
@PluginMethod public void fullCutAndFeedPaper(PluginCall call) { PrinterHelper.getInstance().fullCutAndFeedPaper(call.getInt("length", 0)); call.resolve(); }
|
|
164
|
-
|
|
165
|
-
// ── Text printing ──────────────────────────────────────────────────────────
|
|
166
|
-
// These SDK methods have IPrinterCallback — resolve/reject follows the actual print result.
|
|
167
|
-
|
|
168
|
-
@PluginMethod public void printText(PluginCall call) { PrinterHelper.getInstance().printText(call.getString("text", ""), printCallback(call)); }
|
|
169
|
-
@PluginMethod public void printTextWithAlign(PluginCall call) { PrinterHelper.getInstance().printTextWithAli(call.getString("text", ""), call.getInt("align", 0), printCallback(call)); }
|
|
170
|
-
@PluginMethod public void printTextWithEncode(PluginCall call) { PrinterHelper.getInstance().printTextWithEncode(call.getString("text", ""), call.getString("encode", "UTF-8"), printCallback(call)); }
|
|
171
|
-
@PluginMethod public void printTextBitmap(PluginCall call) { PrinterHelper.getInstance().printTextBitmap(call.getString("text", ""), printCallback(call)); }
|
|
172
|
-
@PluginMethod public void printTextBitmapWithAlign(PluginCall call) { PrinterHelper.getInstance().printTextBitmapWithAli(call.getString("text", ""), call.getInt("align", 0), printCallback(call)); }
|
|
173
|
-
|
|
174
|
-
// ── Column printing ────────────────────────────────────────────────────────
|
|
175
|
-
|
|
176
|
-
private void doColumnsText(PluginCall call, boolean useString) {
|
|
177
|
-
try {
|
|
178
|
-
JSArray colsArr = call.getArray("cols");
|
|
179
|
-
JSArray widthsArr = call.getArray("widths");
|
|
180
|
-
JSArray alignsArr = call.getArray("aligns");
|
|
181
|
-
JSArray sizesArr = call.getArray("sizes");
|
|
182
|
-
int n = colsArr.length();
|
|
183
|
-
String[] cols = new String[n];
|
|
184
|
-
int[] widths = new int[n], aligns = new int[n], sizes = new int[n];
|
|
185
|
-
for (int i = 0; i < n; i++) {
|
|
186
|
-
cols[i] = colsArr.getString(i);
|
|
187
|
-
widths[i] = widthsArr.getInt(i);
|
|
188
|
-
aligns[i] = alignsArr.getInt(i);
|
|
189
|
-
sizes[i] = sizesArr.getInt(i);
|
|
190
|
-
}
|
|
191
|
-
if (useString) PrinterHelper.getInstance().printColumnsString(cols, widths, aligns, sizes, printCallback(call));
|
|
192
|
-
else PrinterHelper.getInstance().printColumnsText(cols, widths, aligns, sizes, printCallback(call));
|
|
193
|
-
} catch (Exception e) {
|
|
194
|
-
call.reject(e.getMessage());
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
@PluginMethod public void printColumnsText(PluginCall call) { doColumnsText(call, false); }
|
|
199
|
-
@PluginMethod public void printColumnsString(PluginCall call) { doColumnsText(call, true); }
|
|
200
|
-
|
|
201
|
-
// ── QR / Barcode printing ──────────────────────────────────────────────────
|
|
202
|
-
|
|
203
|
-
@PluginMethod public void printQrCode(PluginCall call) { PrinterHelper.getInstance().printQrCode(call.getString("data", ""), printCallback(call)); }
|
|
204
|
-
@PluginMethod public void printQrCodeWithAlign(PluginCall call) { PrinterHelper.getInstance().printQrCodeWithAlign(call.getString("data", ""), call.getInt("align", 0), printCallback(call)); }
|
|
205
|
-
@PluginMethod public void printQrCodeFull(PluginCall call) { PrinterHelper.getInstance().printQRCodeWithFull(call.getString("data", ""), call.getInt("size", 5), call.getInt("errorLevel", 48), call.getInt("align", 0), printCallback(call)); }
|
|
206
|
-
@PluginMethod public void printDoubleQR(PluginCall call) { PrinterHelper.getInstance().printDoubleQR(call.getString("qr1", ""), call.getString("qr2", ""), printCallback(call)); }
|
|
207
|
-
@PluginMethod public void printBarCode(PluginCall call) { PrinterHelper.getInstance().printBarCode(call.getString("data", ""), call.getInt("type", 0), printCallback(call)); }
|
|
208
|
-
@PluginMethod public void printBarCodeWithAlign(PluginCall call) { PrinterHelper.getInstance().printBarCodeWithAlign(call.getString("data", ""), call.getInt("type", 0), call.getInt("align", 0), printCallback(call)); }
|
|
209
|
-
@PluginMethod public void printBarCodeFull(PluginCall call) { PrinterHelper.getInstance().printBarCodeWithFull(call.getString("data", ""), call.getInt("type", 0), call.getInt("width", 2), call.getInt("height", 80), call.getInt("textPos", 2), call.getInt("align", 0), printCallback(call)); }
|
|
210
|
-
|
|
211
|
-
// ── Bitmap printing ────────────────────────────────────────────────────────
|
|
212
|
-
|
|
213
|
-
private Bitmap base64ToBitmap(String base64) {
|
|
214
|
-
if (base64 == null || base64.isEmpty()) return null;
|
|
215
|
-
byte[] decodedString = Base64.decode(base64, Base64.DEFAULT);
|
|
216
|
-
return BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
@PluginMethod public void printBitmapBase64(PluginCall call) { PrinterHelper.getInstance().printBitmap(base64ToBitmap(call.getString("base64")), printCallback(call)); }
|
|
220
|
-
@PluginMethod public void printBitmapBase64WithAlign(PluginCall call) { PrinterHelper.getInstance().printBitmapWithAlign(base64ToBitmap(call.getString("base64")), call.getInt("align", 0), printCallback(call)); }
|
|
221
|
-
@PluginMethod public void printerSelfChecking(PluginCall call) { PrinterHelper.getInstance().printerSelfChecking(printCallback(call)); }
|
|
222
|
-
@PluginMethod public void getPrinterTestData(PluginCall call) {
|
|
223
|
-
byte[] data = PrinterHelper.getInstance().getPrinterTestData();
|
|
224
|
-
JSObject r = new JSObject();
|
|
225
|
-
r.put("data", bytesToHex(data));
|
|
226
|
-
call.resolve(r);
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
// ── Font style settings ────────────────────────────────────────────────────
|
|
230
|
-
|
|
231
|
-
@PluginMethod public void setPageFormat(PluginCall call) { PrinterHelper.getInstance().setPageFormat(call.getInt("format", 0)); call.resolve(); }
|
|
232
|
-
@PluginMethod public void setFontBold(PluginCall call) { PrinterHelper.getInstance().setFontBold(Boolean.TRUE.equals(call.getBoolean("bold", false))); call.resolve(); }
|
|
233
|
-
@PluginMethod public void setFontItalic(PluginCall call) { PrinterHelper.getInstance().setFontItalic(Boolean.TRUE.equals(call.getBoolean("italic", false))); call.resolve(); }
|
|
234
|
-
@PluginMethod public void setFontUnderline(PluginCall call) { PrinterHelper.getInstance().setFontUnderline(call.getInt("underline", 0)); call.resolve(); }
|
|
235
|
-
@PluginMethod public void setFontAntiWhite(PluginCall call) { PrinterHelper.getInstance().setFontAntiWhite(Boolean.TRUE.equals(call.getBoolean("antiWhite", false))); call.resolve(); }
|
|
236
|
-
@PluginMethod public void setFontMultiple(PluginCall call) { PrinterHelper.getInstance().setFontMultiple(call.getInt("wide", 1), call.getInt("high", 1)); call.resolve(); }
|
|
237
|
-
@PluginMethod public void setFontRotate(PluginCall call) { PrinterHelper.getInstance().setFontRotate(call.getInt("rotate", 0)); call.resolve(); }
|
|
238
|
-
@PluginMethod public void setFontDirection(PluginCall call) { PrinterHelper.getInstance().setFontDirection(call.getInt("direction", 0)); call.resolve(); }
|
|
239
|
-
@PluginMethod public void setFontLineSpacing(PluginCall call) { PrinterHelper.getInstance().setFontLineSpacing(call.getInt("space", 0)); call.resolve(); }
|
|
240
|
-
@PluginMethod public void setFontCharSpace(PluginCall call) { PrinterHelper.getInstance().setFontCharSpace(call.getInt("space", 0)); call.resolve(); }
|
|
241
|
-
@PluginMethod public void setFontCodepage(PluginCall call) { PrinterHelper.getInstance().setFontCodepage(call.getInt("codepage", 0)); call.resolve(); }
|
|
242
|
-
@PluginMethod public void setFontCountryCode(PluginCall call) { PrinterHelper.getInstance().setFontCountryCode(call.getInt("country", 0)); call.resolve(); }
|
|
243
|
-
@PluginMethod public void setLeftMargin(PluginCall call) { PrinterHelper.getInstance().setLeftMargin(call.getInt("size", 0)); call.resolve(); }
|
|
244
|
-
@PluginMethod public void setCodeAlignment(PluginCall call) { PrinterHelper.getInstance().setCodeAlignment(call.getInt("align", 0)); call.resolve(); }
|
|
245
|
-
|
|
246
|
-
// ── TextBitmap style settings ──────────────────────────────────────────────
|
|
247
|
-
|
|
248
|
-
@PluginMethod public void setTextBitmapSize(PluginCall call) { PrinterHelper.getInstance().setTextBitmapSize(call.getInt("size", 24)); call.resolve(); }
|
|
249
|
-
@PluginMethod public void setTextBitmapTypeface(PluginCall call) { PrinterHelper.getInstance().setTextBitmapTypeface(call.getString("typeface", "")); call.resolve(); }
|
|
250
|
-
@PluginMethod public void setTextBitmapStyle(PluginCall call) { PrinterHelper.getInstance().setTextBitmapStyle(call.getInt("style", 0)); call.resolve(); }
|
|
251
|
-
@PluginMethod public void setTextBitmapStrikeThru(PluginCall call) { PrinterHelper.getInstance().setTextBitmapStrikeThru(Boolean.TRUE.equals(call.getBoolean("strikeThru", false))); call.resolve(); }
|
|
252
|
-
@PluginMethod public void setTextBitmapUnderline(PluginCall call) { PrinterHelper.getInstance().setTextBitmapUnderline(Boolean.TRUE.equals(call.getBoolean("underline", false))); call.resolve(); }
|
|
253
|
-
@PluginMethod public void setTextBitmapLineSpacing(PluginCall call) { PrinterHelper.getInstance().setTextBitmapLineSpacing(call.getInt("space", 0)); call.resolve(); }
|
|
254
|
-
@PluginMethod public void setTextBitmapLetterSpacing(PluginCall call) { PrinterHelper.getInstance().setTextBitmapLetterSpacing(call.getInt("space", 0)); call.resolve(); }
|
|
255
|
-
@PluginMethod public void setTextBitmapAntiWhite(PluginCall call) { PrinterHelper.getInstance().setTextBitmapAntiWhite(Boolean.TRUE.equals(call.getBoolean("antiWhite", false))); call.resolve(); }
|
|
256
|
-
|
|
257
|
-
// ── QR / Barcode style settings ────────────────────────────────────────────
|
|
258
|
-
|
|
259
|
-
@PluginMethod public void setQrCodeSize(PluginCall call) { PrinterHelper.getInstance().setQrCodeSize(call.getInt("size", 5)); call.resolve(); }
|
|
260
|
-
@PluginMethod public void setQrCodeErrorLevel(PluginCall call) { PrinterHelper.getInstance().setQrCodeErrorCorrectionLev(call.getInt("level", 48)); call.resolve(); }
|
|
261
|
-
@PluginMethod public void setBarCodeWidth(PluginCall call) { PrinterHelper.getInstance().setBarCodeWidth(call.getInt("width", 2)); call.resolve(); }
|
|
262
|
-
@PluginMethod public void setBarCodeHeight(PluginCall call) { PrinterHelper.getInstance().setBarCodeHeight(call.getInt("height", 80)); call.resolve(); }
|
|
263
|
-
@PluginMethod public void setBarCodeContentPrintPos(PluginCall call) { PrinterHelper.getInstance().setBarCodeContentPrintPos(call.getInt("pos", 2)); call.resolve(); }
|
|
264
|
-
@PluginMethod public void setDoubleQRSize(PluginCall call) { PrinterHelper.getInstance().setDoubleQRSize(call.getInt("size", 5)); call.resolve(); }
|
|
265
|
-
@PluginMethod public void setDoubleQR1Level(PluginCall call) { PrinterHelper.getInstance().setDoubleQR1Level(call.getInt("level", 48)); call.resolve(); }
|
|
266
|
-
@PluginMethod public void setDoubleQR2Level(PluginCall call) { PrinterHelper.getInstance().setDoubleQR2Level(call.getInt("level", 48)); call.resolve(); }
|
|
267
|
-
@PluginMethod public void setDoubleQR1Version(PluginCall call) { PrinterHelper.getInstance().setDoubleQR1Version(call.getInt("version", 0)); call.resolve(); }
|
|
268
|
-
|
|
269
|
-
// ── Printer config ─────────────────────────────────────────────────────────
|
|
270
|
-
|
|
271
|
-
@PluginMethod public void setPrinterDensity(PluginCall call) { PrinterHelper.getInstance().setPrinterDensity(call.getInt("density", 5)); call.resolve(); }
|
|
272
|
-
@PluginMethod public void setPrinterSpeed(PluginCall call) { PrinterHelper.getInstance().setPrinterSpeed(call.getInt("speed", 5)); call.resolve(); }
|
|
273
|
-
@PluginMethod public void setPrinterMode(PluginCall call) { PrinterHelper.getInstance().setPrinterMode(call.getInt("mode", 0)); call.resolve(); }
|
|
274
|
-
@PluginMethod public void setPrinterEncode(PluginCall call) { PrinterHelper.getInstance().setPrinterEncode(call.getInt("encode", 0)); call.resolve(); }
|
|
275
|
-
@PluginMethod public void setConnectInternalPrinter(PluginCall call) { PrinterHelper.getInstance().setConnectInternalPrinter(Boolean.TRUE.equals(call.getBoolean("internal", true))); call.resolve(); }
|
|
276
|
-
|
|
277
|
-
// ── Buffer ─────────────────────────────────────────────────────────────────
|
|
278
|
-
|
|
279
|
-
@PluginMethod public void enterPrinterBuffer(PluginCall call) { PrinterHelper.getInstance().enterPrinterBuffer(Boolean.TRUE.equals(call.getBoolean("clean", false))); call.resolve(); }
|
|
280
|
-
@PluginMethod public void commitPrinterBuffer(PluginCall call) { PrinterHelper.getInstance().commitPrinterBuffer(); call.resolve(); }
|
|
281
|
-
@PluginMethod public void exitPrinterBuffer(PluginCall call) { PrinterHelper.getInstance().exitPrinterBuffer(Boolean.TRUE.equals(call.getBoolean("clean", false))); call.resolve(); }
|
|
282
|
-
|
|
283
|
-
// ── Cash drawer ────────────────────────────────────────────────────────────
|
|
284
|
-
|
|
285
|
-
@PluginMethod public void openDrawer(PluginCall call) { PrinterHelper.getInstance().openDrawer(); call.resolve(); }
|
|
286
|
-
@PluginMethod public void supportCashBox(PluginCall call) { JSObject r = new JSObject(); r.put("supported", PrinterHelper.getInstance().supportCashBox()); call.resolve(r); }
|
|
287
|
-
|
|
288
|
-
// ── Helpers ────────────────────────────────────────────────────────────────
|
|
289
|
-
|
|
290
|
-
private static byte[] hexToBytes(String hex) {
|
|
291
|
-
hex = hex.replaceAll("\\s+", "");
|
|
292
|
-
byte[] data = new byte[hex.length() / 2];
|
|
293
|
-
for (int i = 0; i < hex.length(); i += 2)
|
|
294
|
-
data[i / 2] = (byte) ((Character.digit(hex.charAt(i), 16) << 4) | Character.digit(hex.charAt(i + 1), 16));
|
|
295
|
-
return data;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
private static String bytesToHex(byte[] bytes) {
|
|
299
|
-
if (bytes == null) return "";
|
|
300
|
-
StringBuilder sb = new StringBuilder();
|
|
301
|
-
for (byte b : bytes) sb.append(String.format("%02x", b));
|
|
302
|
-
return sb.toString();
|
|
303
|
-
}
|
|
304
|
-
}
|
|
1
|
+
package ai.posx.capacitor.iminprinter;
|
|
2
|
+
|
|
3
|
+
import android.graphics.Bitmap;
|
|
4
|
+
import android.graphics.BitmapFactory;
|
|
5
|
+
import android.util.Base64;
|
|
6
|
+
|
|
7
|
+
import com.getcapacitor.JSArray;
|
|
8
|
+
import com.getcapacitor.JSObject;
|
|
9
|
+
import com.getcapacitor.Plugin;
|
|
10
|
+
import com.getcapacitor.PluginCall;
|
|
11
|
+
import com.getcapacitor.PluginMethod;
|
|
12
|
+
import com.getcapacitor.annotation.CapacitorPlugin;
|
|
13
|
+
|
|
14
|
+
import com.imin.printer.INeoPrinterCallback;
|
|
15
|
+
import com.imin.printer.IPrinterCallback;
|
|
16
|
+
import com.imin.printer.InitPrinterCallback;
|
|
17
|
+
import com.imin.printer.PrinterHelper;
|
|
18
|
+
|
|
19
|
+
import java.util.List;
|
|
20
|
+
import java.util.ArrayList;
|
|
21
|
+
|
|
22
|
+
@CapacitorPlugin(name = "IminPrinter")
|
|
23
|
+
public class IminPrinterPlugin extends Plugin {
|
|
24
|
+
|
|
25
|
+
// ── Helpers: callbacks ─────────────────────────────────────────────────────
|
|
26
|
+
|
|
27
|
+
/** Wraps IPrinterCallback into a PluginCall resolve/reject. Use for SDK methods that report success via callback. */
|
|
28
|
+
private IPrinterCallback printCallback(PluginCall call) {
|
|
29
|
+
return new IPrinterCallback() {
|
|
30
|
+
@Override public void onRunResult(boolean isSuccess) throws Exception {
|
|
31
|
+
if (isSuccess) call.resolve(); else call.reject("Print failed");
|
|
32
|
+
}
|
|
33
|
+
@Override public void onRaiseException(int code, String msg) throws Exception {
|
|
34
|
+
call.reject(msg, String.valueOf(code));
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// ── Lifecycle ──────────────────────────────────────────────────────────────
|
|
40
|
+
|
|
41
|
+
@PluginMethod
|
|
42
|
+
public void initPrinter(PluginCall call) {
|
|
43
|
+
PrinterHelper.getInstance().initPrinterService(getContext(), new InitPrinterCallback() {
|
|
44
|
+
@Override public void onConnected() { call.resolve(); }
|
|
45
|
+
@Override public void onDisconnected() {}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@PluginMethod
|
|
50
|
+
public void deInitPrinter(PluginCall call) {
|
|
51
|
+
PrinterHelper.getInstance().deInitPrinterService(getContext());
|
|
52
|
+
call.resolve();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// ── Printer info (sync) ────────────────────────────────────────────────────
|
|
56
|
+
|
|
57
|
+
@PluginMethod
|
|
58
|
+
public void getPrinterStatus(PluginCall call) {
|
|
59
|
+
JSObject r = new JSObject();
|
|
60
|
+
r.put("code", PrinterHelper.getInstance().getPrinterStatus());
|
|
61
|
+
call.resolve(r);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@PluginMethod
|
|
65
|
+
public void getPrinterSupplierName(PluginCall call) {
|
|
66
|
+
JSObject r = new JSObject(); r.put("value", PrinterHelper.getInstance().getPrinterSupplierName()); call.resolve(r);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@PluginMethod
|
|
70
|
+
public void getServiceVersion(PluginCall call) {
|
|
71
|
+
JSObject r = new JSObject(); r.put("value", PrinterHelper.getInstance().getServiceVersion()); call.resolve(r);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@PluginMethod
|
|
75
|
+
public void getSDKVersion(PluginCall call) {
|
|
76
|
+
JSObject r = new JSObject(); r.put("value", PrinterHelper.getSDKVersionName()); call.resolve(r);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@PluginMethod
|
|
80
|
+
public void getConnectInternalPrinter(PluginCall call) {
|
|
81
|
+
JSObject r = new JSObject(); r.put("value", PrinterHelper.getInstance().getConnectInternalPrinter()); call.resolve(r);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@PluginMethod
|
|
85
|
+
public void getPrinterDensity(PluginCall call) {
|
|
86
|
+
JSObject r = new JSObject(); r.put("value", PrinterHelper.getInstance().getPrinterDensity()); call.resolve(r);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@PluginMethod
|
|
90
|
+
public void getPrinterSpeed(PluginCall call) {
|
|
91
|
+
JSObject r = new JSObject(); r.put("value", PrinterHelper.getInstance().getPrinterSpeed()); call.resolve(r);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@PluginMethod
|
|
95
|
+
public void getPrinterMode(PluginCall call) {
|
|
96
|
+
JSObject r = new JSObject(); r.put("value", PrinterHelper.getInstance().getPrinterMode()); call.resolve(r);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@PluginMethod
|
|
100
|
+
public void getPrinterPaperType(PluginCall call) {
|
|
101
|
+
JSObject r = new JSObject(); r.put("value", PrinterHelper.getInstance().getPrinterPaperType()); call.resolve(r);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@PluginMethod
|
|
105
|
+
public void getDrawerStatus(PluginCall call) {
|
|
106
|
+
JSObject r = new JSObject(); r.put("open", PrinterHelper.getInstance().getDrawerStatus()); call.resolve(r);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@PluginMethod
|
|
110
|
+
public void getOpenDrawerTimes(PluginCall call) {
|
|
111
|
+
JSObject r = new JSObject(); r.put("times", PrinterHelper.getInstance().getOpenDrawerTimes()); call.resolve(r);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// ── Printer info (async callback) ──────────────────────────────────────────
|
|
115
|
+
|
|
116
|
+
private INeoPrinterCallback stringCallback(PluginCall call) {
|
|
117
|
+
return new INeoPrinterCallback() {
|
|
118
|
+
@Override public void onRunResult(boolean ok) throws Exception {}
|
|
119
|
+
@Override public void onReturnString(String result) throws Exception {
|
|
120
|
+
JSObject r = new JSObject(); r.put("value", result); call.resolve(r);
|
|
121
|
+
}
|
|
122
|
+
@Override public void onRaiseException(int code, String msg) throws Exception {
|
|
123
|
+
call.reject(msg, String.valueOf(code));
|
|
124
|
+
}
|
|
125
|
+
@Override public void onPrintResult(int code, String msg) throws Exception {}
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
@PluginMethod public void getPrinterModelName(PluginCall call) { PrinterHelper.getInstance().getPrinterModelName(stringCallback(call)); }
|
|
130
|
+
@PluginMethod public void getPrinterSerialNumber(PluginCall call) { PrinterHelper.getInstance().getPrinterSerialNumber(stringCallback(call)); }
|
|
131
|
+
@PluginMethod public void getPrinterFirmwareVersion(PluginCall call) { PrinterHelper.getInstance().getPrinterFirmwareVersion(stringCallback(call)); }
|
|
132
|
+
@PluginMethod public void getPrinterHardwareVersion(PluginCall call) { PrinterHelper.getInstance().getPrinterHardwareVersion(stringCallback(call)); }
|
|
133
|
+
@PluginMethod public void getPrinterThermalHead(PluginCall call) { PrinterHelper.getInstance().getPrinterThermalHead(stringCallback(call)); }
|
|
134
|
+
@PluginMethod public void getPrinterCutTimes(PluginCall call) { PrinterHelper.getInstance().getPrinterCutTimes(stringCallback(call)); }
|
|
135
|
+
@PluginMethod public void getPrinterPaperDistance(PluginCall call) { PrinterHelper.getInstance().getPrinterPaperDistance(stringCallback(call)); }
|
|
136
|
+
@PluginMethod public void getPrinterTemperature(PluginCall call) { PrinterHelper.getInstance().getPrinterTemperature(stringCallback(call)); }
|
|
137
|
+
|
|
138
|
+
// ── Raw data / feed / cut ──────────────────────────────────────────────────
|
|
139
|
+
|
|
140
|
+
@PluginMethod
|
|
141
|
+
public void sendRawData(PluginCall call) {
|
|
142
|
+
String hex = call.getString("data", "");
|
|
143
|
+
if (hex.isEmpty()) { call.reject("No data"); return; }
|
|
144
|
+
PrinterHelper.getInstance().sendRAWData(hexToBytes(hex), null);
|
|
145
|
+
call.resolve();
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** Compatibility alias — same hex string interface as capacitor-usb-printer */
|
|
149
|
+
@PluginMethod
|
|
150
|
+
public void print(PluginCall call) {
|
|
151
|
+
String hex = call.getString("data", "");
|
|
152
|
+
if (hex.isEmpty()) { call.reject("No data"); return; }
|
|
153
|
+
PrinterHelper.getInstance().sendRAWData(hexToBytes(hex), null);
|
|
154
|
+
call.resolve();
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
@PluginMethod public void printAndLineFeed(PluginCall call) { PrinterHelper.getInstance().printAndLineFeed(); call.resolve(); }
|
|
158
|
+
@PluginMethod public void printAndFeedPaper(PluginCall call) { PrinterHelper.getInstance().printAndFeedPaper(call.getInt("value", 40)); call.resolve(); }
|
|
159
|
+
@PluginMethod public void printAndQuitPaper(PluginCall call) { PrinterHelper.getInstance().printAndQuitPaper(call.getInt("value", 40)); call.resolve(); }
|
|
160
|
+
@PluginMethod public void partialCut(PluginCall call) { PrinterHelper.getInstance().partialCut(); call.resolve(); }
|
|
161
|
+
@PluginMethod public void fullCut(PluginCall call) { PrinterHelper.getInstance().fullCut(); call.resolve(); }
|
|
162
|
+
@PluginMethod public void partialCutAndFeedPaper(PluginCall call) { PrinterHelper.getInstance().partialCutAndFeedPaper(call.getInt("length", 0)); call.resolve(); }
|
|
163
|
+
@PluginMethod public void fullCutAndFeedPaper(PluginCall call) { PrinterHelper.getInstance().fullCutAndFeedPaper(call.getInt("length", 0)); call.resolve(); }
|
|
164
|
+
|
|
165
|
+
// ── Text printing ──────────────────────────────────────────────────────────
|
|
166
|
+
// These SDK methods have IPrinterCallback — resolve/reject follows the actual print result.
|
|
167
|
+
|
|
168
|
+
@PluginMethod public void printText(PluginCall call) { PrinterHelper.getInstance().printText(call.getString("text", ""), printCallback(call)); }
|
|
169
|
+
@PluginMethod public void printTextWithAlign(PluginCall call) { PrinterHelper.getInstance().printTextWithAli(call.getString("text", ""), call.getInt("align", 0), printCallback(call)); }
|
|
170
|
+
@PluginMethod public void printTextWithEncode(PluginCall call) { PrinterHelper.getInstance().printTextWithEncode(call.getString("text", ""), call.getString("encode", "UTF-8"), printCallback(call)); }
|
|
171
|
+
@PluginMethod public void printTextBitmap(PluginCall call) { PrinterHelper.getInstance().printTextBitmap(call.getString("text", ""), printCallback(call)); }
|
|
172
|
+
@PluginMethod public void printTextBitmapWithAlign(PluginCall call) { PrinterHelper.getInstance().printTextBitmapWithAli(call.getString("text", ""), call.getInt("align", 0), printCallback(call)); }
|
|
173
|
+
|
|
174
|
+
// ── Column printing ────────────────────────────────────────────────────────
|
|
175
|
+
|
|
176
|
+
private void doColumnsText(PluginCall call, boolean useString) {
|
|
177
|
+
try {
|
|
178
|
+
JSArray colsArr = call.getArray("cols");
|
|
179
|
+
JSArray widthsArr = call.getArray("widths");
|
|
180
|
+
JSArray alignsArr = call.getArray("aligns");
|
|
181
|
+
JSArray sizesArr = call.getArray("sizes");
|
|
182
|
+
int n = colsArr.length();
|
|
183
|
+
String[] cols = new String[n];
|
|
184
|
+
int[] widths = new int[n], aligns = new int[n], sizes = new int[n];
|
|
185
|
+
for (int i = 0; i < n; i++) {
|
|
186
|
+
cols[i] = colsArr.getString(i);
|
|
187
|
+
widths[i] = widthsArr.getInt(i);
|
|
188
|
+
aligns[i] = alignsArr.getInt(i);
|
|
189
|
+
sizes[i] = sizesArr.getInt(i);
|
|
190
|
+
}
|
|
191
|
+
if (useString) PrinterHelper.getInstance().printColumnsString(cols, widths, aligns, sizes, printCallback(call));
|
|
192
|
+
else PrinterHelper.getInstance().printColumnsText(cols, widths, aligns, sizes, printCallback(call));
|
|
193
|
+
} catch (Exception e) {
|
|
194
|
+
call.reject(e.getMessage());
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
@PluginMethod public void printColumnsText(PluginCall call) { doColumnsText(call, false); }
|
|
199
|
+
@PluginMethod public void printColumnsString(PluginCall call) { doColumnsText(call, true); }
|
|
200
|
+
|
|
201
|
+
// ── QR / Barcode printing ──────────────────────────────────────────────────
|
|
202
|
+
|
|
203
|
+
@PluginMethod public void printQrCode(PluginCall call) { PrinterHelper.getInstance().printQrCode(call.getString("data", ""), printCallback(call)); }
|
|
204
|
+
@PluginMethod public void printQrCodeWithAlign(PluginCall call) { PrinterHelper.getInstance().printQrCodeWithAlign(call.getString("data", ""), call.getInt("align", 0), printCallback(call)); }
|
|
205
|
+
@PluginMethod public void printQrCodeFull(PluginCall call) { PrinterHelper.getInstance().printQRCodeWithFull(call.getString("data", ""), call.getInt("size", 5), call.getInt("errorLevel", 48), call.getInt("align", 0), printCallback(call)); }
|
|
206
|
+
@PluginMethod public void printDoubleQR(PluginCall call) { PrinterHelper.getInstance().printDoubleQR(call.getString("qr1", ""), call.getString("qr2", ""), printCallback(call)); }
|
|
207
|
+
@PluginMethod public void printBarCode(PluginCall call) { PrinterHelper.getInstance().printBarCode(call.getString("data", ""), call.getInt("type", 0), printCallback(call)); }
|
|
208
|
+
@PluginMethod public void printBarCodeWithAlign(PluginCall call) { PrinterHelper.getInstance().printBarCodeWithAlign(call.getString("data", ""), call.getInt("type", 0), call.getInt("align", 0), printCallback(call)); }
|
|
209
|
+
@PluginMethod public void printBarCodeFull(PluginCall call) { PrinterHelper.getInstance().printBarCodeWithFull(call.getString("data", ""), call.getInt("type", 0), call.getInt("width", 2), call.getInt("height", 80), call.getInt("textPos", 2), call.getInt("align", 0), printCallback(call)); }
|
|
210
|
+
|
|
211
|
+
// ── Bitmap printing ────────────────────────────────────────────────────────
|
|
212
|
+
|
|
213
|
+
private Bitmap base64ToBitmap(String base64) {
|
|
214
|
+
if (base64 == null || base64.isEmpty()) return null;
|
|
215
|
+
byte[] decodedString = Base64.decode(base64, Base64.DEFAULT);
|
|
216
|
+
return BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
@PluginMethod public void printBitmapBase64(PluginCall call) { PrinterHelper.getInstance().printBitmap(base64ToBitmap(call.getString("base64")), printCallback(call)); }
|
|
220
|
+
@PluginMethod public void printBitmapBase64WithAlign(PluginCall call) { PrinterHelper.getInstance().printBitmapWithAlign(base64ToBitmap(call.getString("base64")), call.getInt("align", 0), printCallback(call)); }
|
|
221
|
+
@PluginMethod public void printerSelfChecking(PluginCall call) { PrinterHelper.getInstance().printerSelfChecking(printCallback(call)); }
|
|
222
|
+
@PluginMethod public void getPrinterTestData(PluginCall call) {
|
|
223
|
+
byte[] data = PrinterHelper.getInstance().getPrinterTestData();
|
|
224
|
+
JSObject r = new JSObject();
|
|
225
|
+
r.put("data", bytesToHex(data));
|
|
226
|
+
call.resolve(r);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// ── Font style settings ────────────────────────────────────────────────────
|
|
230
|
+
|
|
231
|
+
@PluginMethod public void setPageFormat(PluginCall call) { PrinterHelper.getInstance().setPageFormat(call.getInt("format", 0)); call.resolve(); }
|
|
232
|
+
@PluginMethod public void setFontBold(PluginCall call) { PrinterHelper.getInstance().setFontBold(Boolean.TRUE.equals(call.getBoolean("bold", false))); call.resolve(); }
|
|
233
|
+
@PluginMethod public void setFontItalic(PluginCall call) { PrinterHelper.getInstance().setFontItalic(Boolean.TRUE.equals(call.getBoolean("italic", false))); call.resolve(); }
|
|
234
|
+
@PluginMethod public void setFontUnderline(PluginCall call) { PrinterHelper.getInstance().setFontUnderline(call.getInt("underline", 0)); call.resolve(); }
|
|
235
|
+
@PluginMethod public void setFontAntiWhite(PluginCall call) { PrinterHelper.getInstance().setFontAntiWhite(Boolean.TRUE.equals(call.getBoolean("antiWhite", false))); call.resolve(); }
|
|
236
|
+
@PluginMethod public void setFontMultiple(PluginCall call) { PrinterHelper.getInstance().setFontMultiple(call.getInt("wide", 1), call.getInt("high", 1)); call.resolve(); }
|
|
237
|
+
@PluginMethod public void setFontRotate(PluginCall call) { PrinterHelper.getInstance().setFontRotate(call.getInt("rotate", 0)); call.resolve(); }
|
|
238
|
+
@PluginMethod public void setFontDirection(PluginCall call) { PrinterHelper.getInstance().setFontDirection(call.getInt("direction", 0)); call.resolve(); }
|
|
239
|
+
@PluginMethod public void setFontLineSpacing(PluginCall call) { PrinterHelper.getInstance().setFontLineSpacing(call.getInt("space", 0)); call.resolve(); }
|
|
240
|
+
@PluginMethod public void setFontCharSpace(PluginCall call) { PrinterHelper.getInstance().setFontCharSpace(call.getInt("space", 0)); call.resolve(); }
|
|
241
|
+
@PluginMethod public void setFontCodepage(PluginCall call) { PrinterHelper.getInstance().setFontCodepage(call.getInt("codepage", 0)); call.resolve(); }
|
|
242
|
+
@PluginMethod public void setFontCountryCode(PluginCall call) { PrinterHelper.getInstance().setFontCountryCode(call.getInt("country", 0)); call.resolve(); }
|
|
243
|
+
@PluginMethod public void setLeftMargin(PluginCall call) { PrinterHelper.getInstance().setLeftMargin(call.getInt("size", 0)); call.resolve(); }
|
|
244
|
+
@PluginMethod public void setCodeAlignment(PluginCall call) { PrinterHelper.getInstance().setCodeAlignment(call.getInt("align", 0)); call.resolve(); }
|
|
245
|
+
|
|
246
|
+
// ── TextBitmap style settings ──────────────────────────────────────────────
|
|
247
|
+
|
|
248
|
+
@PluginMethod public void setTextBitmapSize(PluginCall call) { PrinterHelper.getInstance().setTextBitmapSize(call.getInt("size", 24)); call.resolve(); }
|
|
249
|
+
@PluginMethod public void setTextBitmapTypeface(PluginCall call) { PrinterHelper.getInstance().setTextBitmapTypeface(call.getString("typeface", "")); call.resolve(); }
|
|
250
|
+
@PluginMethod public void setTextBitmapStyle(PluginCall call) { PrinterHelper.getInstance().setTextBitmapStyle(call.getInt("style", 0)); call.resolve(); }
|
|
251
|
+
@PluginMethod public void setTextBitmapStrikeThru(PluginCall call) { PrinterHelper.getInstance().setTextBitmapStrikeThru(Boolean.TRUE.equals(call.getBoolean("strikeThru", false))); call.resolve(); }
|
|
252
|
+
@PluginMethod public void setTextBitmapUnderline(PluginCall call) { PrinterHelper.getInstance().setTextBitmapUnderline(Boolean.TRUE.equals(call.getBoolean("underline", false))); call.resolve(); }
|
|
253
|
+
@PluginMethod public void setTextBitmapLineSpacing(PluginCall call) { PrinterHelper.getInstance().setTextBitmapLineSpacing(call.getInt("space", 0)); call.resolve(); }
|
|
254
|
+
@PluginMethod public void setTextBitmapLetterSpacing(PluginCall call) { PrinterHelper.getInstance().setTextBitmapLetterSpacing(call.getInt("space", 0)); call.resolve(); }
|
|
255
|
+
@PluginMethod public void setTextBitmapAntiWhite(PluginCall call) { PrinterHelper.getInstance().setTextBitmapAntiWhite(Boolean.TRUE.equals(call.getBoolean("antiWhite", false))); call.resolve(); }
|
|
256
|
+
|
|
257
|
+
// ── QR / Barcode style settings ────────────────────────────────────────────
|
|
258
|
+
|
|
259
|
+
@PluginMethod public void setQrCodeSize(PluginCall call) { PrinterHelper.getInstance().setQrCodeSize(call.getInt("size", 5)); call.resolve(); }
|
|
260
|
+
@PluginMethod public void setQrCodeErrorLevel(PluginCall call) { PrinterHelper.getInstance().setQrCodeErrorCorrectionLev(call.getInt("level", 48)); call.resolve(); }
|
|
261
|
+
@PluginMethod public void setBarCodeWidth(PluginCall call) { PrinterHelper.getInstance().setBarCodeWidth(call.getInt("width", 2)); call.resolve(); }
|
|
262
|
+
@PluginMethod public void setBarCodeHeight(PluginCall call) { PrinterHelper.getInstance().setBarCodeHeight(call.getInt("height", 80)); call.resolve(); }
|
|
263
|
+
@PluginMethod public void setBarCodeContentPrintPos(PluginCall call) { PrinterHelper.getInstance().setBarCodeContentPrintPos(call.getInt("pos", 2)); call.resolve(); }
|
|
264
|
+
@PluginMethod public void setDoubleQRSize(PluginCall call) { PrinterHelper.getInstance().setDoubleQRSize(call.getInt("size", 5)); call.resolve(); }
|
|
265
|
+
@PluginMethod public void setDoubleQR1Level(PluginCall call) { PrinterHelper.getInstance().setDoubleQR1Level(call.getInt("level", 48)); call.resolve(); }
|
|
266
|
+
@PluginMethod public void setDoubleQR2Level(PluginCall call) { PrinterHelper.getInstance().setDoubleQR2Level(call.getInt("level", 48)); call.resolve(); }
|
|
267
|
+
@PluginMethod public void setDoubleQR1Version(PluginCall call) { PrinterHelper.getInstance().setDoubleQR1Version(call.getInt("version", 0)); call.resolve(); }
|
|
268
|
+
|
|
269
|
+
// ── Printer config ─────────────────────────────────────────────────────────
|
|
270
|
+
|
|
271
|
+
@PluginMethod public void setPrinterDensity(PluginCall call) { PrinterHelper.getInstance().setPrinterDensity(call.getInt("density", 5)); call.resolve(); }
|
|
272
|
+
@PluginMethod public void setPrinterSpeed(PluginCall call) { PrinterHelper.getInstance().setPrinterSpeed(call.getInt("speed", 5)); call.resolve(); }
|
|
273
|
+
@PluginMethod public void setPrinterMode(PluginCall call) { PrinterHelper.getInstance().setPrinterMode(call.getInt("mode", 0)); call.resolve(); }
|
|
274
|
+
@PluginMethod public void setPrinterEncode(PluginCall call) { PrinterHelper.getInstance().setPrinterEncode(call.getInt("encode", 0)); call.resolve(); }
|
|
275
|
+
@PluginMethod public void setConnectInternalPrinter(PluginCall call) { PrinterHelper.getInstance().setConnectInternalPrinter(Boolean.TRUE.equals(call.getBoolean("internal", true))); call.resolve(); }
|
|
276
|
+
|
|
277
|
+
// ── Buffer ─────────────────────────────────────────────────────────────────
|
|
278
|
+
|
|
279
|
+
@PluginMethod public void enterPrinterBuffer(PluginCall call) { PrinterHelper.getInstance().enterPrinterBuffer(Boolean.TRUE.equals(call.getBoolean("clean", false))); call.resolve(); }
|
|
280
|
+
@PluginMethod public void commitPrinterBuffer(PluginCall call) { PrinterHelper.getInstance().commitPrinterBuffer(); call.resolve(); }
|
|
281
|
+
@PluginMethod public void exitPrinterBuffer(PluginCall call) { PrinterHelper.getInstance().exitPrinterBuffer(Boolean.TRUE.equals(call.getBoolean("clean", false))); call.resolve(); }
|
|
282
|
+
|
|
283
|
+
// ── Cash drawer ────────────────────────────────────────────────────────────
|
|
284
|
+
|
|
285
|
+
@PluginMethod public void openDrawer(PluginCall call) { PrinterHelper.getInstance().openDrawer(); call.resolve(); }
|
|
286
|
+
@PluginMethod public void supportCashBox(PluginCall call) { JSObject r = new JSObject(); r.put("supported", PrinterHelper.getInstance().supportCashBox()); call.resolve(r); }
|
|
287
|
+
|
|
288
|
+
// ── Helpers ────────────────────────────────────────────────────────────────
|
|
289
|
+
|
|
290
|
+
private static byte[] hexToBytes(String hex) {
|
|
291
|
+
hex = hex.replaceAll("\\s+", "");
|
|
292
|
+
byte[] data = new byte[hex.length() / 2];
|
|
293
|
+
for (int i = 0; i < hex.length(); i += 2)
|
|
294
|
+
data[i / 2] = (byte) ((Character.digit(hex.charAt(i), 16) << 4) | Character.digit(hex.charAt(i + 1), 16));
|
|
295
|
+
return data;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
private static String bytesToHex(byte[] bytes) {
|
|
299
|
+
if (bytes == null) return "";
|
|
300
|
+
StringBuilder sb = new StringBuilder();
|
|
301
|
+
for (byte b : bytes) sb.append(String.format("%02x", b));
|
|
302
|
+
return sb.toString();
|
|
303
|
+
}
|
|
304
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface IminPrinterPlugin {\n // ── Lifecycle ──────────────────────────────────────────\n initPrinter(): Promise<void>;\n deInitPrinter(): Promise<void>;\n\n // ── Printer info (sync) ────────────────────────────────\n getPrinterStatus(): Promise<{ code: number }>;\n getPrinterSupplierName(): Promise<{ value: string }>;\n getServiceVersion(): Promise<{ value: string }>;\n getSDKVersion(): Promise<{ value: string }>;\n getConnectInternalPrinter(): Promise<{ value: boolean }>;\n getPrinterDensity(): Promise<{ value: number }>;\n getPrinterSpeed(): Promise<{ value: number }>;\n getPrinterMode(): Promise<{ value: number }>;\n getPrinterPaperType(): Promise<{ value: number }>;\n getDrawerStatus(): Promise<{ open: boolean }>;\n getOpenDrawerTimes(): Promise<{ times: number }>;\n\n // ── Printer info (async callback) ─────────────────────\n getPrinterModelName(): Promise<{ value: string }>;\n getPrinterSerialNumber(): Promise<{ value: string }>;\n getPrinterFirmwareVersion(): Promise<{ value: string }>;\n getPrinterHardwareVersion(): Promise<{ value: string }>;\n getPrinterThermalHead(): Promise<{ value: string }>;\n getPrinterCutTimes(): Promise<{ value: string }>;\n getPrinterPaperDistance(): Promise<{ value: string }>;\n getPrinterTemperature(): Promise<{ value: string }>;\n\n // ── Raw data / feed / cut ──────────────────────────────\n sendRawData(options: { data: string }): Promise<void>;\n /** Compatibility alias — same hex string format as UsbPrinterPlugin.print */\n print(options: { data: string }): Promise<void>;\n printAndLineFeed(): Promise<void>;\n printAndFeedPaper(options: { value: number }): Promise<void>;\n printAndQuitPaper(options: { value: number }): Promise<void>;\n partialCut(): Promise<void>;\n fullCut(): Promise<void>;\n partialCutAndFeedPaper(options: { length: number }): Promise<void>;\n fullCutAndFeedPaper(options: { length: number }): Promise<void>;\n\n // ── Text printing ──────────────────────────────────────\n printText(options: { text: string }): Promise<void>;\n printTextWithAlign(options: { text: string; align: number }): Promise<void>;\n printTextWithEncode(options: { text: string; encode: string }): Promise<void>;\n printTextBitmap(options: { text: string }): Promise<void>;\n printTextBitmapWithAlign(options: { text: string; align: number }): Promise<void>;\n\n // ── Column printing ────────────────────────────────────\n printColumnsText(options: { cols: string[]; widths: number[]; aligns: number[]; sizes: number[] }): Promise<void>;\n printColumnsString(options: { cols: string[]; widths: number[]; aligns: number[]; sizes: number[] }): Promise<void>;\n\n // ── QR / Barcode printing ──────────────────────────────\n printQrCode(options: { data: string }): Promise<void>;\n printQrCodeWithAlign(options: { data: string; align: number }): Promise<void>;\n printQrCodeFull(options: { data: string; size: number; errorLevel: number; align: number }): Promise<void>;\n printDoubleQR(options: { qr1: string; qr2: string }): Promise<void>;\n printBarCode(options: { data: string; type: number }): Promise<void>;\n printBarCodeWithAlign(options: { data: string; type: number; align: number }): Promise<void>;\n printBarCodeFull(options: { data: string; type: number; width: number; height: number; textPos: number; align: number }): Promise<void>;\n\n // ── Bitmap printing ────────────────────────────────────\n /** base64: PNG/JPEG base64 string (without data URI prefix) */\n printBitmapBase64(options: { base64: string }): Promise<void>;\n printBitmapBase64WithAlign(options: { base64: string; align: number }): Promise<void>;\n printerSelfChecking(): Promise<void>;\n /** Returns test page data as hex string */\n getPrinterTestData(): Promise<{ data: string }>;\n\n // ── Font style settings ────────────────────────────────\n setPageFormat(options: { format: number }): Promise<void>;\n setFontBold(options: { bold: boolean }): Promise<void>;\n setFontItalic(options: { italic: boolean }): Promise<void>;\n setFontUnderline(options: { underline: number }): Promise<void>;\n setFontAntiWhite(options: { antiWhite: boolean }): Promise<void>;\n setFontMultiple(options: { wide: number; high: number }): Promise<void>;\n setFontRotate(options: { rotate: number }): Promise<void>;\n setFontDirection(options: { direction: number }): Promise<void>;\n setFontLineSpacing(options: { space: number }): Promise<void>;\n setFontCharSpace(options: { space: number }): Promise<void>;\n setFontCodepage(options: { codepage: number }): Promise<void>;\n setFontCountryCode(options: { country: number }): Promise<void>;\n setLeftMargin(options: { size: number }): Promise<void>;\n setCodeAlignment(options: { align: number }): Promise<void>;\n\n // ── TextBitmap style settings ──────────────────────────\n setTextBitmapSize(options: { size: number }): Promise<void>;\n setTextBitmapTypeface(options: { typeface: string }): Promise<void>;\n setTextBitmapStyle(options: { style: number }): Promise<void>;\n setTextBitmapStrikeThru(options: { strikeThru: boolean }): Promise<void>;\n setTextBitmapUnderline(options: { underline: boolean }): Promise<void>;\n setTextBitmapLineSpacing(options: { space: number }): Promise<void>;\n setTextBitmapLetterSpacing(options: { space: number }): Promise<void>;\n setTextBitmapAntiWhite(options: { antiWhite: boolean }): Promise<void>;\n\n // ── QR / Barcode style settings ────────────────────────\n setQrCodeSize(options: { size: number }): Promise<void>;\n setQrCodeErrorLevel(options: { level: number }): Promise<void>;\n setBarCodeWidth(options: { width: number }): Promise<void>;\n setBarCodeHeight(options: { height: number }): Promise<void>;\n setBarCodeContentPrintPos(options: { pos: number }): Promise<void>;\n setDoubleQRSize(options: { size: number }): Promise<void>;\n setDoubleQR1Level(options: { level: number }): Promise<void>;\n setDoubleQR2Level(options: { level: number }): Promise<void>;\n setDoubleQR1Version(options: { version: number }): Promise<void>;\n\n // ── Printer config ─────────────────────────────────────\n setPrinterDensity(options: { density: number }): Promise<void>;\n setPrinterSpeed(options: { speed: number }): Promise<void>;\n setPrinterMode(options: { mode: number }): Promise<void>;\n setPrinterEncode(options: { encode: number }): Promise<void>;\n setConnectInternalPrinter(options: { internal: boolean }): Promise<void>;\n\n // ── Buffer ─────────────────────────────────────────────\n enterPrinterBuffer(options: { clean: boolean }): Promise<void>;\n commitPrinterBuffer(): Promise<void>;\n exitPrinterBuffer(options: { clean: boolean }): Promise<void>;\n\n // ── Cash drawer ────────────────────────────────────────\n openDrawer(): Promise<void>;\n supportCashBox(): Promise<{ supported: boolean }>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface IminPrinterPlugin {\r\n // ── Lifecycle ──────────────────────────────────────────\r\n initPrinter(): Promise<void>;\r\n deInitPrinter(): Promise<void>;\r\n\r\n // ── Printer info (sync) ────────────────────────────────\r\n getPrinterStatus(): Promise<{ code: number }>;\r\n getPrinterSupplierName(): Promise<{ value: string }>;\r\n getServiceVersion(): Promise<{ value: string }>;\r\n getSDKVersion(): Promise<{ value: string }>;\r\n getConnectInternalPrinter(): Promise<{ value: boolean }>;\r\n getPrinterDensity(): Promise<{ value: number }>;\r\n getPrinterSpeed(): Promise<{ value: number }>;\r\n getPrinterMode(): Promise<{ value: number }>;\r\n getPrinterPaperType(): Promise<{ value: number }>;\r\n getDrawerStatus(): Promise<{ open: boolean }>;\r\n getOpenDrawerTimes(): Promise<{ times: number }>;\r\n\r\n // ── Printer info (async callback) ─────────────────────\r\n getPrinterModelName(): Promise<{ value: string }>;\r\n getPrinterSerialNumber(): Promise<{ value: string }>;\r\n getPrinterFirmwareVersion(): Promise<{ value: string }>;\r\n getPrinterHardwareVersion(): Promise<{ value: string }>;\r\n getPrinterThermalHead(): Promise<{ value: string }>;\r\n getPrinterCutTimes(): Promise<{ value: string }>;\r\n getPrinterPaperDistance(): Promise<{ value: string }>;\r\n getPrinterTemperature(): Promise<{ value: string }>;\r\n\r\n // ── Raw data / feed / cut ──────────────────────────────\r\n sendRawData(options: { data: string }): Promise<void>;\r\n /** Compatibility alias — same hex string format as UsbPrinterPlugin.print */\r\n print(options: { data: string }): Promise<void>;\r\n printAndLineFeed(): Promise<void>;\r\n printAndFeedPaper(options: { value: number }): Promise<void>;\r\n printAndQuitPaper(options: { value: number }): Promise<void>;\r\n partialCut(): Promise<void>;\r\n fullCut(): Promise<void>;\r\n partialCutAndFeedPaper(options: { length: number }): Promise<void>;\r\n fullCutAndFeedPaper(options: { length: number }): Promise<void>;\r\n\r\n // ── Text printing ──────────────────────────────────────\r\n printText(options: { text: string }): Promise<void>;\r\n printTextWithAlign(options: { text: string; align: number }): Promise<void>;\r\n printTextWithEncode(options: { text: string; encode: string }): Promise<void>;\r\n printTextBitmap(options: { text: string }): Promise<void>;\r\n printTextBitmapWithAlign(options: { text: string; align: number }): Promise<void>;\r\n\r\n // ── Column printing ────────────────────────────────────\r\n printColumnsText(options: { cols: string[]; widths: number[]; aligns: number[]; sizes: number[] }): Promise<void>;\r\n printColumnsString(options: { cols: string[]; widths: number[]; aligns: number[]; sizes: number[] }): Promise<void>;\r\n\r\n // ── QR / Barcode printing ──────────────────────────────\r\n printQrCode(options: { data: string }): Promise<void>;\r\n printQrCodeWithAlign(options: { data: string; align: number }): Promise<void>;\r\n printQrCodeFull(options: { data: string; size: number; errorLevel: number; align: number }): Promise<void>;\r\n printDoubleQR(options: { qr1: string; qr2: string }): Promise<void>;\r\n printBarCode(options: { data: string; type: number }): Promise<void>;\r\n printBarCodeWithAlign(options: { data: string; type: number; align: number }): Promise<void>;\r\n printBarCodeFull(options: { data: string; type: number; width: number; height: number; textPos: number; align: number }): Promise<void>;\r\n\r\n // ── Bitmap printing ────────────────────────────────────\r\n /** base64: PNG/JPEG base64 string (without data URI prefix) */\r\n printBitmapBase64(options: { base64: string }): Promise<void>;\r\n printBitmapBase64WithAlign(options: { base64: string; align: number }): Promise<void>;\r\n printerSelfChecking(): Promise<void>;\r\n /** Returns test page data as hex string */\r\n getPrinterTestData(): Promise<{ data: string }>;\r\n\r\n // ── Font style settings ────────────────────────────────\r\n setPageFormat(options: { format: number }): Promise<void>;\r\n setFontBold(options: { bold: boolean }): Promise<void>;\r\n setFontItalic(options: { italic: boolean }): Promise<void>;\r\n setFontUnderline(options: { underline: number }): Promise<void>;\r\n setFontAntiWhite(options: { antiWhite: boolean }): Promise<void>;\r\n setFontMultiple(options: { wide: number; high: number }): Promise<void>;\r\n setFontRotate(options: { rotate: number }): Promise<void>;\r\n setFontDirection(options: { direction: number }): Promise<void>;\r\n setFontLineSpacing(options: { space: number }): Promise<void>;\r\n setFontCharSpace(options: { space: number }): Promise<void>;\r\n setFontCodepage(options: { codepage: number }): Promise<void>;\r\n setFontCountryCode(options: { country: number }): Promise<void>;\r\n setLeftMargin(options: { size: number }): Promise<void>;\r\n setCodeAlignment(options: { align: number }): Promise<void>;\r\n\r\n // ── TextBitmap style settings ──────────────────────────\r\n setTextBitmapSize(options: { size: number }): Promise<void>;\r\n setTextBitmapTypeface(options: { typeface: string }): Promise<void>;\r\n setTextBitmapStyle(options: { style: number }): Promise<void>;\r\n setTextBitmapStrikeThru(options: { strikeThru: boolean }): Promise<void>;\r\n setTextBitmapUnderline(options: { underline: boolean }): Promise<void>;\r\n setTextBitmapLineSpacing(options: { space: number }): Promise<void>;\r\n setTextBitmapLetterSpacing(options: { space: number }): Promise<void>;\r\n setTextBitmapAntiWhite(options: { antiWhite: boolean }): Promise<void>;\r\n\r\n // ── QR / Barcode style settings ────────────────────────\r\n setQrCodeSize(options: { size: number }): Promise<void>;\r\n setQrCodeErrorLevel(options: { level: number }): Promise<void>;\r\n setBarCodeWidth(options: { width: number }): Promise<void>;\r\n setBarCodeHeight(options: { height: number }): Promise<void>;\r\n setBarCodeContentPrintPos(options: { pos: number }): Promise<void>;\r\n setDoubleQRSize(options: { size: number }): Promise<void>;\r\n setDoubleQR1Level(options: { level: number }): Promise<void>;\r\n setDoubleQR2Level(options: { level: number }): Promise<void>;\r\n setDoubleQR1Version(options: { version: number }): Promise<void>;\r\n\r\n // ── Printer config ─────────────────────────────────────\r\n setPrinterDensity(options: { density: number }): Promise<void>;\r\n setPrinterSpeed(options: { speed: number }): Promise<void>;\r\n setPrinterMode(options: { mode: number }): Promise<void>;\r\n setPrinterEncode(options: { encode: number }): Promise<void>;\r\n setConnectInternalPrinter(options: { internal: boolean }): Promise<void>;\r\n\r\n // ── Buffer ─────────────────────────────────────────────\r\n enterPrinterBuffer(options: { clean: boolean }): Promise<void>;\r\n commitPrinterBuffer(): Promise<void>;\r\n exitPrinterBuffer(options: { clean: boolean }): Promise<void>;\r\n\r\n // ── Cash drawer ────────────────────────────────────────\r\n openDrawer(): Promise<void>;\r\n supportCashBox(): Promise<{ supported: boolean }>;\r\n}\r\n"]}
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjD,MAAM,WAAW,GAAG,cAAc,CAAoB,aAAa,EAAE;IACnE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,CAAC;CAC7D,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\nimport type { IminPrinterPlugin } from './definitions';\n\nconst IminPrinter = registerPlugin<IminPrinterPlugin>('IminPrinter', {\n web: () => import('./web').then(m => new m.IminPrinterWeb()),\n});\n\nexport * from './definitions';\nexport { IminPrinter };\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjD,MAAM,WAAW,GAAG,cAAc,CAAoB,aAAa,EAAE;IACnE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,CAAC;CAC7D,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\r\nimport type { IminPrinterPlugin } from './definitions';\r\n\r\nconst IminPrinter = registerPlugin<IminPrinterPlugin>('IminPrinter', {\r\n web: () => import('./web').then(m => new m.IminPrinterWeb()),\r\n});\r\n\r\nexport * from './definitions';\r\nexport { IminPrinter };\r\n"]}
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,uDAAuD,CAAC,CAAC;AAEzF,MAAM,OAAO,cAAe,SAAQ,SAAS;IAC3C,KAAK,CAAC,WAAW,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;IAC/B,KAAK,CAAC,aAAa,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;IACjC,KAAK,CAAC,gBAAgB,KAAK,IAAI,EAAE,CAAC,CAAC,OAAO,E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AAK,CAAC,iBAAiB,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;IACrC,KAAK,CAAC,UAAU,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;IAC9B,KAAK,CAAC,cAAc,KAAK,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;CAChE","sourcesContent":["import { WebPlugin } from '@capacitor/core';\nimport type { IminPrinterPlugin } from './definitions';\n\nconst warn = () => console.warn('IminPrinter is only available on iMin Android devices');\n\nexport class IminPrinterWeb extends WebPlugin implements IminPrinterPlugin {\n async initPrinter() { warn(); }\n async deInitPrinter() { warn(); }\n async getPrinterStatus() { warn(); return { code: -1 }; }\n async getPrinterSupplierName() { warn(); return { value: '' }; }\n async getServiceVersion() { warn(); return { value: '' }; }\n async getSDKVersion() { warn(); return { value: '' }; }\n async getConnectInternalPrinter() { warn(); return { value: false }; }\n async getPrinterDensity() { warn(); return { value: -1 }; }\n async getPrinterSpeed() { warn(); return { value: -1 }; }\n async getPrinterMode() { warn(); return { value: -1 }; }\n async getPrinterPaperType() { warn(); return { value: -1 }; }\n async getDrawerStatus() { warn(); return { open: false }; }\n async getOpenDrawerTimes() { warn(); return { times: 0 }; }\n async getPrinterModelName() { warn(); return { value: '' }; }\n async getPrinterSerialNumber() { warn(); return { value: '' }; }\n async getPrinterFirmwareVersion() { warn(); return { value: '' }; }\n async getPrinterHardwareVersion() { warn(); return { value: '' }; }\n async getPrinterThermalHead() { warn(); return { value: '' }; }\n async getPrinterCutTimes() { warn(); return { value: '' }; }\n async getPrinterPaperDistance() { warn(); return { value: '' }; }\n async getPrinterTemperature() { warn(); return { value: '' }; }\n async sendRawData() { warn(); }\n async print() { warn(); }\n async printAndLineFeed() { warn(); }\n async printAndFeedPaper() { warn(); }\n async printAndQuitPaper() { warn(); }\n async partialCut() { warn(); }\n async fullCut() { warn(); }\n async partialCutAndFeedPaper() { warn(); }\n async fullCutAndFeedPaper() { warn(); }\n async printText() { warn(); }\n async printTextWithAlign() { warn(); }\n async printTextWithEncode() { warn(); }\n async printTextBitmap() { warn(); }\n async printTextBitmapWithAlign() { warn(); }\n async printColumnsText() { warn(); }\n async printColumnsString() { warn(); }\n async printQrCode() { warn(); }\n async printQrCodeWithAlign() { warn(); }\n async printQrCodeFull() { warn(); }\n async printDoubleQR() { warn(); }\n async printBarCode() { warn(); }\n async printBarCodeWithAlign() { warn(); }\n async printBarCodeFull() { warn(); }\n async printBitmapBase64() { warn(); }\n async printBitmapBase64WithAlign() { warn(); }\n async printerSelfChecking() { warn(); }\n async getPrinterTestData() { warn(); return { data: '' }; }\n async setPageFormat() { warn(); }\n async setFontBold() { warn(); }\n async setFontItalic() { warn(); }\n async setFontUnderline() { warn(); }\n async setFontAntiWhite() { warn(); }\n async setFontMultiple() { warn(); }\n async setFontRotate() { warn(); }\n async setFontDirection() { warn(); }\n async setFontLineSpacing() { warn(); }\n async setFontCharSpace() { warn(); }\n async setFontCodepage() { warn(); }\n async setFontCountryCode() { warn(); }\n async setLeftMargin() { warn(); }\n async setCodeAlignment() { warn(); }\n async setTextBitmapSize() { warn(); }\n async setTextBitmapTypeface() { warn(); }\n async setTextBitmapStyle() { warn(); }\n async setTextBitmapStrikeThru() { warn(); }\n async setTextBitmapUnderline() { warn(); }\n async setTextBitmapLineSpacing() { warn(); }\n async setTextBitmapLetterSpacing() { warn(); }\n async setTextBitmapAntiWhite() { warn(); }\n async setQrCodeSize() { warn(); }\n async setQrCodeErrorLevel() { warn(); }\n async setBarCodeWidth() { warn(); }\n async setBarCodeHeight() { warn(); }\n async setBarCodeContentPrintPos() { warn(); }\n async setDoubleQRSize() { warn(); }\n async setDoubleQR1Level() { warn(); }\n async setDoubleQR2Level() { warn(); }\n async setDoubleQR1Version() { warn(); }\n async setPrinterDensity() { warn(); }\n async setPrinterSpeed() { warn(); }\n async setPrinterMode() { warn(); }\n async setPrinterEncode() { warn(); }\n async setConnectInternalPrinter() { warn(); }\n async enterPrinterBuffer() { warn(); }\n async commitPrinterBuffer() { warn(); }\n async exitPrinterBuffer() { warn(); }\n async openDrawer() { warn(); }\n async supportCashBox() { warn(); return { supported: false }; }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,uDAAuD,CAAC,CAAC;AAEzF,MAAM,OAAO,cAAe,SAAQ,SAAS;IAC3C,KAAK,CAAC,WAAW,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;IAC/B,KAAK,CAAC,aAAa,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;IACjC,KAAK,CAAC,gBAAgB,KAAK,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACzD,KAAK,CAAC,sBAAsB,KAAK,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAChE,KAAK,CAAC,iBAAiB,KAAK,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAC3D,KAAK,CAAC,aAAa,KAAK,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACvD,KAAK,CAAC,yBAAyB,KAAK,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IACtE,KAAK,CAAC,iBAAiB,KAAK,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3D,KAAK,CAAC,eAAe,KAAK,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,K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AC,iBAAiB,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;IACrC,KAAK,CAAC,mBAAmB,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;IACvC,KAAK,CAAC,iBAAiB,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;IACrC,KAAK,CAAC,eAAe,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;IACnC,KAAK,CAAC,cAAc,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;IAClC,KAAK,CAAC,gBAAgB,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;IACpC,KAAK,CAAC,yBAAyB,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;IAC7C,KAAK,CAAC,kBAAkB,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;IACtC,KAAK,CAAC,mBAAmB,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;IACvC,KAAK,CAAC,iBAAiB,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;IACrC,KAAK,CAAC,UAAU,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;IAC9B,KAAK,CAAC,cAAc,KAAK,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;CAChE","sourcesContent":["import { WebPlugin } from '@capacitor/core';\r\nimport type { IminPrinterPlugin } from './definitions';\r\n\r\nconst warn = () => console.warn('IminPrinter is only available on iMin Android devices');\r\n\r\nexport class IminPrinterWeb extends WebPlugin implements IminPrinterPlugin {\r\n async initPrinter() { warn(); }\r\n async deInitPrinter() { warn(); }\r\n async getPrinterStatus() { warn(); return { code: -1 }; }\r\n async getPrinterSupplierName() { warn(); return { value: '' }; }\r\n async getServiceVersion() { warn(); return { value: '' }; }\r\n async getSDKVersion() { warn(); return { value: '' }; }\r\n async getConnectInternalPrinter() { warn(); return { value: false }; }\r\n async getPrinterDensity() { warn(); return { value: -1 }; }\r\n async getPrinterSpeed() { warn(); return { value: -1 }; }\r\n async getPrinterMode() { warn(); return { value: -1 }; }\r\n async getPrinterPaperType() { warn(); return { value: -1 }; }\r\n async getDrawerStatus() { warn(); return { open: false }; }\r\n async getOpenDrawerTimes() { warn(); return { times: 0 }; }\r\n async getPrinterModelName() { warn(); return { value: '' }; }\r\n async getPrinterSerialNumber() { warn(); return { value: '' }; }\r\n async getPrinterFirmwareVersion() { warn(); return { value: '' }; }\r\n async getPrinterHardwareVersion() { warn(); return { value: '' }; }\r\n async getPrinterThermalHead() { warn(); return { value: '' }; }\r\n async getPrinterCutTimes() { warn(); return { value: '' }; }\r\n async getPrinterPaperDistance() { warn(); return { value: '' }; }\r\n async getPrinterTemperature() { warn(); return { value: '' }; }\r\n async sendRawData() { warn(); }\r\n async print() { warn(); }\r\n async printAndLineFeed() { warn(); }\r\n async printAndFeedPaper() { warn(); }\r\n async printAndQuitPaper() { warn(); }\r\n async partialCut() { warn(); }\r\n async fullCut() { warn(); }\r\n async partialCutAndFeedPaper() { warn(); }\r\n async fullCutAndFeedPaper() { warn(); }\r\n async printText() { warn(); }\r\n async printTextWithAlign() { warn(); }\r\n async printTextWithEncode() { warn(); }\r\n async printTextBitmap() { warn(); }\r\n async printTextBitmapWithAlign() { warn(); }\r\n async printColumnsText() { warn(); }\r\n async printColumnsString() { warn(); }\r\n async printQrCode() { warn(); }\r\n async printQrCodeWithAlign() { warn(); }\r\n async printQrCodeFull() { warn(); }\r\n async printDoubleQR() { warn(); }\r\n async printBarCode() { warn(); }\r\n async printBarCodeWithAlign() { warn(); }\r\n async printBarCodeFull() { warn(); }\r\n async printBitmapBase64() { warn(); }\r\n async printBitmapBase64WithAlign() { warn(); }\r\n async printerSelfChecking() { warn(); }\r\n async getPrinterTestData() { warn(); return { data: '' }; }\r\n async setPageFormat() { warn(); }\r\n async setFontBold() { warn(); }\r\n async setFontItalic() { warn(); }\r\n async setFontUnderline() { warn(); }\r\n async setFontAntiWhite() { warn(); }\r\n async setFontMultiple() { warn(); }\r\n async setFontRotate() { warn(); }\r\n async setFontDirection() { warn(); }\r\n async setFontLineSpacing() { warn(); }\r\n async setFontCharSpace() { warn(); }\r\n async setFontCodepage() { warn(); }\r\n async setFontCountryCode() { warn(); }\r\n async setLeftMargin() { warn(); }\r\n async setCodeAlignment() { warn(); }\r\n async setTextBitmapSize() { warn(); }\r\n async setTextBitmapTypeface() { warn(); }\r\n async setTextBitmapStyle() { warn(); }\r\n async setTextBitmapStrikeThru() { warn(); }\r\n async setTextBitmapUnderline() { warn(); }\r\n async setTextBitmapLineSpacing() { warn(); }\r\n async setTextBitmapLetterSpacing() { warn(); }\r\n async setTextBitmapAntiWhite() { warn(); }\r\n async setQrCodeSize() { warn(); }\r\n async setQrCodeErrorLevel() { warn(); }\r\n async setBarCodeWidth() { warn(); }\r\n async setBarCodeHeight() { warn(); }\r\n async setBarCodeContentPrintPos() { warn(); }\r\n async setDoubleQRSize() { warn(); }\r\n async setDoubleQR1Level() { warn(); }\r\n async setDoubleQR2Level() { warn(); }\r\n async setDoubleQR1Version() { warn(); }\r\n async setPrinterDensity() { warn(); }\r\n async setPrinterSpeed() { warn(); }\r\n async setPrinterMode() { warn(); }\r\n async setPrinterEncode() { warn(); }\r\n async setConnectInternalPrinter() { warn(); }\r\n async enterPrinterBuffer() { warn(); }\r\n async commitPrinterBuffer() { warn(); }\r\n async exitPrinterBuffer() { warn(); }\r\n async openDrawer() { warn(); }\r\n async supportCashBox() { warn(); return { supported: false }; }\r\n}\r\n"]}
|