parent
59f848b293
commit
75339c5fb5
@ -54,6 +54,7 @@ cordova plugin rm de.appplant.cordova.plugin.printer
|
||||
## ChangeLog
|
||||
#### Version 0.6.0 (not yet released)
|
||||
- [bugfix]: Printing wasn't possible because `isServiceAvailable` returns False IOS
|
||||
- [bugfix]: Using plugin prevents openDatabase() on Android
|
||||
- [feature]: Added Windows8 support<br>
|
||||
*Thanks to* ***pirvudoru***
|
||||
|
||||
|
@ -230,13 +230,14 @@ public class Printer extends CordovaPlugin {
|
||||
|
||||
page.setVisibility(View.INVISIBLE);
|
||||
page.getSettings().setJavaScriptEnabled(false);
|
||||
page.getSettings().setDatabaseEnabled(true);
|
||||
|
||||
page.setWebViewClient( new WebViewClient() {
|
||||
@Override
|
||||
public void onPageFinished(final WebView page, String url) {
|
||||
new Handler().postDelayed( new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@Override
|
||||
public void run() {
|
||||
Bitmap screenshot = self.takeScreenshot(page);
|
||||
File tmpFile = self.saveScreenshotToTmpFile(screenshot);
|
||||
ViewGroup vg = (ViewGroup)(page.getParent());
|
||||
@ -244,7 +245,7 @@ public class Printer extends CordovaPlugin {
|
||||
intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(tmpFile));
|
||||
|
||||
vg.removeView(page);
|
||||
}
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
|
@ -46,11 +46,11 @@ Printer.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Sends the content to the printer app or service.
|
||||
* Sends the content to a printer app or service.
|
||||
*
|
||||
* @param {String} content
|
||||
* HTML string or DOM node
|
||||
* if latter, innerHTML is used to get the contents
|
||||
* if latter, innerHTML is used to get the content
|
||||
* @param {Object?} options
|
||||
* Platform specific options
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user