Accusoft.MicrXpress1.Net Accusoft Pegasus
Parse a TextLineResult
See Also Send Feedback  
How To > Parse a TextLineResult

Glossary Item Box

Parse a TextLineResult

MICR Xpress provides the capability to parse a TextLineResult into MICR fields defined by ASC X9, Inc. The field definitions that MICR Xpress uses are defined in the standards document ASC X9.100-160-1-2004. The supported fields from this document are Amount, Auxiliary On-Us, EPC, On-Us, and Routing.

When parsing, MICR Xpress treats a text line result as if it were the complete MICR line from a check. At a minimum, this line must consist of a Routing and On-Us field. Other fields may be present, but the line must preserve the format and order defined by the supported standards. If attempting to parse a TextLineResult that does not represent a well-formed MICR line, a status indicating InvalidFormat will be returned.

The methods and properties of the TextLineResult and MICRFieldResult that will allow you to parse a text line and access parsing results are tabulated in the following topics:

Use the following guidelines to parse a TextLineResult:

  1. Perform recognition on the specified image using one of the AnalyzeField methods.
  2. Select the text line to be parsed using the TextBlockResult.TextLine(int) method.
  3. Check for rejection characters in the text line by iterating through the character results in the text line and checking the CharacterResult.Text or CharacterResult.Confidence properties. The parser will not be able to parse any text that includes non-MICR characters. See Check for Rejection Character.
  4. If rejection characters are found, determine the appropriate action for your application.
  5. Perform parsing with the TextLineResult.Parse or TextLineResult.TryParse method. If this method fails to parse the text line, it is because the text line does not interpret into a well formed MICR line.
  6. Determine which fields were parsed using the TextLineResult.FieldTypes property. This property gets a single value indicating which of the fields were parsed. To determine if a specific field was parsed, mask that field with a MicrFieldType enumeration value.
  7. Access a specific MICR field using the TextLineResult.GetField method. This method should pass the value of the MICR field type you select. Repeat this step for each field you want to select.
C# Example Copy Code
...
TextBlockResult myTextBlockResult;
myTextBlockResult = myMicrXpress.Reader.AnalyzeField( myHDib );
// the check for rejection character is intentionally left out to condense the example code
int textLineIndex = 0;
if (myTextBlockResult.NumberTextLines > textLineIndex)
{
   TextLineResult myTextLineResult = myTextBlockResult.TextLine( textLineIndex );
   
if (myTextLineResult.TryParse( myMicrXpress.Parser ))
   {
       MicrFieldTypes myFieldType = MicrFieldTypes.Amount;
       
if (myFieldType == (myFieldType & myTextLineResult.FieldTypes))
       {
          MicrFieldResult myMicrField = myTextLineResult.GetField( myFieldType );

          
// access the attributes of the field here
       }
   }
}
...

 

See Also

©2009. Pegasus Imaging Corporation, DBA Accusoft Pegasus. All Rights Reserved.