Data Masking allows you to serialize data items by specifying a
Mask string as well as an
increment string. Data Masking can be used with TextItem as well as BarcodeItem objects. Data Masking consists of the following concepts:
- The input Mask string: The mask string must be specified to the Mask property of any TextItem or BarcodeItem objects. The length of the mask string defines the number of characters to be formatted or masked. The mask is aligned to the characters in the target string (i.e. the Text property for TextItem objects or the Code property for BarcodeItem objects) starting with the right-most position. The input mask string must consist of the following characters (a.k.a. Mask String placeholders):
- D or d (for Decimal numeric 0-9)
- H or h (for Hexadecimal 0–9 plus a-f or A-F)
- O or o (for Octal 0–7)
- A or a (for Alphabetic A–Z or a–z)
- N or n (for Alphanumeric 0–9 plus A–Z or a–z)
- % (Ignore character or skip)
- The Mask Increment string: The mask increment string is the value to be added to the text on each label to be printed and should match the Mask string length. The default value for the increment is equivalent to a decimal value of 1 (one). The string is composed of any characters defined in the input mask string. Invalid characters are assumed to be equal to a value of 0 (zero) in that characters position. The increment value for alphabetic strings start with 'A' or 'a' as the zero placeholder. This means to increment an alphabetic character by one, a value of 'B' or 'b' must be in the increment string. For characters that do not get incremented, the '%' character needs to be added to the increment string.
In this guide you will learn how to print 10 barcode labels leveraging Data Masking feature with Zebra ZPL or EPL printers by using ThermalLabel SDK for .NET.
In this sample, each label features a TextItem which will serialize a product model ranging from "MDL-001/X" to "MDL-010/X" (i.e. the sequence will be MDL-001/X, MDL-002/X, MDL-003/X, ..., MDL-010/X) and a BarcodeItem which will serialize a product ID ranging from "PRD000-A" to "PRD900-J" (i.e. the sequence will be "PRD000-A", "PRD100-B", "PRD200-C", ..., "PRD900-J") in Code 128 standard.
IMPORTANT: To test the sample code you must have installed a Zebra ZPL-based or EPL-based thermal printer.
If you need more information or assistance, please contact our
.