0

I have a web application and want to send receipt prints via ESC/POS to a thermal printer on the same ethernet network. Currently, printing text works fine, but I cannot make image printing works using GS V 0 command or ESC *.

Does anybody have a sample JavaScript code that shows how to send image prints to the thermal printer?

ZygD
  • 22,092
  • 39
  • 79
  • 102
Bob Ham
  • 1
  • 1
  • 1
  • 1
    These articles may be helpful. [ESC POS command ESC* for printing bit image on printer](https://stackoverflow.com/q/44107254/9014308), [Ionic 3: Print image using Bluetooth printer](https://stackoverflow.com/q/46904252/9014308), [ESCPOS - npm](https://www.npmjs.com/package/escpos) – kunif Jul 05 '21 at 06:04

1 Answers1

0

If you haven't yet, you may want to check out receiptline: "Transform markdown-like text to receipt printer commands."

I think it does more than you're asking, but I've used it to send images to an Epson TM-L30 printer with success.

Check out the receiptline designer for a working demo. The receiptline format takes a base64 encoded image and converts it to commands to send to the printer.

I use the receiptline npm package directly, but you may be able to peek at the source and extract what you need if you want to do it directly without this library.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Flet
  • 439
  • 2
  • 2