srehanuddin / Cordova-Plugin-Bluetooth-Printer

A cordova plugin for bluetooth printer for android platform
103 stars 116 forks source link

Struggling to get working #12

Open Ridwaan-Maharaj opened 8 years ago

Ridwaan-Maharaj commented 8 years ago

Just Doesn't want to print ?

<script>
        function disconnect(){
   BTPrinter.disconnect(function(data){
console.log("Success");
console.log(data);

},function(err){ console.log("Error"); console.log(err); }, "C065120505");
}

ainulya16 commented 8 years ago

is it solved???

Ridwaan-Maharaj commented 8 years ago

Hi thanks for the reply, I got it working, but it seems I have to press print like twice for it to print on the thermal BT printer, any reason why?

Predator69 commented 8 years ago

@Ridwaan-Maharaj Its probably because you need to add a line feed after your text. That signals the printer to print the contents of the buffer and move to the next line. For example:

        var BlockOfText + "Name: John Smith, FAAO, OD" + String.fromCharCode(10);
        BlockOfText = BlockOfText + "Title: Professor" + String.fromCharCode(10);
        BlockOfText = BlockOfText + "Employer: University of Florida" + String.fromCharCode(10);

ESC/POS codes can be found here: http://www.delfi.com/SupportDL/Epson/Manuals/TM-T88IV/Programming%20manual%20APG_1005_receipt.pdf Note: Not all commands are supported by all printers - you'll need to experiment.

Ridwaan-Maharaj commented 7 years ago

You guys are awesome!!! and great work BTW, I owe you a Beer, everything works sorry for late reply :)