2 Replies Latest reply on Jun 25, 2018 2:43 AM by Narek Aramjan

    How to insert variables into Zebra .prn file to print a label with data via Intent

    Narek Aramjan

      I have designed a custom label using ZebraDesigner2. The label contains custom fonts and variable text fields and looks like this:


      I've printed the label to a .prn file and downloaded it to the Android device. I'm using the PrintConnect app and have also set the correct Storage type and Storage folder.


      What I want to do is print a custom label filled with specific data from my Android app. I'm using the following code:


          HashMap<String, String> variableData = new HashMap<>();


          variableData.put("var_ds", "10:00-12:00");

          variableData.put("var_on", "123ABC456");

          variableData.put("var_qcc", "123456778123456789");

          variableData.put("var_dd", "DO 19/06");

          variableData.put("var_ln", "1/1");

          variableData.put("var_cn", "John Doe");

          variableData.put("var_da", "Somecoolstreet 11");

          variableData.put("var_dc", "Awesomecity");

          variableData.put("var_ot", "Delivery");

          variableData.put("var_cp", "0612345678");


          Intent intent = new Intent();

          intent.setComponent(new ComponentName("com.zebra.printconnect",


          intent.putExtra("com.zebra.printconnect.PrintService.TEMPLATE_FILE_NAME", "custom_label.prn");

          intent.putExtra("com.zebra.printconnect.PrintService.VARIABLE_DATA", variableData);




      The code does print a label but all the variables are not filled correctly. Example: instead of '10:00-12:00' it shows 'var_ds' on the label.


      What am I doing wrong?