8000 GitHub - rusq/thermoprint: LX-D02 thermal bluetooth printer go library
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

rusq/thermoprint

Repository files navigation

Thermal Bluetooth Printer LX-D02

Allows to print on a Bluetooth thermal printer LX-D02 from your computer.

Supports printing images and (somewhat) text and test patterns.

Images

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".

Text

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" 

Test patterns

You can print test patterns to check printer quality:

thermoprint -pattern MillimeterLines

Using as a library

See pkg.go.dev for library functions.

Credits

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.

References

About

LX-D02 thermal bluetooth printer go library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

0