對於離子2應用程序中使用李宣美V1打印,增加了對打印機本地插件通過執行離子2應用程序通過李宣美V1打印
cordova plugin add cordova-plugin-printer
首先我檢查打印機是否可用由
checkPrinter() {
this.printer.check().then(function() {
alert("Printer available");
}, function() {
alert("Printer not available");
});
}
它提醒「打印機可用」
但以下方法不提示任何消息
printData() {
this.printer.isAvailable().then(function() {
this.printer.print("Test Data").then(function() {
alert("Printed");
}, function() {
alert("Printing error");
});
}, function() {
alert('Unavailable');
});
}
於是我就打電話Printer.print直接的方法如下
printData(){
this.printer.print("Test Data").then(function() {
alert("Printed");
}, function() {
alert("Printing Error");
});
}
此方法打開打印對話框中選擇打印機
如果我選擇「所有打印機」從下拉菜單中選擇打印機,而不是'保存爲PDF',然後搜索屏幕出現,並繼續搜索...
是否缺少一些配置或者是否可以與使用cordova打印機插件的POS打印機進行交互?
謝謝。
感謝演示鏈接:) – mohnage7