Sometimes you may encounter documents with identical sets of parameters (blocks), identical rules, and written in the same language, but with element positions varying greatly from one document to another. In this case, for the sake of convenience, you may create a FlexiLayout that includes several alternative layouts, each layout corresponding to a particular subset of documents with identically positioned elements. Apart from the layouts, the other processing parameters (pre-recognition/languages, rules, number of pages, etc.) will remain the same for all such documents described by the FlexiLayout.
Layout alternatives are specified as separate branches in the tree of elements. Thus, instead of one Group element (named SearchElements by default), you can create several elements, each having its own layout alternative represented by a branch of elements that described one particular subset of documents. The layout alternatives are independent, and elements in one branch should not refer to elements in another.
The names of layout alternatives (i.e. root elements) should be unique. We recommend selecting descriptive names that reflect the nature of the corresponding document subset.
When matching the FlexiLayout, the program will apply the layout alternatives one by one, top to bottom. If more than one layout alternative match a document, the first match will be used.
Image areas are specified for the blocks in each layout alternative (see the Blocks section for more information).
When debugging the FlexiLayout, you can choose just one layout alternative. To choose a layout alternative, select either the Select Layout item from the shortcut menu of the element, or the Select Alternative Layout item from the shortcut menu of the FlexiLayout.
To create a layout alternative:
- Select the root element of the layout.
- Select Add FlexiLayout Alternative from the shortcut menu. The layout alternative will be added to the list.
- Double-click the layout alternative or select Properties... from the alternative shortcut menu to open the layout properties dialog box.
- Specify a name and properties for the layout.
Note.The name of a layout alternative must start with a letter or an underscore, which may be followed by letters or digits. You may not use spaces or any of the following special symbols: ' . ', ' , ', ' : ', ' - ', ' \ ', ' / '. The name may not coincide with any of the reserved keywords.
To copy a layout alternative:
Select the layout alternative you wish to copy. Holding down the Ctrl key and the left mouse button, drag a copy of the layout alternative to the desired location. Alternatively, you can copy a layout by selecting the Copy / Paste commands from its shortcut menu or be pressing the Ctrl+C / Ctrl+V combinations.
Generally, it is easier to copy an existing layout alternative and make some adjustments to it than create a new layout alternative from scratch.
To import layout alternatives from another FlexiLayout:
- Select the root element of the layout.
- Select Import FlexiLayout Alternatives... from the shortcut menu.
- Select the FlexiLayout from which you wish to import layout alternatives and click Open.
Note.When you try to import a layout alternative from a project with multiple layout alternatives, the program will prompt you to select the layout alternatives you want to import.
For the blocks that have identical names in the two FlexiLayouts, the image areas will be added. If the FlexiLayout from which you import layout alternatives has additional blocks, the will also be copied to the current FlexiLayout.
To import elements and blocks from another FlexiLayout:
- Select the layout alternative to which you wish to add elements from another FlexiLayout.
- Select Import Alternative Elements... from the shortcut menu.
- In the dialog box that opens, select the project from which you want to import blocks and FlexiLayout elements and then click the Open button.
Note.When you try to import blocks and FlexiLayout elements from a project with multiple layout alternatives, the program will prompt you to select the layout alternatives from which you want to import blocks and elements. If the name of an element or block being imported is identical to that in the current FlexiLayout, a number will be added to the name of the imported element or block.
To delete a layout alternative
- Right-click the layout alternative (i.e. the branch in the tree of elements) you wish to delete.
- Select Delete from the shortcut menu or press Del.
You can temporarily disable a layout alternative by selecting Disable from its shortcut menu.
To change the order of layout alternatives:
Click the layout alternative you wish to move and, holding down the left mouse button, drag it to the desired location.