Skip to main content
All CollectionsLabels and HardwareLabels
How to Create ZPL Definitions
How to Create ZPL Definitions
Miles Dinsmore avatar
Written by Miles Dinsmore
Updated over 2 years ago

You can create custom ZPL label definitions for more control over how your labels look. You can then paste your code into a custom ZPL label editor in MJ Platform.

Note: We cannot help with writing ZPL code. If you aren't comfortable working with code, use the regular label definition editor instead.

In this article:

Zebra Programming Language

What is ZPL?

ZPL (Zebra Programming Language) is used to describe what to print and where to print it on a page. Each command describes a format setting, placement setting, or printable data.

How to use MJ Platform data keys in ZPL code

We strongly recommend using a ZPL editor. You can find ZPL editors online.

When writing ZPL code, enclose data keys in square brackets like this:

[item_master.name]

Here is an example of ZPL code to print it:

^XA^CF1,20^FO20,135^FDProduct: [item_master.name]^FS^XZ

Here's what each line means.

Line

Code

Meaning

1

^XA

Start of code

2

^CF1,20

(Change Font): Change the font to font 1 at 20 dots in height.

3

^FO20,135

(Field Origin): Position the field at 20 dots from the left of the page and 135 dots from the top.

4

^FDProduct: [item_master.name]

(Field Data): Print "Product: " and then the product name as specified by the data key.

5

^FS

(Field Separator): End of field

6

^XZ

End of code

This is the result for a product called "Dark Star Buds: .25g"

ZPL Reference

For the full list of ZPL commands, see the official programming guide for ZPL.

Creating Custom ZPL Labels in MJ Platform

  1. Open the App Drawer, expand the Facility Settings menu and click Labels Manager.

  2. Under Custom ZPL Labels, click the link to open the Custom Labels Summary page.

  3. In the list of label types, click the one you want to add a ZPL label for.

  4. Select the appropriate DPI tab for the label.

    • To see a sample of ZPL code in each DPI setting, click the Defaults tab.

  5. In the table under the Sources tab, click a package ID to see the data keys for it. This automatically opens the Place Holders tab where you can see a list of the data keys and the resulting text for the package. It's required to do this in order to preview the resulting label from your code.

  6. Paste your ZPL code into the Editor field and insert the data keys where necessary.

    • For help with using MJP data keys in your ZPL code, open the Place Holders Help tab.

  7. Click Save And Test Custom Label to preview your label.

  8. If you like the results, select the checkbox. This label definition will then be available for selection when printing a label.

Did this answer your question?