Sample 4. Step 6: Document Footer, InvoiceFooter group
In the InvoiceFooter group we will specify the elements that will enable the program to identify the last page of the document:
- The last page of the document always has the keywords "TOTALAMOUNTMUST", "Carriedover", "TotalCHF", "Total".
- To search for this text, we will create two elements. In the first element, specify "TOTALAMOUNTMUST", "Carriedover", and "TotalCHF". Create a second element below the first one in the tree of elements and specify only "Total" in this second element (the program will search for this element only if the first element has not been detected). This will reduce the number of hypotheses generated for the element and speed up the FlexiLayout matching process.
- These words are always located below the column names Description and Product Total on the same page.
To search for the keywords in the Product Total and Description column, we will create elements of type Static Text:
- ExtraTag element: see detailed instructions in Step 6.1.
- AddTag element: see detailed instructions in Step 6.2.
We will also use Static Text elements to search for the keywords "TOTALAMOUNTMUST", "Carriedover", "TotalCHF", and "Total":
- LongFooter element: see detailed instructions in Step 6.3.
- ShortFooter element (to search for the keyword "Total"): see detailed instructions in Step 6.4.
To make Footer match only the last page of the document, it must contain a required element. Since the keywords that identify the last page of the document can be found on every last page of every document, in the InvoiceFooter group, create a required element of type Paragraph and name it InvoiceFooter. Specify the search area for this element as the rectangular region of the detected LongFooter or ShortFooter element, slightly expanded vertically and horizontally (for detailed instructions, see Step 6.5).