This is fork of https://github.com/megatdaharus/cordova-plugin-oniel-printer
I have added a method that takes Array to print multiple line in a one go.
I have tested against android only with 2te model.
- Android
Below are the methods for installing this plugin automatically using command line tools.
$ cordova plugin add https://github.com/sahyun1/cordova-plugin-oniel-printer.git
Declare cordova on top of the file just after other imports
import {Component, OnInit} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
declare let cordova: any;
@Component({
selector: 'app-folder',
templateUrl: './folder.page.html',
styleUrls: ['./folder.page.scss'],
})
setLandscape: function(isLandscape, onSuccess, onError) {
exec(onSuccess, onError, 'OnielPrinter', 'setLandscape', [isLandscape]);
},
printText: function (text, onSuccess, onError) {
exec(onSuccess, onError, 'OnielPrinter', 'printText', [text]);
},
type Line = {
label: string, // text to print
row: number, // position X
col: number // position Y,
param?: string // e.g. bold, align-right
}
cordova.plugins.bixolonPrint.printTextObj(obj: Line[], printerAddress, isLandscape, onSuccess, onError);
###Print barcode
printBarcode: function (type, data, onSuccess, onError) {
exec(onSuccess, onError, 'OnielPrinter', 'printBarcode', [type, data]);
},
getPairedDevices: function (onSuccess, onError) {
exec(onSuccess, onError, 'OnielPrinter', 'getPairedDevices');
},