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 incompatibility #5

Closed fredow closed 5 years ago

fredow commented 5 years ago

Hi,

I feel there are problems with the plugin regarding the ESC/POS commands. The only one that work is the line feed. Actually, in your docs you say the command is "0C", but what really works is "0A". According the industry standards it's not 0C but 0A.

One reference for Epson, but most of manufacturer follows these standards: https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=72#commands

The problem is that none of these hex nor decimal commands works using your function "BTPrinter.printPOSCommand"

I have tested the same printer with a known android APP that is on the market, and that app (not using your plugin) was able to send ESC/POS commands such as cutting the paper.

For the context, I will be supporting you with this plugin as I find it very useful thank you. I will be using it in a real world environment managing a fleet of 100+ printers’ integrated programmatically with my tablets.

Thank you and keep it up!

Frederic

CesarBalzer commented 5 years ago

Actually this plugin has not been tested on Epson printers that I know so far, the command you say does not work is exactly as it says in the printer manual I am using, the MPT-II, as shown in the print below.

Captura de Tela 2019-08-22 às 21 16 20

If it didn't work at Epson, we need to see which commands are correct and how to print to the .java file, I suggest fork and treat as you see fit so you can use it as you need. I just made an adaptation of the plugin, so feel free to change it too. Thanks for watching, and I appreciate all the help to make the plugin even better.