Zebra Label Printer with C#

Posted by user3702654 on Stack Overflow See other posts from Stack Overflow or by user3702654
Published on 2014-06-03T11:16:58Z Indexed on 2014/06/03 21:25 UTC
Read the original article Hit count: 199

Filed under:
|
|
|

I'm having trouble printing a label using ZDesigner GK420T using C# .NET. I converted the following string to Bytes and passed into the printer.

^XA 
^FO3,3^AD^FDZEBRA^FS
^XZ

The expected outcome was that the printer was supposed to print 'ZEBRA' but it didn't.

My C# Code:

StringBuilder sb; sb = new StringBuilder();
if (frmPrintJob._type != 1) 
{
    sb.AppendLine("^XA"); 
    sb.AppendLine("^FO3,3^AD^FDZEBRA^FS"); 
    sb.AppendLine("^XZ"); 
} 
int intTotalPrinted = 0; 
for (int i = 1; i <= NoOfCopies; i++) 
{ 
    if (RawPrinterHelper.SendStringToPrinter(PrinterName, sb.ToString()) == true) 
        intTotalPrinted++; 
}

What am I doing wrong here? Do I need any extra code?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET