cordova-plugin-epson-spectrum
A Cordova Epson Printer Plugin
Install
Cordova: cordova plugin add cordova-plugin-epson-spectrum
Tested successfully with
Usage
Implemented methods
* addTextAlign
* addText
* addTextLang
* addTextPosition
* addTextSmooth
* addTextFont
* addTextSize
* addTextStyle
* addFeedLine
* addCut
* addBarcode
* addFeedUnit
* addTextRotate
* addHLine
* addSound
* addImage
* addLogo
Print method
var args = [{
printer: {
model: "TM-P20",
lineTimeout: 1000,
connectionType: "bluetooth",
autoconnect: true,
address: "00:01:90:72:2A:BE"
},
builder: [
{
method: "addTextPosition",
params: [
{
index: 0,
value: 0
}
]
},
{
method: "addTextSmooth",
params: [
{
index: 0,
value: 1
}
]
},
{
method: "addTextStyle",
params: [
{
index: 0,
value: 0
},
{
index: 1,
value: 0,
},
{
index: 2,
value: 0,
},
{
index: 3,
value: 1,
}
],
},
{
method: "addText",
params: [
{
index: 0,
value: "SC TEST SRL" + "\n"
}
]
},
{
method: "addBarcode",
params: [
{
index: 0,
value: "5012345678900"
},
{
index: 1,
value: 2
},
{
index: 2,
value: 2
},
{
index: 3,
value: 0
},
{
index: 4,
value: 2
},
{
index: 5,
value: 12
}
]
},
{
method: "addSound",
params: [
{
index: 0,
value: 8
},
{
index: 1,
value: 3
},
{
index: 2,
value: 1000
}
]
},
{
method: "addCut",
params: [
{
index: 0,
value: 1
}
]
}
]
]
}];
window.plugins.epson.print(function (succes) {
alert("succes: " + succes);
},
function (err) {
alert("error: " + err);
},
args);