Print Labels with Zebra Printers with C#

Joined
Jan 26, 2024
Messages
3
We have recently acquired a Zebra ZD421 and are trying to figure out how to print labels with it from our C# program. Currently we are also using a different printer, a Brother QL-800 where we simply:
  1. We design the Label template in their label design studio software (P-Touch Editor)
  2. We save the label template as a .lbx file
  3. In C# code we supply the .lbx file path and object data/values to the BPAC C# SDK/API
  4. Printer prints the label
This workflow is working fantastic in Brother and is really nice. Can somebody give advice on how to do the same/similar with the Zebra ZD421 and/or in the Zebra ecosystem equivalent?
 
Joined
Mar 3, 2026
Messages
1
To achieve a similar workflow with the Zebra ZD421 as you have with the Brother QL-800, you’ll need to transition from working with proprietary label design files (like the .lbx file) to Zebra’s own label design and printing solutions.


  1. ZebraDesigner Software:
    First, use Zebra's ZebraDesigner software to create and design your label templates. ZebraDesigner allows you to design labels with text, barcodes, and images. Once you have the design, you can save the template as a ZPL (Zebra Programming Language) file, which is used for printing on Zebra printers like the ZD421.
  2. Zebra SDK:
    Zebra provides an SDK for C# (Zebra .NET SDK) that allows you to communicate with the printer directly. The SDK can send ZPL commands to the printer, including the label template and data that you want to populate.
  3. Workflow:
    • Design your label in ZebraDesigner.
    • Save the template as a ZPL file.
    • In your C# code, you can load the ZPL template file and send the necessary data to replace placeholders in the ZPL script. This can be done using Zebra .NET SDK or by directly sending the ZPL commands to the printer.
  4. Zebra Printer Communication:
    You can use Zebra's SDK or Raw Printing methods to send the ZPL commands. The Zebra .NET SDK offers various APIs to interact with the printer and manage the print queue.

For example, the code might look something like this:



using Zebra.Sdk.Comm;
using Zebra.Sdk.Printer;

PrinterConnection connection = new TcpConnection("printer_ip_address", TcpConnection.DEFAULT_ZPL_TCP_PORT);
connection.Open();

string zplData = File.ReadAllText("path_to_your_zpl_template.zpl");
string filledZplData = zplData.Replace("{{DataPlaceholder}}", "YourDynamicData");

connection.Write(Encoding.UTF8.GetBytes(filledZplData));
connection.Close();



This will send your customized ZPL command to the printer for it to print the label.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top