> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sample 4. Step 6.5; The final part of the document, Paragraph element

> Complete the InvoiceFooter with a required Paragraph element whose search area follows the detected LongFooter or ShortFooter, and then match the FlexiLayout.

To create a Paragraph element:

1. In the **InvoiceFooter** element, create a required element of type Paragraph and name it Paragraph.
2. Click the Advanced tab and in the Advanced pre-search relations field, specify additional search conditions:\
   Do not search for the element if neither **LongFooter** nor **ShortFooter** has been detected. If **LongFooter** has been detected, specify the search area as the rectangular region of this element expanded by 10 dots vertically and horizontally. If **ShortFooter** has been detected, specify the search area as the rectangular region of this element expanded by 10 dots vertically and horizontally. In the [FlexiLayout language](/flexi-capture/fls/code/general-code), this condition can be written as follows:

```text theme={null}
If LongFooter.IsNull and ShortFooter.IsNull then Dontfind();
// Do not search for the element if none of the elements are detected
else
{ if not LongFooter.IsNull then
// If LongFooter is detected, the search area is defined based on its region
{ LeftOf: LongFooter.Rect.Right + 10dt;
RightOf: LongFooter.Rect.Left - 10dt;
Below: LongFooter.Rect.Top - 10dt;
Above: LongFooter.Rect.Bottom + 10dt;
}
else if not ShortFooter.IsNull then
// If ShortFooter is detected, the search area is defined as the region of ShortFooter
{ LeftOf: ShortFooter.Rect.Right + 10dt;
RightOf: ShortFooter.Rect.Left - 10dt;
Below: ShortFooter.Rect.Top - 10dt;
Above: ShortFooter.Rect.Bottom + 10dt;
}
}
```

Try matching the FlexiLayout and make sure that the pages are correctly separated into documents as defined by the Header and Footer elements. Once the FlexiLayout is matched with all the pages, the documents should be assembled as specified in the reference assembly created when you started work on this FlexiLayout.

<Note>
  To apply the FlexiLayout to all test images, use keyboard shortcuts:
</Note>

* Activate the **Batch** window.
* Press **Ctrl+A** to select all the pages.
* Press **Ctrl+E** to analyze all the selected pages.

<Note>
  In the case of a multi-page document, be sure to apply the FlexiLayout to all the pages of the document, not just to some of the pages. Otherwise, the program may fail to apply the FlexiLayout to some of the documents.
</Note>
