How to send zpl.txt data to a network printer Know the IP address

Y Yonghui Li 3 years 7 months ago
5060 3 0

just said:
  my printer is ZT210 use Zebranet to get ip address . now i has a winform application with C# code . can i get the printer API to Development .
I need to generate text files for the zpl directive through the form user input information. Send this command to the printer. The printer is connected via an internal network. Can get an IP address!
   Now where is there an API that allows me to use it directly
Thanks

Please Register or Login to post a reply

3 Replies

B Bob LobLob

...

M Marco Antonio Montero Oropeza

Hello Yonghui Li
your need for this application, set the IP address on the printer. and in this way achieve the App-printer link.

Like you need now I do not have information that uses an API to achieve this.  (I do not know it, and do not know that it exists to ZPL text) this only exists through own programming such as the example provided.

You can emulate online a by print view page on your web browser:

api.labelary.com/v1/printers/8dpmm/labels/4x6/0/(your code )
p.e. (you code)=^xa  (bla bla bla bla) ^xz

paste your string in address , this line work for label 4*6 inch may be you need other size, You can get information about the topic in.
http://labelary.com/service.html

viewer on line
http://labelary.com/viewer.html

label on line whit the printer

Zebra Technologies - How to Preview a ZPL Label with a Network Printer

Best regards to you and good luck!

M Marco Antonio Montero Oropeza

// HELLO Yonghui Li, may be you, now has solve, or this solution.

// Printer IP Address and communication port
string ipAddress = "10.3.14.42";
int port = 9100;

// ZPL Command(s)
string ZPLString =
    "^XA" +
    "^FO50,50" +
    "^A0N50,50" +
    "^FDHello, World!^FS" +
    "^XZ";

try
{
    // Open connection
    System.Net.Sockets.TcpClient client = new System.Net.Sockets.TcpClient();
    client.Connect(ipAddress, port);

    // Write ZPL String to connection
    System.IO.StreamWriter writer =
new System.IO.StreamWriter(client.GetStream());
    writer.Write(ZPLString);
    writer.Flush();

    // Close Connection
    writer.Close();
    client.Close();
}
catch (Exception ex)
{
    // Catch Exception
}

// is a sample from the zebra website

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