- A Document Definition may be part of an ABBYY FlexiCapture 12 project. When creating a Document Definition in ABBYY FlexiCapture, field properties are specified along with their range of values. Data export settings are also configured.
- A Document Definition may be created in the project by calling the AddNew method of the DocumentDefinitions object.
- A Document Definition may be loaded from a file to the project with the help of the LoadFromFile method of the DocumentDefinitions object.
Creating a compound Document Definition
- Open the project and get the collection of Document Definitions of the project.
- Create an empty Document Definition using the AddNew method of the DocumentDefinitions object.
- Switch the Document Definition to editing mode by calling the CheckOut method of the DocumentDefinitions object.
- Set the language to be used with this Document Definition during recognition. Use the DefaultLanguage property of the created DocumentDefinition object.
- Set the default text type using the DefaultTextType property of the DocumentDefinition object.
- Create a new fixed section from an XFD file:
- Add the new section into the Document Definition with the help of the AddNew method of the SectionDefinitions object.
- Load the XML Form Definition into this new section using the LoadXFDDescription method of the new SectionDefinition object.
- Create a new flexible section from an AFL file:
- Add the new section into the Document Definition with the help of the AddNew method of the SectionDefinitions object.
- Load ABBYY Flexible Layout into this new section using the LoadFlexibleDescription method of the new SectionDefinition object. You can also load it from stream using LoadFlexibleDescriptionFromStream method.
- Create a new section with necessary fields from scratch.
- Add the new section into the Document Definition with the help of the AddNew method of the SectionDefinitions object.
- Get the collection of fields of the section using the Fields property of the SectionDefinition object.
- Add new field definitions by calling AddNew method of the FieldDefinitions object.
- Repeat the steps 6-8 if necessary.
Setting additional properties
To improve the quality of recognition, you may configure the types of field values:- For a section of the created Document Definition, get a set of its field definitions. Use the Fields property of the SectionDefinition object.
- Find the necessary field definition. Note that fields may be simple (without an internal structure), or composite (such as a table field where each cell can be viewed as a separate subordinate field of the table). Therefore, to iterate through all field definitions of the section definition, it is not enough to iterate through all the elements of the ISectionDefinition::Fields collection, you should also check if the field is composite and access its child fields (see the IFieldDefinition::Children property).
- Set the type of the field value using the ValueType property of the FieldDefinition object.
