envisiondata / cordova-plugin-starprinter

Cordova/PhoneGap plugin for the Star Bluetooth printer SM-T300I.
Apache License 2.0
3 stars 5 forks source link

cordova-plugin-starprinter

Cordova/PhoneGap plugin for the Star Bluetooth printer SM-T300I.

Installing

This plugin follows the Cordova 3.0+ plugin spec, so it can be installed through the Cordova CLI in your existing Cordova project: cordova plugin add https://github.com/envisiondata/cordova-plugin-starprinter.git

You can also look at this guys plugin. https://github.com/InteractiveObject/StarIOPlugin

JavaScript Usage

To check the status of the printer:

• plugin.printer.CheckStatus();

To check the Firmware Version of the printer:

• plugin.printer.CheckFirmwareVersion();

To print a sample receipt:

• plugin.printer.PrintSampleReceipt();

This will print the 3" sample from the Star Developer Kit.

To print a signature:

var success = function () { alert("Success"); };
var error = function (message) { alert("Oopsie! " + message); };
plugin.printer.PrintSignature($('#sig').signature('toJSON'), success, error);

• The json structure of the signature comes form this example.

o http://keith-wood.name/signature.html

Important

You should fork this repo, make your changes and link you project to your repo.