DantSu / ESCPOS-ThermalPrinter-Android

Useful library to help Android developpers to print with (Bluetooth, TCP, USB) ESC/POS thermal printer.
MIT License
1.23k stars 375 forks source link

Print Image Not Work, EPSON TM-U220B 76mm (LAN/WIFI) #249

Closed ghost closed 2 years ago

ghost commented 2 years ago

Halo @DantSu i have problem in printer epson TM-U220B 76mm set 203dpi, print image not work. my payload like this:

    "[C]<img>PrinterTextParserImg.bytesToHexadecimalString(EscPosPrinterCommands.bitmapToBytes(image.rescale(maxWidth: 256))</img>\n\n" +
    "[L]\n" +
    "[L]<b>                 GS Shop                </b>" +

with result: WhatsApp Image 2022-01-26 at 5 31 45 PM

expectation like this, (to printer bluetooth 58mm, set 203dpi):

WhatsApp Image 2022-01-26 at 5 42 35 PM

Please help me

ghost commented 2 years ago

any solution?

DantSu commented 2 years ago

no, closed due to inactivity.

DantSu commented 2 years ago

TM-U220B seems to not be compatible with old image command. That's it.

ghost commented 2 years ago

do you have any suggestions for a new image command?

DantSu commented 2 years ago

Today the library use this command : https://www.epson-biz.com/modules/ref_escpos/index.php?content_id=94

They say :

[Recommended Functions]

This command is supported by only some of the printer models and will not be supported by future models. It is recommended to use graphics function (GS ( L <Function 50> and GS ( L / GS 8 L <Function 112> ). The graphics function is superior in operating to GS v 0 [obsolete command] for the following reasons:

  • Selecting a color for printing is possible.
  • Size setting in dot unit is possible.

But many "not Epson" printers don't know those commands, like my printer. I can't use it.