I am trying to print CPCL commands in toshiba printer using c# tcpclient socket programming.
System.Net.Sockets.TcpClient client = new System.Net.Sockets.TcpClient();
client.Connect(ipAddress, port)
StreamWriter writer = new StreamWriter(client.GetStream())
string printtemplate="! 0 200 200 300 1
PAGE-WIDTH 396
T 4 1 10 80 £75
T 4 1 140 80 £75
T 4 1 280 80 £75
FORM
PRINT" ;
byte[] unicodeBytes = Encoding.Unicode.GetBytes(printtemplate);
byte[] win1252bytes = Encoding.Convert(Encoding.Unicode, Encoding.GetEncoding(1252), unicodeBytes);
writer = new System.IO.StreamWriter(client.GetStream());
string win1252String = Encoding.GetEncoding(1252).GetString(win1252bytes);
writer.Write(win1252String);
writer.Flush();
writer.Close();
client.Close();