Skip to main content
Search for the Delivery Address field:
  • To the right of and below the field name
  • Using a White Gap element to limit the search area from the bottom
  • Using a Paragraph element

Create the grAddress group element

To specify the properties common to all these elements, create a Group element.
  1. In the InvoiceHeader element, create an element of type Group and name it grAddress.
  2. Click the Relations tab and specify the following search constraints for the elements of the group:
    • Above the kwDeliveryAddress element, Offset = -400.
    • Left of the right boundary of the kwDeliveryAddress element, Offset = -800, Reference boundary = Right.
    • Right of the left boundary of the kwDeliveryAddress element, Offset = -50, Reference boundary = Left.
    • Below the upper boundary of the kwDeliveryAddress element, Offset = -20, Reference boundary = Top.
Screenshot of the Relations tab of the grAddress Group element properties in ABBYY FlexiLayout Studio, showing the offset and reference boundary constraints that position the group relative to the kwDeliveryAddress element.

Create the wgAddressAbove White Gap element

To limit the search area for the DeliveryAddress element from the bottom, specify a horizontal White Gap.
  1. In the InvoiceHeader.grAddress element, create an element of type White Gap and name it wgAddressAbove.
  2. Click the White Gap tab.
  3. Under Orientation, select Horizontal. Set Min height to 55.
    When selecting values for the heights and widths of white gaps, consider the geometry (that is, the boundaries and sizes) of the adjacent image objects in pre-recognition results mode.
  4. Because you are looking for a white gap inside a paragraph, under Search among objects of type, select only Text.
  5. Under Rubbish, specify the following values:
    • Lower threshold limit – 20.
    • Upper threshold limit – 80.
    • Threshold coefficient (%) – 10.
    Screenshot of the White Gap tab of the wgAddressAbove element properties in ABBYY FlexiLayout Studio, showing the horizontal orientation, minimum height, and the Rubbish threshold values for the white gap.
    The values for the Lower threshold limit, Upper threshold limit, and Threshold coefficient (%) properties can only be selected by trial and error. Start with the default values. If the default values do not work, alter them until the white gap is detected on all the test images.
  6. Do not specify any additional search constraints and retain the default values for the other options.
  7. Click the Relations tab.
  8. Since the white gap can be located only beneath the keywords of the name kwDeliveryAddress, specify the following search constraints:
    • Below the kwDeliveryAddress element, Offset = 20
      Offset is required to prevent the program from finding white gaps in other areas on the image, for example, between the field name and the text. Click the Advanced tab.
  9. Since the Delivery Address field is not present on all of the images, but when it does occur it is always accompanied by its name, specify the following additional condition in the Advanced pre-search relations field: Search for the image object only if the kwDeliveryAddress element is detected. In the FlexiLayout language, this condition can be written as follows:
  10. Match the FlexiLayout to see if the wgAddressAbove element is detected on all images.
  11. Since the program sometimes finds more than one white gap in the specified search area and cannot always select the right one, impose additional search constraints. If you examine the images, you will notice that the white gap of interest is the topmost gap in the given search area. Therefore, in the Advanced pre-search relations field, specify the following additional condition: Search for an image object closest to the upper boundary of the first page. In the FlexiLayout language, this condition can be written as follows:
  12. Temporarily exclude the InvoiceFooter element and match the FlexiLayout.

Create the DeliveryAddress Paragraph element

  1. In the InvoiceHeader.grAddress element, create an element of type Paragraph and name it DeliveryAddress.
  2. Click the Relations tab.
  3. Since DeliveryAddress can be located only above the white gap wgAddressAbove, specify the following search constraint:
    • Above the wgAddressAbove element, Offset = 0.
  4. Since the search area for the DeliveryAddress element has already been specified at the level of the InvoiceHeader.grAddress group, there is no need to specify it again here.
  5. Click the Advanced tab.
  6. Since the name of the DeliveryAddress field is also located inside the search area, exclude it to obtain only the value of DeliveryAddress. Additionally, there are separators and noise in the search area that are also best excluded. For these reasons, you cannot just exclude the region of the kwDeliveryAddress element. It is more appropriate to take the region of the kwDeliveryAddress element, enlarge this region so that it encompasses all the noise, and then exclude the resulting rectangle. To do this, specify the following search constraints in the Advanced pre-search relations field:
  7. Temporarily exclude the InvoiceFooter element and match the FlexiLayout.
  8. Specify the location of the DeliveryAddress block as the rectangular region of the detected DeliveryAddress element, simplified for clearer display and expanded by 5 dots vertically and horizontally. To do this, select the Expression option and type the following expression: