> ## 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.

## Create the Paragraph element

<Steps>
  <Step title="Create the Paragraph element">
    In the **InvoiceFooter** element, create a required [Paragraph](/flexi-capture/fls/template/text-chain) element and name it **Paragraph**.
  </Step>

  <Step title="Set the search area">
    Click the **Advanced** tab and specify additional search conditions in the **Advanced pre-search relations** field. Do not search for the element if neither **LongFooter** nor **ShortFooter** is detected. If **LongFooter** is detected, specify the search area as the rectangular region of that element expanded by 10 dots vertically and horizontally. If **ShortFooter** is detected, use its region instead. In the [FlexiLayout language](/flexi-capture/fls/code/general-code):

    ```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;
    }
    }
    ```
  </Step>
</Steps>

## Apply the FlexiLayout to all the test images

Match the FlexiLayout and confirm that the pages are correctly separated into documents as defined by the **Header** and **Footer** elements. After the FlexiLayout is matched with all the pages, the documents are assembled as specified in the reference assembly you created when you started work on this FlexiLayout.

<Steps>
  <Step title="Activate the Batch window">
    Activate the **Batch** window.
  </Step>

  <Step title="Select all the pages">
    Press **Ctrl+A** to select all the pages.
  </Step>

  <Step title="Analyze the pages">
    Press **Ctrl+E** to analyze all the selected pages.
  </Step>
</Steps>

<Note>
  For a multi-page document, apply the FlexiLayout to all the pages of the document, not just some of them. Otherwise, FlexiLayout Studio may fail to apply the FlexiLayout to some documents.
</Note>
