Skip to main content
At this stage, establish the following:
  • Is there any pattern in the arrangement of the fields on the images?
  • Which elements can you rely on to look for the data fields?
  • In what order should the elements be searched for? (This is important, because at each subsequent step you can rely only on the elements of the previous step.)
Because this is a multi-page document, first decide which objects identify the first and last pages. Describe these objects with special compound Header and Footer elements:
  • The Header element must match only the first page of the document. If the project also contains documents of other types, this element also serves as an identifier, a unique characteristic that identifies this document type.
  • The Footer element must match only the last page of the document. Create the required subelements in this group to prevent the Footer element from matching any other page.

Identify the first page with a Header element

On the first page, a group of fields consists of InvoiceNumber, InvoiceDate, and DeliveryAddress. The InvoiceNumber field name always appears at the beginning of each document, but the InvoiceDate and DeliveryAddress fields are not always present.
  • The InvoiceNumber and InvoiceDate fields appear either to the right of their names or below them.
  • DeliveryAddress also appears to the right of or below its name, within a limited search area, and needs an element to restrict the search area from below.
  • Because some images have no values for these fields, you can speed up matching by not looking for a field value when its name is not detected.
Use this group of fields as the document identifier, described as part of a compound Header element named InvoiceHeader. The last page has the words TOTAL AMOUNT MUST, Carried over, Total CHF, and TOTAL below the table. These words may also occur elsewhere on the document (for example, in the table name or body), so use additional reference elements, such as table column names, to restrict the search area. Describe the elements for the last page as part of a compound Footer element named InvoiceFooter. For the Footer element to match only the last page, it must contain a required element. Because the words that identify the last page occur on every last page, make the element that describes them a required element.

Detect the multi-page table

The table (name it InvoiceTable) starts on the first page and ends on the last one. It is always preceded by the column names on the first page. To identify the end of the table on the last page, use an auxiliary element, such as the required element from the InvoiceFooter group. The set of all pages of a document is called a multi-page canvas. It is formed by joining all the pages of a document, top-down, without gaps, with the left boundary of every page on the same axis, which goes through the point (0, 0). The order in which the pages are joined follows the order of the pages in the batch. You can therefore specify only the start of the table (its header on the first page) and the end of the table (its footer on the last page). FlexiLayout Studio searches for the table across the entire document, that is, the entire multi-page canvas.

Detect the Company and Total Amount fields

The Company field name always appears on the first page, in the upper third of the page. The Total Amount field name always appears on the last page, below the table. Its value appears either to the right of the name or below it.