- In the InvoiceHeader element, create an element of type Character String and name it InvoiceNumber.
- Click the Character String tab.
-
Specify the alphabet:
-./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz - Set Percentage of non-alphabet characters to 30%.
-
In the Character count field, specify the fuzzy interval
{-1, 3, 20, INF}for the length of the character string, assuming that possible values fall into the range of 3 to 20 characters. Any hypothesis outside this interval will be penalized. -
On some of the images, the search area for the Invoice Number field contains the already detected kwInvoiceDate element. Exclude this element from the search area, so that the program does not include this text in its hypotheses for the Invoice Number field:
- On the Search Constraints tab, click the Add… button next to the Exclude regions of elements field.
- Select kwInvoiceDate from the list of elements.
- Click OK. The string
SearchElements.InvoiceHeader.kwInvoiceDatewill appear in the Exclude regions of elements field.

- Click the Advanced tab.
-
In Advanced pre-search relations, specify additional conditions: if the name kwInvoiceNumber is not found, do not search for the InvoiceNumber field, otherwise specify the search area as an array of rectangles: one rectangle to the right of the name and another rectangle below the name with a small offset. In the FlexiLayout language, this condition can be written as follows:
-
The search area for the field is limited to two rectangles, one to the right of the field name and one beneath it. If the field data are located to the right of the field name, there is often some other text beneath the field (on the test images, this is most commonly the name and data of the Date field). Since this extraneous text will be included into the search area for the Invoice Number field, the program will generate a hypothesis for this text. To influence the quality of this hypothesis, specify additional checks in the Advanced post-search relations field: the lower the text beneath the field name, the bigger the penalty. In the FlexiLayout language, this condition can be written as follows:
- Temporarily exclude the InvoiceFooter element and match the FlexiLayout.
-
Specify the location of the InvoiceNumber block as a rectangular region of the InvoiceNumber element enlarged by 5 dots vertically and horizontally. To do this, select Expression and type the following expression:
