Skip to content

IDAutomation.Interleaved2of5

jdubs edited this page Oct 23, 2016 · 1 revision

Table of Contents

Overview

Interleaved 2 of 5 (ITF, i2of5) is a numeric only barcode used to encode pairs of numbers into a self-checking, high-density barcode format. In this symbology, every two digits are interleaved with each other to create a single symbol. If a number string containing an odd number of digits needs to be encoded, a leading zero must be added to produce an even number of digits in the Interleaved 2 of 5 barcode. In many cases, the Code 128 barcode offers an advantage over the i2of5 barcode because it encodes even and odd numbers of digits, as well as letters and symbols, with equal or greater density.

Reference

http://www.idautomation.com/itffaq.html

Parameters

SpecName (constant) The variable containing the input to be converted. Proper UPC font must be applied in the template.

ErrorMessage (multiple | optional) The error message to return when any error occurs.

Source Code

public static void Interleaved2of5(string SpecName, object ErrorMessage)
{
	Actions.Break();
	try
	{
		string code = Actions.Variable(SpecName).Value;
		Actions.Variable(SpecName).Value = CallFontEncoder("I2of5", new object[] { code });
	}
	catch (Exception ex)
	{
		throw new Actions.Four51ActionsException(ex.Message, (string)ErrorMessage);
	}
}

Clone this wiki locally