The Annotation Text Token Table

Annotation objects that support tokens include:

A token is a special text string that can be translated into another more meaningful text string. For example, a user may wish to display the current date or the name of their company in their text annotations. Rather than type out the date or the name of the company, a text token can be typed instead.

Tokens are two-character strings of the form:

#{any character}

Any token (except for ##) can be defined to mean anything. LEAD defines the following set of constants to represent functions that can be mapped to any token.

Token Description
ANNTOKEN_NONE [0] String not treated as a token
ANNTOKEN_SEPARATOR [1] Add a separator to the automation token menu
ANNTOKEN_TEXT [2] A text string
ANNTOKEN_DATE_YYYY [3] Current four digit year
ANNTOKEN_DATE_YY [4] Current two digit year
ANNTOKEN_DATE_MM [5] Two digit representation of current month
ANNTOKEN_DATE_DD [6] Two digit representation of current day
ANNTOKEN_DATE_MONTH_NAME [7] Current month name (for example, January)
ANNTOKEN_DATE_DAY_OF_WEEK [8] Current day of week (for example, Monday)
ANNTOKEN_TIME_HH_12 [9] Current hour,using a 12 hour clock
ANNTOKEN_TIME_HH_24 [10] Current hour, using a 24 hour clock
ANNTOKEN_TIME_MM [11] Current minute (00-59)
ANNTOKEN_TIME_SS [12] Current second (00-59)
ANNTOKEN_TIME_MILLISECONDS [13] Current milliseconds (000-999)
ANNTOKEN_AM_PM [14] Time of day indicator (AM or PM)

LEAD defines a predefined text token table that you can use, or you can define your own. The predefined text tokens table is listed below.

Default Text Token Table

Token Text
#Y "Four digit year"
#y "Two digit year"
#M "Two digit month"
#d "Two digit day"
#N "Month Name"
#D "Day of week name"
#h "Current time: 12-Hour (01-12),
#H "Current time: 24-Hour (00-23),
#m "Current time: minutes"
#s "Current time: seconds"
#f "Current time: milliseconds "
#t "Current time: AM or PM"
## "#"

The text token table is displayed in the automation text dialog. The following figure displays the default text token table.


The default annotation text token table can be easily changed using the following functions:

Use LAnnAutomation::ClearTextTokenTable to remove all tokens from the text token table.

Use LAnnAutomation::DeleteTextTokenTable to delete a text token from the annotation text token table.

Use LAnnAutomation::EnumerateTextTokenTable to examine the contents of the annotation text token table.

Use LAnnAutomation::GetTextExpandTokens to get the text expand token property of an annotation.

Use LAnnAutomation::InsertTextTokenTable to insert a text token into the text token table.

Use LAnnAutomation::SetTextExpandTokens to set the text expand token property of an annotation.

Additionally, you can define your own user-defined text tokens. User-defined text tokens can consist of new text strings, or any combination of existing text tokens. The following figure displays a user-defined text token table.

Help Version 22.0.2023.2.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help