@capgo/capacitor-printer 8.0.10 → 8.0.12
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.
|
@@ -105,18 +105,24 @@ public class Printer {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
public void printHtml(String html, String name) throws Exception {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
webView.setWebViewClient(
|
|
111
|
-
new WebViewClient() {
|
|
108
|
+
activity.runOnUiThread(
|
|
109
|
+
new Runnable() {
|
|
112
110
|
@Override
|
|
113
|
-
public void
|
|
114
|
-
|
|
111
|
+
public void run() {
|
|
112
|
+
WebView webView = new WebView(context);
|
|
113
|
+
webView.setWebViewClient(
|
|
114
|
+
new WebViewClient() {
|
|
115
|
+
@Override
|
|
116
|
+
public void onPageFinished(WebView view, String url) {
|
|
117
|
+
createWebPrintJob(view, name);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
webView.loadDataWithBaseURL(null, html, "text/html", "UTF-8", null);
|
|
115
123
|
}
|
|
116
124
|
}
|
|
117
125
|
);
|
|
118
|
-
|
|
119
|
-
webView.loadDataWithBaseURL(null, html, "text/html", "UTF-8", null);
|
|
120
126
|
}
|
|
121
127
|
|
|
122
128
|
public void printPdf(String path, String name) throws Exception {
|
|
@@ -280,7 +286,7 @@ public class Printer {
|
|
|
280
286
|
WriteResultCallback callback
|
|
281
287
|
) {
|
|
282
288
|
try (
|
|
283
|
-
InputStream input =
|
|
289
|
+
InputStream input = new java.io.FileInputStream(file);
|
|
284
290
|
OutputStream output = new FileOutputStream(destination.getFileDescriptor())
|
|
285
291
|
) {
|
|
286
292
|
byte[] buf = new byte[1024];
|
|
@@ -9,7 +9,7 @@ import com.getcapacitor.annotation.CapacitorPlugin;
|
|
|
9
9
|
@CapacitorPlugin(name = "Printer")
|
|
10
10
|
public class PrinterPlugin extends Plugin {
|
|
11
11
|
|
|
12
|
-
private final String pluginVersion = "8.0.
|
|
12
|
+
private final String pluginVersion = "8.0.12";
|
|
13
13
|
|
|
14
14
|
private Printer implementation;
|
|
15
15
|
|
|
@@ -3,7 +3,7 @@ import Capacitor
|
|
|
3
3
|
|
|
4
4
|
@objc(PrinterPlugin)
|
|
5
5
|
public class PrinterPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
6
|
-
private let pluginVersion: String = "8.0.
|
|
6
|
+
private let pluginVersion: String = "8.0.12"
|
|
7
7
|
public let identifier = "PrinterPlugin"
|
|
8
8
|
public let jsName = "Printer"
|
|
9
9
|
public let pluginMethods: [CAPPluginMethod] = [
|
package/package.json
CHANGED