Zebra printer issue
Hi,
A guy who used to work in my position created an application in c# to print a label in zebra printer Ht-146. I am so new to this kind of application and not sure how he did that. I think he used EPL2 programming language to print it. My question is, is there any way that i could preview the label before printing it. Below is the code to print the label:
public
int printGreenLabel(string field1,string field2){StringBuilder sb =
new StringBuilder(2500);//O-Hardware oprions. O- Disable all the optionssb.Append("O" + Environment.NewLine);
//Q-will cause the printer to recalculate and reformat the image buffer.sb.Append("Q1014,1" + Environment.NewLine);
//q-set label width.sb.Append("q608" + Environment.NewLine);
//S-selects the speed of the printersb.Append("S3" + Environment.NewLine);
//D-Print densitysb.Append("D5" + Environment.NewLine);
//Z-Print orientation T-Prining from top of image buffersb.Append("ZT" + Environment.NewLine);
//JF-Top of the form back up featuresb.Append("JF" + Environment.NewLine);
sb.Append(Environment.NewLine);
//N-Clears the image buffer prior to building a new label imagesb.Append("N" + Environment.NewLine);
//LE-Line draw exclusivesb.Append("LE305,2,1,1013" + Environment.NewLine);
//X-Draws a box shape P1-Horizontal start position P2-Vertical start position P3-Line thickness//P4-Horizontal end position P5-Vertical end positionsb.Append("X305,507,1,458,1016" + Environment.NewLine);
sb.Append(Environment.NewLine);
sb.Append("X305,0,1,458,509" + Environment.NewLine);
sb.Append(Environment.NewLine);
//A -Command(ASCII), P1-Horizontal start position P2-Vertical Start Position P3-Rotation (3-270 degrees)//P4 - Font Selection P5- Horizontal multiplier P6 - Vertical multiplier N-Normal or R-Reverse image.sb.Append("A10,1009,3,3,1,1,N,\"PART NO. AND ITEM DESCRIPTION\"" + Environment.NewLine);
//LE-Line Draw Exclusive P1-Horizontal start position P2-Vertical start posiion P3-Horizontal length in dots//P4-P4-Vertical length in dotssb.Append("LE83,38,1,508" + Environment.NewLine);
sb.Append("LE83,38,1,508" + Environment.NewLine);
sb.Append("A109,1010,3,3,1,1,N,\"PN: " + field1 + "\"" + Environment.NewLine);
sb.Append("A133,1010,3,3,1,1,N,\"\"" + Environment.NewLine);
sb.Append("A157,1010,3,3,1,1,N,\"\"" + Environment.NewLine);
sb.Append("A181,1010,3,3,1,1,N,\"" + field2 + "\"" + Environment.NewLine);
sb.Append("A205,1010,3,3,1,1,N,\"\"" + Environment.NewLine);
printString = sb.ToString();
sendBytes = Encoding.ASCII.GetBytes(printString);
strlength = printString.Length;
try{
TcpClient printer =
new TcpClient(ip,portno);NetworkStream strm = printer.GetStream();
strm.Write(sendBytes, 0, strlength);
strm.Close();
printer.Close();
}
catch (Exception exc){
return -1;}
return 1;}
Can anyone explain me whether there is any way to preview this label before printing it? I would really appreciate your help.
Thanks

