> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# DocumentDefinition Object (IDocumentDefinition Interface)

This object corresponds to a Document Definition. A *Document Definition* describes the location of document elements and indicates the fields to be used in data extraction.

A Document Definition can be received as a part of ABBYY FlexiCapture 12 project, or can be created in the project by calling the [**AddNew**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documentdefinitions-addnew.md) method of the [**DocumentDefinitions**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documentdefinitions.md) object.

The Document Definition can comprise any number of sections (the **Sections** property), which can contain one or several pages. Pages are added to a single section if the document has blocks continuing or recurring on several pages or tables continuing on the following page. All the pages of the document definition are accessible through the **Pages** property.

The **DocumentDefinition** object supports a supplementary interface [**IFieldDefinition**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/fielddefinition.md) – the whole document definition can be considered as the top-level field definition which contains all the field definitions of the Document Definition. Support of this interface means that you can treat the **DocumentDefinition** object as the **FieldDefinition** object.

## Properties

<table width="100%"><thead><tr><th>**Name**</th><th>**Type**</th><th>**Description**</th></tr></thead><tbody><tr><td>**BarcodeBaseRecognitionParams**</td><td>[**BarcodeBaseRecognitionParams**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/barcodebaserecognitionparams.md), [read-only](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/properties.md#readonly-properties)</td><td>Provides access to the parameters of barcode pre-recognition when the Document Definition is matched.Please note that if you've loaded a flexible description created in ABBYY FlexiLayout Studio, its settings will be used instead. You may override the flexible description settings on section definition level by assigning TRUE to the [**ISectionDefinition::UseOwnRecognitionParams**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/sectiondefinition.md#useownrecognitionparams) property.</td></tr><tr><td>**CustomLanguages**</td><td>**CustomLanguages**, [read-only](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/properties.md#readonly-properties)</td><td>Returns a collection of custom user-defined languages specified in the document definition.</td></tr><tr><td>**DataSets**</td><td>[**DataSets**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/datasets.md), [read-only](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/properties.md#readonly-properties)</td><td>Returns the collection of data sets attached to the document definition.Data sets are used for storing information:<ul><li>about vendors and business units (in invoice projects)</li><li>about the variants of document definition sections, used for training the fields of those sections</li><li>various information needed for checking rules</li></ul></td></tr><tr><td>**DefaultLanguage**</td><td>[**Language**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/language.md)</td><td>Specifies the language to be used during recognition. The language can be changed for individual fields (see [**ITextRecognitionParams::Language**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/textrecognitionparams.md#language)), while the language specified by this property is used by default. See [Setting Up Recognition Languages](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/settinguprecognitionlanguages.md) for details.**Notes:** <ul><li>The property returns a constant object. To modify the value of the property, you must first receive an intermediate Language object, change the necessary parameters, and then assign this object to the property.</li><li>The property is valid only for a non-invoice project. The language settings for an invoice project are configured by the [**InvoiceLanguages**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/invoicesettings.md) property of the [**InvoiceSettings**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/invoicesettings.md) object.</li></ul></td></tr><tr><td>**DefaultTextType**</td><td>[**TextTypeEnum**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/texttypeenum.md)</td><td>Specifies the text type. The text type can be changed for individual text blocks (see [**ITextRecognitionParams::TextType**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/textrecognitionparams.md#texttype)), while the text type specified by this property is used by default.</td></tr><tr><td>**DefaultWritingStyle**</td><td>[**LanguageIdEnum**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/languageidenum.md)</td><td>Specifies the writing style of handwritten characters. The writing style can be changed for individual fields (see [**ITextRecognitionParams::WritingStyle**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/textrecognitionparams.md#writingstyle)), while the style specified by this property is used by default.<details><summary>Examples of various numeral writing styles</summary><table width="100%"><tbody><tr><td>![](https://mintcdn.com/abbyy/DUHPkwoM_QL6XAR5/images/flexi-capture/sdk/WritingStyle_6.gif?s=9d5568e181a623dd63c850c50210f718)</td><td>– German one</td></tr><tr><td>![](https://mintcdn.com/abbyy/DUHPkwoM_QL6XAR5/images/flexi-capture/sdk/WritingStyle_5.gif?s=20881d31f178b149b356573c15c7a201)</td><td>– Russian one</td></tr><tr><td>![](https://mintcdn.com/abbyy/DUHPkwoM_QL6XAR5/images/flexi-capture/sdk/WritingStyle_2.gif?s=6720b71d4701b808714ce8460ddd87d7)</td><td>– American two</td></tr><tr><td>![](https://mintcdn.com/abbyy/DUHPkwoM_QL6XAR5/images/flexi-capture/sdk/WritingStyle_1.gif?s=86c1e8c11cfd8885c49d82574e6d2915)</td><td>– Russian two</td></tr><tr><td>![](https://mintcdn.com/abbyy/DUHPkwoM_QL6XAR5/images/flexi-capture/sdk/WritingStyle_3.gif?s=74d459b1adcff082a2f07021ed93e1bd)</td><td>– "ordinary" five, can occur in any style</td></tr><tr><td>![](https://mintcdn.com/abbyy/DUHPkwoM_QL6XAR5/images/flexi-capture/sdk/WritingStyle_4.gif?s=bb7e6237bf9fbefa46f5864e3f99b6b6)</td><td>– Japanese five</td></tr><tr><td>![](https://mintcdn.com/abbyy/DUHPkwoM_QL6XAR5/images/flexi-capture/sdk/WritingStyle_7.gif?s=fe4d29abe5d7928223991e663e7d6c8f)</td><td>– "ordinary" nine, can occur in any style</td></tr><tr><td>![](https://mintcdn.com/abbyy/DUHPkwoM_QL6XAR5/images/flexi-capture/sdk/WritingStyle_8.gif?s=9d3eb48b232b11eeac2599273011fc97)</td><td>– Czech nine with the ring on the right</td></tr><tr><td>![](https://mintcdn.com/abbyy/DUHPkwoM_QL6XAR5/images/flexi-capture/sdk/WritingStyle_9.gif?s=cdda3c451027a395bbd8ee974826e516)</td><td>– American nine without the "hook" at the bottom</td></tr></tbody></table></details></td></tr><tr><td>**Description**</td><td>[**String**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/propertiestypes.md)</td><td>Returns the text description of the Document Definition.</td></tr><tr><td>**Errors**</td><td>[**StringsCollection**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/stringscollection.md), [read-only](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/properties.md#readonly-properties)</td><td>Returns a collection of error descriptions for the latest call of the [**Check**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documentdefinition-check.md) method. Contains only general errors. To receive the errors for a certain section of the Document Definition, use the [**ISectionDefinition::Errors**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/sectiondefinition.md#errors) property.</td></tr><tr><td>**ExportProfiles**</td><td>[**ExportProfiles**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/exportprofiles.md), [read-only](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/properties.md#readonly-properties)</td><td>Provides access to the export parameters collection.</td></tr><tr><td>**GUID**</td><td>[**String**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/propertiestypes.md), read-only</td><td>Returns the global unique identifier (GUID) of the document definition.</td></tr><tr><td>**Id**</td><td>[**Integer**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/propertiestypes.md), read-only</td><td>Returns the identifier of the Document Definition. The identifier is unique within the project.</td></tr><tr><td>**InvoiceSettings**</td><td>[**InvoiceSettings**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/invoicesettings.md), [read-only](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/properties.md#readonly-properties)</td><td>Configuration settings for an invoice Document Definition.To work with this property, first check out the Document Definition using the [**CheckOut**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documentdefinitions-checkout.md) method of the [**DocumentDefinitions**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documentdefinitions.md) object.</td></tr><tr><td>**IsEnabled**</td><td>[**Boolean**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/propertiestypes.md)</td><td>Specifies if the Document Definition is to be used for document processing. This property set to FALSE excludes the document definition from document processing.</td></tr><tr><td>**IsValid**</td><td>[**Boolean**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/propertiestypes.md), read-only</td><td>Specifies if the Document Definition is valid. The Document Definition is valid if there are no errors in it and it has not been changed since the last call of the **Check** method.</td></tr><tr><td>**LicenseInfo**</td><td>[**String**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/propertiestypes.md), read-only</td><td>Specifies the information about the author of the Document Definition (e.g. copyright).</td></tr><tr><td>**Name**</td><td>[**String**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/propertiestypes.md)</td><td>Stores the name of the Document Definition.**Note:** This property may not be modified if the Document Definition is in editing mode (that is, after the call to the [**CheckOut**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documentdefinitions-checkout.md) method and before the changes are either saved or discarded using the [**CheckIn**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documentdefinitions-checkin.md) or [**UndoCheckout**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documentdefinitions-undocheckout.md) methods).</td></tr><tr><td>**PageAnalysisParams**</td><td>[**PageAnalysisParams**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/pageanalysisparams.md)</td><td>Specifies the parameters of page analysis. Page analysis (orientation detection, image scaling, etc.) is performed when the Document Definition is applied in order to apply the Document Definition correctly.**Note:** The property returns a constant object. To modify the value of the property, you must first receive an intermediate [**PageAnalysisParams**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/pageanalysisparams.md) object with the help of the [**IEngine::CreatePageAnalysisParams**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/engine-createxxx.md) method, change the necessary parameters, and then assign this object to the property.</td></tr><tr><td>**Pages**</td><td>[**PageDefinitions**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/pagedefinitions.md), [read-only](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/properties.md#readonly-properties)</td><td>Returns the collection of pages of the Document Definition.</td></tr><tr><td>**Sections**</td><td>[**SectionDefinitions**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/sectiondefinitions.md), [read-only](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/properties.md#readonly-properties)</td><td>Returns the sections of the document definition.The section of a Document Definition is a set of pages (or a single page) and fields on these pages, which corresponds to a logically complete part of a document.The section can also be a link to another document definition in case of working with document sets. The type of the section is set up with the [**SectionDefinition::Type**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/sectiondefinition.md#type) property.</td></tr><tr><td>**Warnings**</td><td>[**StringsCollection**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/stringscollection.md), [read-only](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/properties.md#readonly-properties)</td><td>Returns a collection of warning descriptions for the latest call of the **Check** method. Contains only general warnings. To receive the warnings for certain section of the Document Definition, use the [**ISectionDefinition::Warnings**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/sectiondefinition.md#warnings) property.</td></tr></tbody></table>

## Methods

| **Name** | **Description** |
| - | - |
| [**Check**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documentdefinition-check.md) | Checks if Document Definition properties were configured correctly. |
| [**Rearrange**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documentdefinition-rearrange.md) | Rearranges data in the document window of a Document Definition. Use it if you have added fields or sections and are going to open the Document Definition in ABBYY FlexiCapture. **Note:** The method is not supported for Invoice projects. |

## Related objects

![](https://mintcdn.com/abbyy/89WLEbAVqQ-ysQEU/images/flexi-capture/sdk/DocumentDefinition.gif?s=7fbd4799f1fc4a8a1f7ccc6e6b02777d)

## Output parameter

This object is the output parameter of the [**AddNew**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documentdefinitions-addnew.md), [**AddNewFixed**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documentdefinitions-addnewfixed.md), [**FindByName**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documentdefinitions-findbyname.md), [**Item**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/item.md), and [**LoadFromFile**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documentdefinitions-loadfromfile.md) methods of the [**DocumentDefinitions**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documentdefinitions.md) object.

## Input parameter

This object is the input parameter of the [**Delete**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/delete.md), [**CheckIn**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documentdefinitions-checkin.md), [**CheckOut**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documentdefinitions-checkout.md), [**Delete**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/delete.md), [**UndoCheckout**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documentdefinitions-undocheckout.md) methods of the [**DocumentDefinitions**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documentdefinitions.md) object.

## Samples

This object is used in the following code samples: [Classification](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/samples.md#classification), [Invoices Processing and Training](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/samples.md#invoicesprocessingandtraining).

## See also

[**DocumentDefinitions**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documentdefinitions.md)

[Creating Document Definitions](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/creatingdocumentdefinitions.md)

[Setting Up Recognition Languages](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/settinguprecognitionlanguages.md)

[Tuning Export Parameters](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/exportparams.md)

[Working with Properties](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/properties.md)
