Home → WINDEV Mobile 27 → Android Print image on bluetooth printer
Android Print image on bluetooth printer
Started by Jonathan, Sep., 21 2022 7:31 PM - 1 reply
Posted on September, 21 2022 - 7:31 PM
How to print QR image on bluetooth thermal printer
Registered member
6 messages
Posted on October, 28 2022 - 7:00 AM
Turns out there's nothing wrong with my ESC/POS codes. After tracing around and finding the point where the software prints, i ran my own test and sent it to the serial port, producing a QR code.
Here's what i used for reference:

uint8_t myEscTst[] = { 0x1B, 0x40, 0x1B, 0x21, 0x00, 'H', 'e', 'l', 'l', 'o', ',', ' ', 't', 'h', 'e', 'r', 'm', 'a', 'l', ' ', 'w', 'o', 'r', 'l', 'd', '!', 0x1B, 0x64, 0x03 };
write(serialFD, myEscTst, sizeof(myEscTst));

uint8_t qrEsc165[] = { 0x1D, 0x28, 0x6B, 0x04, 0x00, 0x31, 0x41, 0x32, 0x00 };
write(serialFD, qrEsc165, sizeof(qrEsc165));

uint8_t qrEsc167[] = { 0x1D, 0x28, 0x6B, 0x03, 0x00, 0x31, 0x43, 0x08 };
write(serialFD, qrEsc167, sizeof(qrEsc167));

uint8_t qrEsc169[] = { 0x1D, 0x28, 0x6B, 0x03, 0x00, 0x31, 0x45, 0x31 };
write(serialFD, qrEsc169, sizeof(qrEsc169));

uint8_t qrEsc180[] = { 0x1D, 0x28, 0x6B, 0x0E, 0x00, 0x31, 0x50, 0x30, 'i', ' ', 'a', 'm', ' ', 'a', ' ', 't', 'e', 's', 't' };
write(serialFD, qrEsc180, sizeof(qrEsc180));

uint8_t qrEsc181[] = { 0x1D, 0x28, 0x6B, 0x03, 0x00, 0x31, 0x51, 0x30 };
write(serialFD, qrEsc181, sizeof(qrEsc181));

uint8_t qrEsc182[] = { 0x1D, 0x28, 0x6B, 0x03, 0x00, 0x31, 0x52, 0x30 };
write(serialFD, qrEsc182, sizeof(qrEsc182));

uint8_t qrEscLn3[] = { 0x1B, 0x64, 0x03 };
write(serialFD, qrEscLn3, sizeof(qrEscLn3));

this links will help you: