0

The Software Developer's Manual gives this sequence as a simple example:

DIRECTION 0
CLS
TEXT 56,24,"3",0,1,1,"ABC"
PRINT 1

With

lpr -P Brother-TD4750 brother.txt 

under Linux the printer now prints the four lines directly. And of course not formatted. I expected the three letters "ABC".

How can I tell the printer that control commands for FBPL are coming? Is there an initiated control sequence?

The printer also supports ZPL. In the meantime I understood that I have to convert the ^-sign as hex 1B

ZPL:

^XA
^FO50,50^ADN,36,20^FDHugo
^FS
^XZ
Twistleton
  • 2,735
  • 5
  • 26
  • 37
  • Your sequence is a sequence of printer commands. That's what printer drivers are supposed to do. If you're just printing text, send the text to the printer. If you're printing graphics, look into the Oracle tutorial [Printing](https://docs.oracle.com/javase/tutorial/2d/printing/index.html). – Gilbert Le Blanc Mar 23 '21 at 20:42
  • @GilbertLeBlanc Thank you. And how do I make the printer recognize the printer commands as printer commands themselves? And not as a simple text. This is my problem. – Twistleton Mar 24 '21 at 09:46
  • You look up how to write a printer driver for the Unix operating system. Or you follow the link I already provided. – Gilbert Le Blanc Mar 24 '21 at 12:03
  • @GilbertLeBlanc I can print graphics, but the printer also has a built-in cutter. And after printing, the continuous paper is still to be cut off. The idea to create the content as a graphic is good. But I still need to control the printer for the cutter. The printer also supports ZPL. – Twistleton Mar 24 '21 at 13:04
  • the -l parameter for lpr command in my answer does not perform what you need? – david-ao Mar 26 '21 at 19:06

1 Answers1

1

Using java you will have to write the hex representation of the commands you want to send.

Then from java you will need to call lpr -P Brother-TD4750 -l brotherHexVersion.txt

https://explainshell.com/explain/1/lpr

How to run Linux commands in Java?

These answers will give you more insight on other problmens you might encounter:

How to send ESC/POS commands to thermal printer in Linux

david-ao
  • 3,000
  • 5
  • 12