Set printing alignment in C#

// Expert user has replied.
E Efkan YILMAZ 3 years 5 months ago
6 1 0

Hello,
I am creating a windows form application and I want to set an alignment of a printer based on the command given by zebra support.
^XA^MFN,F^JUS^XZ
^XA^SS,,,1674^JUS^XZ
I am using PrinterUtil.SendContents(CONNECTION_STRING,"^XA^MFN,F^JUS^XZ^"); PrinterUtil.SendContents(CONNECTION_STRING," XA^SS,,,1674^JUS^XZ");
where CONNECTION_STRING = the ip address or name of the zeba printer.
I got an error "builder not correctly implemented" and also even in PrinterUitl.QuickStatus(CONNECTION_STRING); the same error I got.
Here is the sample code I've done
private void button1_Click(object sender, EventArgs e)
{
CONNECTION_STRING = textBox1.Text;
try
{
PrinterUtil.SendContents(CONNECTION_STRING, "^XA^MFN,F^JUS^XZ");
PrinterUtil.SendContents(CONNECTION_STRING, "^XA^SS,,,1674^JUS^XZ");
}
catch (ConnectionException ex)
{
MessageBox.Show(ex.Message);
}
catch(IOException ioex)
{
MessageBox.Show(ioex.Message);
}
}
private void button2_Click(object sender, EventArgs e)
{
CONNECTION_STRING = textBox1.Text;
var msg = PrinterUtil.QuickStatus(CONNECTION_STRING);
MessageBox.Show(msg);
}
Thanks in advance

Please Register or Login to post a reply

1 Replies

S Steven Si

Make sure you have the latest Link-OS SDK package in your project. It should be Zebra.Printer.SDK v2.15.2634. The CONNECTION_STRING should be IP address of the printer. 

CONTACT
Can’t find what you’re looking for?