Closed vajahath closed 3 months ago
Also the https://en.wikipedia.org/wiki/Atkinson_dithering claims to provide better contrast than Floyd–Steinberg. Its integration may also provide slightly better results - just pointing out.
Good work. I do not have any thermal printers around at the moment. so that means it can work with any thermal printer brand. It does not have to be Epson or Star. ?
@vajahath
Thank you. Afaik, the printer itself doesn't have to be from Epson or star. Most printers I encountered (a fairly small number) do follow the Epson/star protocol. So you should be good to go. 🤞
Thanks for your reply. helpful :)
First, thank for your incredible work ⭐
I could keep this myself without bothering you. But seeing #64 and many others, I thought I could just open this issue.
I made a fork: https://github.com/vajahath/image-thermal-printer
What it basically does is convert the "thing to print" into an image (or
HTMLCanvasElemet
) and use the https://github.com/seokju-na/react-thermal-printer/blob/main/packages/printer/src/commands/image.ts image command on it.So far, it is working nice-ish (some tweaks needed here and there)
I converted my div into canvas (https://www.npmjs.com/package/html-to-image#toCanvas). Then printed it using the above command. This gave me unlimited customization.
(the printer I'm using is very old and of low quality - hence some lines segments are lost)
Because the printers are generally having low resolution, serif typeface may not be a good choice. I prefer sans serif typeface. Roboto is a good choice. (Noto as well). Any font that claims to work well in low-res could be a good choice.
Some advantages I found:
Cons:
200
) and possible print widths.This issue was to inform you an alternative method. Feel free to close this issue whenever you wish.