cordova-zebra-printer/README.md

39 lines
1.2 KiB
Markdown
Raw Normal View History

2018-04-27 18:48:52 +08:00
# cordova-zebra-printer
2019-04-05 23:12:21 +08:00
A Cordova plugin for Zebra CPCL printers for both iOS and Android with Ionic 3 bindings. This plugin only supports Zebra models that use CPCL printing. Feel free to contribute to this project if you need to support other methods of printing. It has only been tested with Zebra QLn320 printers. Let me know if you use if sucessfully with others.
2018-05-08 02:05:08 +08:00
Get from npm
```
cordova plugin add ca-cleversolutions-zebraprinter
```
or get the latest version from git
```
cordova plugin add https://github.com/cleversolutions/cordova-zebra-printer.git
```
2018-05-06 12:18:03 +08:00
2018-05-08 02:05:08 +08:00
To use with Ionic 3
2018-05-06 12:18:03 +08:00
Add the Ionic 3 bindings to your app.module.ts file
```
import { ZebraPrinter } from 'ca-cleversolutions-zebraprinter/native';
...
providers: [
ZebraPrinter,
...
```
Then inject the ZebraPrinter into the constructor of the class where you wish to use it
for example
```
constructor(public navCtrl: NavController, protected zebraPrinter:ZebraPrinter) {
console.log(">>>>>> Home Constructed <<<<<<<")
}
protected discover(){
console.log("Now Discover");
this.zebraPrinter.discover().then(result => {
console.log(result);
}).catch(err => {
console.error(err);
});
}
```