Allows to print on a Bluetooth thermal printer LX-D02 from your computer.
Supports printing images and (somewhat) text and test patterns.
Resize, dither and print image:
thermoprint -i image.png
Selecting different dither method:
thermoprint -i image.png -dither stucki
The following dithering algorithms are supported:
- atkinson
- bayer
- floyd-steinberg
- stucki
Default is "atkinson".
Printing text:
ls -l | fold -w 49 | thermoprint -t -
If you don't want text to be resized, you can use -crop
option, it will chop
off the image at the 384 pixel boundary.
thermoprint -crop -t "very long text that doesn't fit 58mm roll"
You can print test patterns to check printer quality:
thermoprint -pattern MillimeterLines
See pkg.go.dev for library functions.
This is based on the work in this repository https://github.com/big-vl/catcombo, which was used to understand the protocol, and used as a reference for document images detection.
Reason I didn't use it directly as my printer works slightly differently - it sends, what I called "hold"/"restart from" packages which are not handled in the original library.
- Debug Bluetooth Applications on iOS - used to trace communication between FunnyPrint and LX-D02.
- Catcombo repository by big-vl used to understand the protocol.
- Thermal Printer LX-D02 used in for this project.