Identity Tag Printing Tool

Surface 1.0 SP1

The Microsoft Surface identity tag printing tool (called GenTagUI.exe) enables you to create identity tags by using a regular printer. You can also create identity tags by using the IdentityTagGenerator class in your own application.

An identity tag consists of two 64-bit numbers that represent a series and a tag value within that series. For example, you might use these numbers in a promotion where the series value represents a code for the promotion itself and the tag value represents individual offerings or even individual customers that the promotion targets.

An example identity tag

After you create a tag, attach it to something solid like a plastic card or heavy cardboard. Tags must be perfectly flat for the Microsoft Surface Vision System to detect them. For more important information about how to print tagged object, see Printing Tagged Objects. The tool prints only one tag at a time and it has not been tested across multiple printers.

Do not use the Microsoft XPS Document Writer to create an .xps file for later printing of the identity tag. The XPS Document Writer introduces light gray lines that outline the small hexagonal areas of the tag. These lines can prevent the Vision System from detecting the tag.

Using the Identity Tag Printing Tool

When you open the printing tool (GenTagUI), you see the following user interface.

Identity tag - Example Identity Tag Printing Tool

Generating a Series

You can generate a new series by clicking the New Series button, or you can open a saved series by clicking the Open Series button. The series value then appears to the right of the New Series and Open Series buttons.

Identity tag printing tool - New series

After you generate a new series or open an existing one, you can save the series value in a .ser file by clicking the Save Series button. By saving a series, you can more easily associate additional tag values within a single series.

Series values are random. But if you want a series value that represents a random number that already exists, you can edit the associated .ser file directly so that you can use the existing series.

Generating a Tag Value

After you create or open a series, you can generate a new tag value by clicking the NEW Identity Tag button. The tag value appears in the Value box. You can also manually enter the value for a tag in the Value box if you want to reuse an existing value.

Identity tag printing tool - New value

Copying the Series and Tag Value

After you generate a series and tag value, the code for the series and tag value appears in the Result area (see the bottom of the preceding illustration) and is saved to the clipboard so you can easily paste it in your application code.

You can copy and paste the series and tag value into a database or application code in XAML or C# format. To select what you want to copy, in the Scope area of the user interface, select Full Tag, Series Only, or Value Only. These options determine what portion of the tag value is copied to the clipboard for you to paste. Click the Copy button to copy the contents of the Result text to the clipboard.

Printing an Identity Tag

To print the associated identity tag, click the Print Tag button, and then print the tag graphic by using a typical black-and-white printer.

Command-Line Printing Tool

In addition to the user interface-based GenTagUI printing tool, the Microsoft Surface SDK also includes a command-line version of the printing tool called GenTag.exe. This tool creates a PNG image file that you can incorporate into a printing process.

By default, the GenTag tool is installed in the %ProgramFiles%\Microsoft SDKs\Surface\v1.0\Tools\GenTag directory. If you run GenTag at a command prompt with no parameters, you will see the following Help information.


GenTag.exe <Series in Hex> <Value in Hex> <FileName.png> [/dpi:number]

<Series> and <Value> are 64 bit hexadecimal numbers and <FileName.png> specifies
 the file to output the tag image to.

Optionally, you can specify the dots per inch (DPI) for the tag image by using the 
/dpi parameter. By default, the DPI is 1200.

When you print the generated image, the printed tag should be exactly 1.125 inches 


GenTag.exe 11059F7695D4F4AC 2C6ECFBED3606190 mytag.png /dpi:1200
When you print identity tags by using the image that GenTag generates, the printed tag should be exactly 1.125 inches square.

Community Additions