Print using epson esc/p2 on TM U325D
I would like to print a text in bold style using epson esc commands, however, when i use ESC F, i lose the first letter.
serialPort.Write(new char[] { (char)27, (char)69 }, 0, 2);
serialPort.Write("Line in bold");
I got:
ine in bold
I guess something is missing to send to th开发者_运维问答e printer.
you need to use byte[]:
serialPort.Write(new byte[] { 27, 69 }, 0, 2);
serialPort.Write("Line in bold");
using char creates Unicode characters which are UTF16...
I could make it work by changing the command, using the master selection of styles:
ESC ! n
Where n can be a sum of any of the next values: 0: 10 cpp 1: 12 cpp 2: proportional 4: condensed 8: bold 16: double pass 32: wide 64: italic 128: underline
serialPort.Write(new byte[] { 27, 33, 9 }, 0, 3);
So, 9 = 1 + 8: 10 cpp and bold.
精彩评论