Skip to main content
The Invoice Date field sits to the right of its name, on the same horizontal level. Use a Date element to find the date. For poor-quality images where the date is not recognized properly and the Date element search returns nothing, add a Character String element as a fallback. To set the properties common to all these elements, create a compound grDate element.

Create the grDate group element

1

Create the Group element

In the InvoiceHeader element, create a Group element and name it grDate.
2

Set the search constraints

Click the Relations tab. All the elements that detect the Invoice Date field appear only to the right of the kwInvoiceDate name and on the same level, so set these relations:
  • Right of the kwInvoiceDate element, Offset = 0
  • Above the kwInvoiceDate element, Offset = -10, Element boundary = Bottom
  • Below the kwInvoiceDate element, Offset = -10, Element boundary = Top
Screenshot of the Relations tab of the Properties of SearchElements.InvoiceHeader.grDate dialog box in ABBYY FlexiLayout Studio, showing the RightOf, Below, and Above relations to the kwInvoiceDate element.

Create the InvoiceDate element

1

Create the Date element

In the InvoiceHeader.grDate element, create a Date element and name it InvoiceDate.
2

Specify the date formats

Click the Date tab and specify all the date formats that may occur on the images. Assume the format is day, month, year; the language is English; and there are no other constraints on the date.
Screenshot of the Date tab of the Properties of SearchElements.InvoiceHeader.grDate.InvoiceDate dialog box in ABBYY FlexiLayout Studio, showing the Day, month, year format selected with English chosen as the date language.
3

Add the search constraint

Click the Advanced tab. The Invoice Date field is optional, but when it occurs it always appears with its name and next to it. In the Advanced pre-search relations field, set this additional search constraint: look for the object only if kwInvoiceDate was detected, and look for the object closest to it. In the FlexiLayout language:
You can also set the Nearest constraint via the FlexiLayout Studio graphical user interface. Click the Relations tab, select Nearest, and in the To drop-down list select Element, and then specify kwInvoiceDate as the Reference element.
4

Verify the match

Match the FlexiLayout with the test images and confirm that FlexiLayout Studio detects the element on every image that has an Invoice Date field.
When you test, some images do not detect the element. The pre-recognition results show that noise in the field area causes this. None of the standard Date element properties fix it, so create an alternative element with less stringent search constraints. For more information about finding dates on poor-quality images, see Date search after high or low-quality recognition.

Create the InvoiceDateAsString element

1

Create the Character String element

In the InvoiceHeader.grDate element, create a Character String element and name it InvoiceDateAsString.
2

Set the character count

Click the Character String tab. In the Character count field, specify this fuzzy interval: {-1, 8, 14, INF}. This estimates the string length; assume 8 to 14 characters. Any hypothesis outside this range is penalized.
3

Set the maximum space length

Set Max space length to 20, so a space can be 20 dots long. Leave the default values for the other properties.
4

Add the fallback constraint

Click the Advanced tab. FlexiLayout Studio must look for this element only if the InvoiceDate element was not detected. In the Advanced pre-search relations field, set this additional search constraint:
5

Add the location constraint

The Invoice Date field is optional, but when it occurs it always appears with its name and next to it. In the Advanced pre-search relations field, add this additional search constraint: look for the object only if kwInvoiceDate was detected, and look for the object closest to it. In the FlexiLayout language:
6

Verify the match

Match the FlexiLayout with the test images and confirm that FlexiLayout Studio detects the element on every image that has an Invoice Date field, and generates a null hypothesis for the InvoiceDate element.
7

Set the block source element

To describe the location of the InvoiceDate block, select Source element, click Browse button, and select the InvoiceHeader.grDate element as the source element.
The region of a Group element is the union of the regions of all its detected subelements.