XML Support

The XML support in Evolabel™ printers provides a way to select and populate layouts from any XML data source that conforms to the requirements specified below.



Data must be UTF-8 encoded.


The XML data shall conform to this DTD but no actual validation is performed. This means that other elements will be ignored.

<!ELEMENT labels (label)*>
<!ELEMENT label (variable)*>
<!ELEMENT variable (#PCDATA)>
<!ATTLIST variable name CDATA #IMPLIED>


<?xml version="1.0" encoding="UTF-8"?>
<labels _FORMAT="1">
    <variable name="serial_number">12345</variable>
    <variable name="lot">ABC123</variable>

Example with a custom job id and product count 1:

<?xml version="1.0" encoding="UTF-8"?>
<labels _FORMAT="1" _JOBNAME="test_job" _QUANTITY="1">
    <variable name="serial_number">12345</variable>
    <variable name="lot">ABC123</variable>


Use _QUANTITY in the XML to specify the product count for the job. No _QUANTITY means unlimited product count.

Transport Channels

XML documents shall be sent over raw TCP to a server on port 9200. Sending raw data in Windows to a TCP server can e.g. be done with putty.


Layouts must refer to file names of layouts stored in the printer.

Variable Substitution

Variables in text fields and bar codes will be substituted using the variables in the XML file.

Example: Populating a built-in layout with XML data

  1. Create a layout with layout name test.layout containing a text field with a variable reference to the product variable {{ product }}. This can be done by:

    • Using the built-in layout editor.

    • Copying the file below to /home/evolabel/userdata/layouts/test.layout.

          "fields": [
                  "y": 50,
                  "x": 100,
                  "type": "text",
                  "spans": [
                          "text": "Name: {{ product }}",
                          "font": "FreeSans 10",
                          "template": 1
          "layout_version": "2.0",
          "width": 500,
          "height": 200
    • Downloading the layout using the layouts.put JSON-RPC method.

  2. Send the XML data below to activate the layout and populate the product variable.

    <?xml version="1.0" encoding="UTF-8"?>
    <labels _FORMAT="test.layout">
        <variable name="product">Test Product</variable>

Example: Populating a ZPL-layout with XML data

Named variables in a ZPL layout can be created using ^FD statements followed by a string representing the variable name.

  1. Send the ZPL data below on port 9100 to store a layout called SERIAL.ZPL in the layout repository.

    ^A0N,54,72^FO143,83^CI0^FDSerial Label^FS
    ^A0N,34,34^FO38,847^FR^CI0^FDLot Status:^FS
    ^A0N,34,34^FO38,996^FR^CI0^FDSerial Status:^FS
  2. Send the XML data below to activate the layout and populate the product variables.

    <?xml version="1.0" standalone="no"?>
    <!DOCTYPE labels SYSTEM "label.dtd">
    <labels _FORMAT="E:SERIAL.ZPL" _QUANTITY="1" _PRINTERNAME="Printer 1" _JOBNAME="LBL101">
            <variable name="organization">611</variable>
            <variable name="item">Nuts</variable>
            <variable name="lot">1234</variable>
            <variable name="serial_number">12345</variable>
            <variable name="revision">V2</variable>
            <variable name="lot_status">1234</variable>
            <variable name="serial_number_status">Active</variable>