CesarBalzer / Cordova-Plugin-BTPrinter

A cordova plugin for bluetooth printer for android platform
Apache License 2.0
81 stars 64 forks source link

ESC/POS command not working. #12

Closed gemul closed 5 years ago

gemul commented 5 years ago

Hi, thank you for this great library. It works perfectly with an old china-made printer (GPrinter_399B) using printText method. However, printPOSCommand doesn't seems to work. i've tried printing "0A" (line feed), the console log shows "Data Sent", but the printer does nothing.

gemul commented 5 years ago

i've managed to do a line-feed by adding \n (new line) at the end of the string, so it looks like "0A\n". and the printer does the line-feed. i don't know whether it's the 0A command is working or because the \n character which does the line feed.

CesarBalzer commented 5 years ago

The POS commands, must be separated in my understanding, for example to skip 2 lines and give 2 feeds on paper, I use and it works like this:

BTPrinter.printPOSCommand(null, null, "0A");//Print and feed paper BTPrinter.printPOSCommand(null, null, "0A");//Print and feed paper