Pat Farrell wrote:You want to send what are normally called "escape sequences" They have been used for printer, modem, and CRT controls since the early 1970s. Maybe earlier, that's when I first started using them.
How is this printer connected to your computer? In the olden days, the printers were connected with either parallel or serial connections. Serial connections required manual setup of a lot of very low level communications parameters that we just let the network handle for us these days. Things like parity, number of bits in a byte, etc. were important and had to be managed in the application software. Stuff we usually ignore, like the highest order bit in a character, can cause serious headaches over a serial line.
Stephan van Hulst wrote:The commands exist of ASCII characters. In the document the ascii decimal values are listed with the commands. n may be either the numerical value of the command you want to perform, or the character code representing that number.
48 is the decimal value for ascii '0'.
You can easily create the correct String like so: (char) 27 + 'd' + '0';