michaelrsweet / lprint

A Label Printer Application
https://www.msweet.org/lprint
Apache License 2.0
227 stars 31 forks source link

Support for TSPL Printers #54

Closed GravisZro closed 8 months ago

GravisZro commented 2 years ago

I would like to see the support added for TSPL. TSPL was expanded it to TSPL2 and TSPL put out a massive manual but only TSPL is needed since it has a BITMAP command. Other companies use TSPL and have manuals which may mean they are using TSC components or they re-implemented the language.

Someone actually wrote an image to TSPL converter in javascript but it's really just sending this:

\r\nSIZE `label width` mm, `label height` mm
\r\nSET TEAR ON
\r\nSET CUTTER OFF
\r\nSET PEEL OFF
\r\nDENSITY `darkness`
\r\nCLS
\r\nBITMAP 0,0,`bitmap width`,`bitmap height`,1, `1-bit image data`
\r\nPRINT 1,1
\r\n

If you really wanted, you could send a raw raster data and make a program in TSPL to decode it. However, I'm pretty sure that could be done with ZPL and you didn't do that.

michaelrsweet commented 2 years ago

@GravisZro What specific printers do you want to support with this?

GravisZro commented 2 years ago

I don't have any specific model in mind but TSC has like 90 different label printers that all support TSPL.

proski commented 2 years ago

I considered adding support for Munbyn ITPP941, a TSPL printer, in #36 but got a reply that it won't be merged for legal reasons. I never started coding the change for LPrint. But I made a patch for rastertolabel, I use that code every day: https://github.com/proski/cups/commit/9ade138db4387ed016f70feb11a3b7a05daf04ca

GravisZro commented 2 years ago

@proski I would say just create a generic TSPL driver for LPrint and add all the known legitimate TSPL printers. If it's really a knockoff then it should be detected as one of the legitimate printers.

michaelrsweet commented 10 months ago

Initial check-in:

[master 2a72220] Start adding new drivers; initial TSPL driver.

michaelrsweet commented 8 months ago

Looks like there may be some issues (#113) but the basic driver is now in place. Closing.