@capgo/capacitor-printer 8.0.9 → 8.0.11

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.
@@ -32,7 +32,7 @@ android {
32
32
  buildTypes {
33
33
  release {
34
34
  minifyEnabled false
35
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
35
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
36
36
  }
37
37
  }
38
38
  lintOptions {
@@ -105,18 +105,24 @@ public class Printer {
105
105
  }
106
106
 
107
107
  public void printHtml(String html, String name) throws Exception {
108
- // Create a WebView to render the HTML
109
- WebView webView = new WebView(context);
110
- webView.setWebViewClient(
111
- new WebViewClient() {
108
+ activity.runOnUiThread(
109
+ new Runnable() {
112
110
  @Override
113
- public void onPageFinished(WebView view, String url) {
114
- createWebPrintJob(view, name);
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 {
@@ -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.9";
12
+ private final String pluginVersion = "8.0.11";
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.9"
6
+ private let pluginVersion: String = "8.0.11"
7
7
  public let identifier = "PrinterPlugin"
8
8
  public let jsName = "Printer"
9
9
  public let pluginMethods: [CAPPluginMethod] = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-printer",
3
- "version": "8.0.9",
3
+ "version": "8.0.11",
4
4
  "description": "Capacitor plugin for printing documents, HTML, PDFs, images and web views",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",