我正在尝试测试应用程序中的打印功能。我正在使用katzer / cordova-plugin-printer。我创建了一个调用打印机的按钮,下面是我编写的代码,不确定其是否正确:
print(){
Printer.isAvailable().then(
()=>{
Printer.print("<h2>This is just a sample!</h2>").then(
()=>alert('Printing successfull'),
()=>{alert('Unable to print')}
);
},
(reason)=>{
alert('no printer found');
alert(reason)
});
}
我正在使用Android手机进行测试
您需要将printoptions与文档名称一起应用。
Printer.print("<h2>This is just a sample!</h2>", { name: 'testdoc' })
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句