Klemen1337 / node-thermal-printer

Node.js module for Epson, Star, Tanca, Drauma and Brother thermal printers command line printing.
MIT License
773 stars 244 forks source link

Can't print images/barcodes/QR codes #33

Closed megaed closed 5 years ago

megaed commented 7 years ago

I have successfully printed texts and was able to confirm that most of the text options work but...

I noticed that I can't print anything else. I tried transferring an image onto my raspberry pi which is the computer utilizing the thermal printer, it was in PNG format. I then followed the examples and it just won't print out the image. It did move the thermal paper but nothing was printed.

When I tried printing out barcodes -- same result.. barcodes. I tried printing different formats.

I then moved onto the QR code hoping that would work but... no luck.

AVanVlack commented 7 years ago

What printer are you using?

megaed commented 7 years ago

https://www.banggood.com/POS-5890K-58mm-Thermal-Receipt-Printer-Support-WIndows-Linux-p-1053549.html

I'm using this printer.

AVanVlack commented 7 years ago

It looks like that printer supports the basic esc/pos printer commands but is not able to build QR codes in the printer itself. You will have to uses another library to build a raster image of the QR code.

The 1d barcodes should work but is dose not seem to support the hri font command and the way I have it implimented right now it always sends all the setting commands and most likely confuses the printer. Will rethink that implementation but if you go into the library and delete out that line it might work. Lines 461-467 in node-thermal-printer.js

The image printing command in this library is using a older command to print the images that your print seems to support. Not sure how much it would take to convert it to use the newer commands.

megaed commented 7 years ago

I applied the fix you suggested for the barcode and it started to work.

Since I can't build the QR code within the printer itself and I have to be able to generate a raster image of the QR code that means -- I still have to print the QR code as an image which I still can't seem to get working.

You said that the image printing should work on my printer but no image is sent to my printer after calling the printImage function... (sometimes it prints out nulls on the thermal paper) it returns true whenever I console log the callback.

Is there a way to get this working? Or Am I using it incorrectly?

node escpos can get the printer to work with images and qrcodes but -- it's not as fast as printing. It may have something to do with the interface...


Thanks!

5zirok commented 6 years ago

I also use such a 5890K printer. And I can not print the Cyrillic alphabet. What can be wrong?

thamjieying commented 6 years ago

I can't print image as well, does anyone know what is the problem?

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.