Question

I would like to print a hex file on a receipt printer. For testing, I use the cmd with the command: "copy /b test.hex lpt3:"

Now I would like a java programm, which can send the test.hex to the printer, but not as graphic.

Please, can someone tell me, how I can do that?

Thanks in advance :D

Was it helpful?

Solution

I am not sure about the syntax inside the string anymore, but you can always look that up. In Principle you can do this:

Runtime.getRuntime().exec("cmd /c start copy /b test.hex lpt3:");

Here is the reference!

So if you find no way to access that custom printer directly from java you can first create that .hex file, then use exec() to send it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top