> ## 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: Document Footer, InvoiceFooter group

> Assemble the InvoiceFooter group that identifies the last page of the invoice using ExtraTag, AddTag, LongFooter, ShortFooter, and a required Paragraph.

In the InvoiceFooter group, specify the elements that let FlexiLayout Studio identify the last page of the document:

* The last page always has the keywords `TOTALAMOUNTMUST`, `Carriedover`, `TotalCHF`, and `Total`.
* To search for this text, create two elements. In the first, specify `TOTALAMOUNTMUST`, `Carriedover`, and `TotalCHF`. Create a second element below the first one in the tree of elements and specify only `Total` (FlexiLayout Studio searches for this element only if the first element is not detected). This reduces the number of hypotheses generated for the element and speeds up FlexiLayout matching.
* These words always appear below the **Description** and **Product Total** column names on the same page.

The InvoiceFooter group includes these elements:

| Element         | Type                                                   | Detects                                                       | Described in                                      |
| :-------------- | :----------------------------------------------------- | :------------------------------------------------------------ | :------------------------------------------------ |
| **ExtraTag**    | [Static Text](/flexi-capture/fls/template/static-text) | The **Product Total** column name                             | [Step 6.1](/flexi-capture/fls/tutorial4/4step6-1) |
| **AddTag**      | [Static Text](/flexi-capture/fls/template/static-text) | The **Description** column name                               | [Step 6.2](/flexi-capture/fls/tutorial4/4step6-2) |
| **LongFooter**  | [Static Text](/flexi-capture/fls/template/static-text) | The `TOTALAMOUNTMUST`, `Carriedover`, and `TotalCHF` keywords | [Step 6.3](/flexi-capture/fls/tutorial4/4step6-3) |
| **ShortFooter** | [Static Text](/flexi-capture/fls/template/static-text) | The `Total` keyword                                           | [Step 6.4](/flexi-capture/fls/tutorial4/4step6-4) |

To make the **Footer** match only the last page of the document, it must contain a required element. Because the keywords that identify the last page occur on every last page, create a required [Paragraph](/flexi-capture/fls/template/text-chain) element in the InvoiceFooter group. Specify its search area as the rectangular region of the detected **LongFooter** or **ShortFooter** element, slightly expanded vertically and horizontally. For more information, see [Step 6.5](/flexi-capture/fls/tutorial4/4step6-5).
