Skip to main content

Dynamic text

Dynamic text is a feature in the printer that allows text to change dynamically when printed. All label objects that uses text as content can take advantage of the dynamic text feature of the printer. The most obvious examples are text and bar codes, but dynamic text can also be used to control the name of an image file, or event the color of objects.

A dynamic text is a mix of regular text and dynamic text codes. Each dynamic text code represents a text that changes its value based on the circumstances when printing, e.g. the current time and date, or how many labels have been printed, or which database table row is active.

All dynamic text codes are encoded in curly braces, e.g. {YEAR}. When printed, this code will be replaced by the current year, e.g. 2024. It is common to mix regular text and dynamic text codes:

The current month is {MONTH}, and the year is {YEAR}.

If printed in October 2024, it will be printed as the following:

The current month is 10, and the year is 2024.

Many dynamic text objects take one or more parameters, which are separated by semicolons. For example, the dynamic text {VARIABLE;MyVariable}, which will be replaced by the current value of the variable MyVariable.

Some dynamic text codes can even be nested. The most common example is the {TIME} code which is used to shift the time to implement features like best before dates.

Best before: {TIME;{YEAR}-{MONTH}-{DAYOFMONTH};+20weeks}

If printed on October 4, 2024, it will be printing as:

Best before: 2024-02-21