Click here to Skip to main content
15,900,907 members
Home / Discussions / C#
   

C#

 
GeneralRe: Hash Table - Issue Pin
mav.northwind1-Aug-05 9:27
mav.northwind1-Aug-05 9:27 
GeneralClosing Crystal Report's Database Connection Pin
kornstyle1-Aug-05 7:10
kornstyle1-Aug-05 7:10 
GeneralUNC Patch Problem for calling a batch file. Pin
tstang1-Aug-05 7:01
tstang1-Aug-05 7:01 
GeneralRe: UNC Patch Problem for calling a batch file. Pin
timbobsteve2-Aug-05 12:47
timbobsteve2-Aug-05 12:47 
GeneralVS 2005 Mobile Deployment Pin
Kee-Won Hong1-Aug-05 6:03
Kee-Won Hong1-Aug-05 6:03 
GeneralRe: VS 2005 Mobile Deployment Pin
Not Active1-Aug-05 6:51
mentorNot Active1-Aug-05 6:51 
GeneralRe: VS 2005 Mobile Deployment Pin
Kee-Won Hong1-Aug-05 6:52
Kee-Won Hong1-Aug-05 6:52 
GeneralLabel printing using zebra printers Pin
Sangee_CSC1-Aug-05 5:32
Sangee_CSC1-Aug-05 5:32 
Hi,

A programmer who used to work in my position created an application in ASP.net & c# (web application) 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. Right now the printer company zebra has discontinued this printer and I am not sure where to get help from. I don't have their programmer's manual to learn the EPL2language. 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 printlabel(string field1, string field2){

StringBuilder sb = new StringBuilder(2500);

//O-Hardware oprions. O- Disable all the options

sb.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 printer

sb.Append("S3" + Environment.NewLine);

//D-Print density

sb.Append("D5" + Environment.NewLine);

//Z-Print orientation T-Prining from top of image buffer

sb.Append("ZT" + Environment.NewLine);

//JF-Top of the form back up feature

sb.Append("JF" + Environment.NewLine);

sb.Append(Environment.NewLine);

//N-Clears the image buffer prior to building a new label image

sb.Append("N" + Environment.NewLine);

//LE-Line draw exclusive

sb.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 position

sb.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 dots

sb.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?
Is it possible for me to preview the label just by installing the print driver without the printer itself?
I would really appreciate your help.

NOTE: We have Bar-one software to create the label but not sure how to do that.
Thanks

GeneralRe: Label printing using zebra printers Pin
Renjith Ramachandran1-Aug-05 7:39
Renjith Ramachandran1-Aug-05 7:39 
GeneralRe: Label printing using zebra printers Pin
Anonymous1-Aug-05 7:56
Anonymous1-Aug-05 7:56 
GeneralC#.Net DB [Combox] Pin
| Muhammad Waqas Butt |1-Aug-05 5:17
professional| Muhammad Waqas Butt |1-Aug-05 5:17 
GeneralRe: C#.Net DB [Combox] Pin
Alomgir Miah1-Aug-05 7:30
Alomgir Miah1-Aug-05 7:30 
GeneralRe: C#.Net DB [Combox] Pin
| Muhammad Waqas Butt |1-Aug-05 21:45
professional| Muhammad Waqas Butt |1-Aug-05 21:45 
GeneralRe: C#.Net DB [Combox] Pin
Alomgir Miah2-Aug-05 3:15
Alomgir Miah2-Aug-05 3:15 
GeneralInstaller project help Pin
hokieprogrammer1-Aug-05 5:15
hokieprogrammer1-Aug-05 5:15 
GeneralMicrosoft Logging Application Block Pin
C0d3_P03t1-Aug-05 4:56
C0d3_P03t1-Aug-05 4:56 
GeneralRe: Microsoft Logging Application Block Pin
Mohamad Al Husseiny1-Aug-05 6:19
Mohamad Al Husseiny1-Aug-05 6:19 
GeneralRe: Microsoft Logging Application Block Pin
C0d3_P03t1-Aug-05 23:09
C0d3_P03t1-Aug-05 23:09 
GeneralSocks Tunneling Pin
Hadi Fakhreddine1-Aug-05 3:34
Hadi Fakhreddine1-Aug-05 3:34 
GeneralALT + SHIFT Effect Programatically Pin
Ali Beirami1-Aug-05 3:29
Ali Beirami1-Aug-05 3:29 
GeneralRe: ALT + SHIFT Effect Programatically Pin
Mohamad Al Husseiny1-Aug-05 4:38
Mohamad Al Husseiny1-Aug-05 4:38 
GeneralRSS related question Pin
profoundwhispers1-Aug-05 3:16
profoundwhispers1-Aug-05 3:16 
GeneralRe: RSS related question Pin
S. Senthil Kumar1-Aug-05 7:21
S. Senthil Kumar1-Aug-05 7:21 
GeneralParsing XML Pin
Neel071-Aug-05 2:30
Neel071-Aug-05 2:30 
GeneralRe: Parsing XML Pin
Lars Niedziolka1-Aug-05 14:16
Lars Niedziolka1-Aug-05 14:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.