B4R Question EscPosPrinter Thermal Printer

embedded

Active Member
Licensed User
Longtime User
I am working on a project in which thermal printer is used. There is a class in B4A Name EscPosPrinter written by Agraham. Can we use this class in B4R.
 

agraham

Expert
Licensed User
Longtime User
Possibly with some modification. It uses the B4A Serial library to connect to a Bluetooth printer and uses AsyncStreams with the input and output stream from the connected Serial object, though the input stream is not used by the EscPosPrinter class.

I don't know how much of the B4X language is implemented in B4R but once the printer is connected the actual printing code vectors all output as bytes through a 'WriteBytes' function and strings through a 'WriteString2' function which you could modify to send the data to however your printer is connected. I don't know if B4R supports Unicode internally so there might be mods needed to the 'WriteString2' function which re-codes Unicode to the printer code page.
 
Upvote 0

embedded

Active Member
Licensed User
Longtime User
Possibly with some modification. It uses the B4A Serial library to connect to a Bluetooth printer and uses AsyncStreams with the input and output stream from the connected Serial object, though the input stream is not used by the EscPosPrinter class.

I don't know how much of the B4X language is implemented in B4R but once the printer is connected the actual printing code vectors all output as bytes through a 'WriteBytes' function and strings through a 'WriteString2' function which you could modify to send the data to however your printer is connected. I don't know if B4R supports Unicode internally so there might be mods needed to the 'WriteString2' function which re-codes Unicode to the printer code page.
With some modification....it is usable.....Thanks for making the EscPOSPrinter class. After some time i will put an example of thermal printer with ESP32. Thanks
 
Upvote 0
Top