Search code examples
typescriptdenoescpos

Deno: send ANSI print instruction to ESC-POS printer


Hey I am currently trying to write a backend application that sends an instruction to an ESC-POS printer. The printer should then print a ticket for a prize draw.

The current workaround is to manipulate a word template using a python script and then send it to the printer using word. This has several disadvantages. If the word template is incorrectly formatted in any way, the print job will fail. In addition, Word must be installed on the computer. The template must be present in the correct place. And so on...

To make this better, I'm trying to implement the whole thing in Deno using TypeScript.

I've already done some research on how I could implement this with Deno, but haven't really found anything suitable.

The printer I use is a: MunByn (Model: ITPP047UE-WH) I have uploaded the PDF instructions and manuals here. Other instructions can be found here (official EPSON guide).

It is a simple ESC-POS printer, which is currently connected via an Ethernet to USB adapter (printer -> ethernet cable -> adapter -> USB cable -> PC). The reason for this is because the printer is not shown as a COM device, but only as USB001 when connected via USB. I have also tested several programs to create a virtual com port, but without success.

Is it possible to implement the communication between Deno and the printer?

Thanks ~Mqx


Solution

  • I also finally found a way to enable the COM port. I had to change a setting in the application software (Print TEST V3.30C) under Advanced -> DIP Setting: P80 Set DIP -> Virtual COM to USB -> YES.

    Printer TEST V3.30C

    Printer TEST V3.30C

    Printer TEST V3.30C