Skip to main content
The FlexiLayout Studio interface and the FlexiLayout language allow you to refer to databases and text files to specify, for example, strings to be found on an image.

Database connections

The ADO (Microsoft ActiveX Data Objects) interface is used to refer to databases. A database and its properties are set by the standard connection string, that is, a set of arguments separated by semicolons which specify the connection parameters. These parameters include Provider, Data Source, and others. An SQL query starting with the SELECT command is used to search for fields in the database table. The resulting set obtained by a query must contain only one field. If a query returns more than one database field, the data from the first field are used. In its simplest form, a query gets the required field from a specified database table.

Text file access

A text file is accessed by file name, which is specified relative to the folder that contains the FlexiCapture Studio project. Each search string must start on a new line. Empty lines are ignored.

Text file locations after export and import

When you export a FlexiLayout to add it to a document definition in ABBYY FlexiCapture, the text files are copied to the folder Res, where FileName is the name of the FlexiLayout file or classifier file. This folder is placed in the same folder that contains the exported file. When you subsequently import a FlexiLayout, ABBYY FlexiCapture places the text files into the appropriate folders automatically. For more information about the locations of text files, see the ABBYY FlexiCapture documentation.

Text file encoding

Text files may be in ANSI or Unicode encoding. A Unicode file must start with the standard header consisting of the special Unicode character 0xFEFF. An ANSI file is converted to Unicode using the current system code page.

Behavior during FlexiLayout matching

When matching a FlexiLayout with a page, the results of queries to the database may be stored within FlexiLayout Studio. Any changes to the database or the text file are taken into account only when FlexiLayout Studio has switched to the next page. If an error occurs that is related to the database or the text file, FlexiLayout matching is interrupted and the FlexiLayout is considered not matched.
To speed up FlexiLayout matching, the first 1,000 strings in the file are used by default. To use more strings, specify the number you need in the SearchTextFromFile command (Advanced pre-search relationsAdvanced).