FormDirector provides some other functionality to support the atypical form processing scenario. The following pages describe this functionality.
Use OtherDataItems: An Example
FormAssist uses the OtherDataItems property of the Field class to store a classifier of the field; the field is classified by the output of its operations.
To do this FormAssist creates and adds a DataItem to the OtherDataItems collection. It sets classification by setting the DataItem Content string to one of the values: “OMR”, “Clip”, “ICR”, or “OCR”. And in order to distinguish this classification DataItem from a collection of possibly many DataItems, FormAssist sets the Type string to “Pegasus/Type”.
The code samples below demonstrate the same.
C# Example |
Copy Code |
dataItem.Type = "Pegasus/Type"; //This specifies that ICR, OCR or OMR versions of recognition are used for the field being processed. |
C# Example |
Copy Code |
dataItem.Content = "ICR"; //Specifies ICR recognition is being used for the field.
dataItem.Content = "OCR"; //Specifies OCR recognition is being used for the field.
dataItem.Content = "OMR"; //Specifies OMR recognition is being used for the field.
field.OtherDataItems.Add(dataItem); //Add the dataItem to the field |
Typically the FormFix component will be used to create field clips, however there may be some scenarios where there is a desire to not use FormFix. In these cases, FormDirector’s Field class provides the functionality to create field clips.
Input and Output Data
- Original Form Image - An original form image can be obtained by FormDirector from a TemplateImage, from a file using ImagXpress, of from another forms processing component which can load images in memory.
- Field Location - A Field object contains location references and all associated attributes to define a single rectangular region on a form image.
- Field Clip - A Field Clip is the copied image pixels of the rectangular Field region.
Create Field Clips
- Load the original form image into memory using one of the means described above. If a FormDefinition object exists that represents the given form, the suggested means of loading the image is by using one of TemplateImage’s properties: Bitmap, Hbitmap, Hdib, or Image.
- Extract the location of the field from the Field object’s Location property.
- Call the appropriate method (ClipBitmap, ClipHbitmap, ClipHdib, ClipImage) of the Field class to generate the field clip.