Frequently, a line item grid includes a total at the bottom. There might be other fields, like sales tax and shipping costs. Because you do not know in advance how many line items are in the grid, you cannot know where the other fields are located. Because the location of the other fields is unpredictable, you cannot use positional information to read these fields. Instead, you can use text matching to locate an adjacent label and then read the text beside the label.
Library | Action | Description |
---|---|---|
Locate | FindLastRegEx | Locates the last occurrence of a word or phrase on the current page. |
Locate | FindLastKeyList | Locates the last occurrence of a word or phrase that is contained in the specified keyword file. A keyword file is a text file with a .key extension that contains a list of similar words and phrases; for example, Sales tax and Tax. |
Locate | GoRightWord | Moves n words to the right of the location of a previously found word. |
Locate | UpdateField | Updates the current field in the page data file with the value of the located word. |
The following example rule first locates the last instance of the word Total on the current page. The rule then moves one word to the right and makes sure that the value is a currency value. Finally, the rule updates the current field in the page data file. The rule must be attached to the Total field in the document hierarchy.