lukevp / ESC-POS-.NET

Efficient, Easy to Use Thermal Printing & POS (Windows/Linux/OSX, WiFi/BT/USB/Ethernet)
MIT License
522 stars 171 forks source link

Xamarin Bluetooth Printing #216

Closed dddns closed 1 year ago

dddns commented 1 year ago

Howdy,

I've been trying several dll's for qrcode printing in xamarin, with the bluetooth printer. How could i see an example on how to print a qrcode with this esc-pos-.net?

Thanks in advanced,

lukevp commented 1 year ago

Hi @dddns,

This library is only for printing to thermal printers that support the ESC/POS standard command set. It's not a generic printer library.

Bluetooth on Xamarin is quite complex to support, and isn't currently in scope for this library. If you have an ESC/POS compatible thermal printer, the difficulty you will run into is regarding the bluetooth connectivity, which this library doesn't assist with. It currently supports TCP/IP printing (Wifi/Ethernet), USB-Serial printing, Serial printing, and file-like printing (for Unix OSes).

With Bluetooth on Xamarin you will have to decide if you want to do Bluetooth Low Energy or Classic Bluetooth. BLE would be my suggestion and can be implemented via several libraries here on GitHub. BLE is nice because you just need to know what characteristic your device needs for printing and you can print to it without any need for pairing - just scan for the device you expect and send to the right characteristic. At that point you're just doing a binary stream across BLE, and you can use the ESCPOS_NET library to generate the stream. This would require implementing a custom IPrinter extension that works with BLE.

Let me know if you are interested in sponsoring the development of this functionality commercially for this library. I have done several projects in the past to extend the library's functionality for different use cases and would be happy to discuss this further with you.