The built-in function, ng:serializationData can help you if you want to print multiple labels on a ZPL compatible printer, that are all identical apart from a number, which is increased/descreased for each label.
You can use this to reduce the size of the print data stream and increase print performance.
Prerequisites/limitations: This function only works for ZPL output. It is also only supported for a single page output, that is printed in multiple copies. This function should be the main XPath function used in a text element. If you want to use similar functionality for a barcode, then you should use the ng:serializationBarcode function, which was added in version 4.2.0.
The ng:serializationData can e.g. be called with this command: ng:serializationData('00001','3','y') and here are descriptions of the 3 parameters:
First parameter: Starting value
This can be any numeric value with up to 12 digits. It can also be an alphanumeric text that ends with a number.
Second parameter: Increment (up to 12 digits).
This can be any numeric value with up to 12 digits. This can also be negative e.g. '-1' to reduce the value with one for each new label.
Third parameter: Keep leading zeroes
Allowed values are: "y" and "n". A "y" indicates, that leading zeroes should be included in the output and with "n" any leading zeroes are removed in the output.
Examples of use:
ng:serializationData('00001','3','y') = Number on the labels will be 00001, 00004, 00007…ng:serializationData('00001','3','n') = Number on the labels will be 1,4,7…ng:serializationData('5','1','n') = Number on the labels will be 5,6,7…ng:serializationData('PartNo005','-1','y') = Labels will output PartNo005, PartNo004, PartNo003…This prints out the number: 00001 and prepares the printer to increment the value with 1 for each copy.
If this template is used in a workflow, which prints multiple copies like below, then the output in this case will be 3 labels with the values 00001, 00002 and 00003: