That's the approach I used for my thermal printer based project. Render HTML/CSS to B/W Image and then print it on the thermal printer.

https://sales-and-dungeons.app/