【发布时间】:2019-05-19 08:07:34
【问题描述】:
我正在尝试从我的 cordova 应用程序中打印一个 html 文件。 我已经安装了cordova-plugin-printer。 在 app.module.ts 文件中导入插件,然后当我尝试使用 this.printer.print('hello') 注意发生在所有
从'@ionic-native/printer/ngx'导入{打印机,PrintOptions};
私人打印机:打印机
Print(){
console.log("Print Pressed");
var options = {
font: {
size: 22,
italic: true,
align: 'center'
},
header: {
height: '6cm',
label: {
text: "\n\nDie Freuden",
font: {
bold: true,
size: 37,
align: 'center'
}
}
},
footer: {
height: '4cm',
label: {
text: 'Johann Wolfgang von Goethe, 1749-1832, deutscher Dichter, Naturforscher',
font: { align: 'center' }
}
}
};
this.printer.print("hello",options);
console.log("Print Pressed>>>");
}
【问题讨论】:
标签: ios cordova ionic-framework cordova-plugins printers