Up until recently we have always shared our printing sample code on the Zebra Support / Knowledge Management site.  Due to popular demand, we have been migrating most of our samples to Github.  In fact, you can find samples and source code for many Zebra products there.  The printing samples are under the name LinkOS-OS-Samples.  Each individual sample is on it's own branch. 


Note: We will be shutting down the Knowledge Management site in the next month.  We are working to update links, please keep in mind this is a content migration and be patient with us.  


While we were going through our samples we found a few old code snippets.  Here is one of them that some of you might still find useful:

Send ZPL Commands via TCP/IP in

Confidential and Proprietary

The source code and other information contained herein is the confidential and the exclusive property of ZIH Corp. and is subject to the terms and conditions in your end user license agreement. This source code, and any other information contained herein, shall not be copied, reproduced, published, displayed or distributed, in whole or in part, in any medium, by any means, for any purpose except as expressly permitted under such license agreement.

Copyright ZIH Corp. 2012


This application demonstrates how to send ZPL commands to a network  ZPL printer.  It uses TcpClient to accomplish the communication.  It was written in Visual Studio 2008 in C# and tested successfully on a Windows XP machine with Service Pack 3 .

Sample Code

Dim ipAddress As String = ""

Dim port As Integer = 9100


Dim ZPLString As String = _

"^XA" & _

      "^FO50,50" & _

      "^A0N,50,50" & _

      "^FDHello, World!^FS" & _




      'Open Connection

      Dim client As New System.Net.Sockets.TcpClient

      client.Connect(ipAddress, port)


      'Write ZPL String to Connection

      Dim writer As New System.IO.StreamWriter(client.GetStream())




      'Close Connection




Catch ex As Exception


      'Catch Exception Here


End Try

Submitted by Anonymous (not verified) on November 09, 2011 Permalink

Hi Everyone, For your reference, the Samples are branched from the main projects.  Find them here:

Submitted by Anonymous (not verified) on May 04, 2019 Permalink

Hi, this is one of the reasons we're moving to a more available site like GitHub.  Knowledge Management is working again now though.