I already implemented EPSON SDK(for Bluetooth) and working fine, but not Working on other printers, is there is any general way to accomplish it. what is ESC command, How it works?,
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
Please find this one.It will help your problem. ESC/POS Command Reference provides detailed information on ESC/POS commands, such as standard command syntax and protocol. It targets programmers who want to control the printer with ESC/POS commands.
ESC/POS Command Reference is provided as replacement of ESC/POS APG for Paper Roll Printers. The ESC/POS APG for Paper Roll Printers, therefore, will not be revised anymore. ESC/POS Command Reference contains the command information for Standard models such as ANK model or Japanese model, and may contain Chinese models or South Asia models. The other models such as customized may support different commands or have a different range, or different default value of command parameters. Please refer to each product specification for them.
Use below code
Note : you can use OutPutStream object to write printer, no matter bluetooth or ethernet or wifi
by using above you can write ESC/POS commands to output stream directly
You have find and create an implementation for few different variants of printers, Most are compatible with another so it wont be that hard (plus you will be copying the vendors SDKs).
Then Create an interface which both implementation will use such as initialize, scan, printText, printImage, printBarCode
Read the device like so...
And use the results to determine which implementation to use, before defaulting to the one that works on most devices. An Interface will make you soon forget the trouble you went through.
an ESC command, is just an instruction to the printer, these are almost identical to most devices... they are used to start a new line, align text, bold etc.. Think of them like html markups (strong,h1,center) because you mix them with text you are going to print making it super easy to create cool looking prints.