cordova-plugin-epson-spectrum

1.1.11 • Public • Published

cordova-plugin-epson-spectrum

A Cordova Epson Printer Plugin

Install

Cordova: cordova plugin add cordova-plugin-epson-spectrum

Tested successfully with

  • Epson TM-P20

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
                }
              ] //TRUE = 1; FALSE = 0;
            },
            {
              method: "addTextStyle",
              params: [
                {
                  index: 0,
                  value: 0 //TRUE = 1; FALSE = 0;

                },
                {
                  index: 1,
                  value: 0, //TRUE = 1; FALSE = 0;
                },
                {
                  index: 2,
                  value: 0, //TRUE = 1; FALSE = 0;
                },
                {
                  index: 3,
                  value: 1, //COLOR_NONE = 0; COLOR_1 = 1; COLOR_2 = 2; COLOR_3 = 3; COLOR_4 = 4;
                }
              ],
            },
		        {
              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 // CUT_NO_FEED = 0; CUT_FEED = 1; CUT_RESERVE = 2;
                }
              ]
            }
          ]
		   ]
		 }];

window.plugins.epson.print(function (succes) {
  alert("succes: " + succes);
},
  function (err) {
	alert("error: " + err);
  },
  args);

Readme

Keywords

Package Sidebar

Install

npm i cordova-plugin-epson-spectrum

Weekly Downloads

65

Version

1.1.11

License

MIT

Unpacked Size

24.7 MB

Total Files

18

Last publish

Collaborators

  • marius.siminescu