IDAutomation.PostNet
jdubs edited this page Oct 23, 2016
·
1 revision
The Postnet barcode function is specified in IDAutomation Barcode Fonts, Components and Applications to create a USPS Postnet or Planet barcode, which encodes numbers only. The DataToEncode is a single string of numbers and can include dashes and spaces.
http://www.idautomation.com/barcode/usps-postnet.html
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.
public static void PostNet(string SpecName, object ErrorMessage)
{
Actions.Break();
try
{
string postcode = Actions.Variable(SpecName).Value.Replace("-", "");
Actions.Variable(SpecName).Value = CallFontEncoder("Postnet", new object[] { postcode, 0 });
}
catch (Exception ex)
{
throw new Actions.Four51ActionsException(ex.Message, (string)ErrorMessage);
}
}