> ## 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.

# Document Object (IDocument Interface)

This object corresponds to a processing document. A document may be a part of a batch or be a separate instance. A document as a part of a batch is received when processing data within a project. The collection of such documents are represented by the [**Documents**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documents.md) object.

The newly created **Document** object contains a collection of document pages which are accessible through the **Pages** property. During document definitions matching data fields are found in the document. You can access these fields via the **Sections** property, which refers to the sections of the document. These sections have child fields. Each child field can be either a group of fields (and has own child fields), or a simple field (without child fields). See [Working with Recognized Data](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/workingwithrecognizeddata.md) for details. After data extraction and recognition the document can be exported. If errors occur during document processing, information about these errors can be found in the corresponding properties of the **Document** object (**AssemblingErrors**, **RuleErrors**).

To work with the document, access its structure, parameters, etc., you should first open it using the **Open** method. When you finished your work with such document, close it with the help of the **Close** method. See [Using a Document Object within a Project](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/document-using.md) for details.

The **Document** object supports the [**IField**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/field.md) interface: the whole document can be considered as the top-level field which contains all the data fields of the document. Support of this interface means that you can treat the **Document** object as the **Field** object.

## Properties

| **Name** | **Type** | **Description** |
| - | - | - |
| **AsBatchItem** | [**BatchItem**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/batchitem.md), [read-only](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/properties.md#readonly-properties) | Specifies the **Document** as a batch item. If the document is not a batch item this property is NULL. |
| **AsClassificationTrainingDocument** | [**ClassificationTrainingDocument**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/classificationtrainingdocument.md), [read-only](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/properties.md#readonly-properties) | Provides access to the corresponding classification training object. |
| **AssemblingErrors** | [**AssemblingErrors**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/assemblingerrors.md), [read-only](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/properties.md#readonly-properties) | Returns a collection of assembly errors. |
| **Batch** | [**Batch**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/batch.md), [read-only](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/properties.md#readonly-properties) | Provides access to the **Batch** object the document belongs to. |
| **Comment** | [**String**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/propertiestypes.md) | Allows you to specify any text comment for the document. This comment can be viewed in ABBYY FlexiCapture. |
| **DocumentDefinition** | [**DocumentDefinition**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documentdefinition.md), [read-only](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/properties.md#readonly-properties) | Returns the Document Definition applied to the document. |
| **HasRuleErrors** | [**Boolean**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/propertiestypes.md), read-only | Specifies whether the document has rule errors. Unlike the **RuleErrors** property, this property is available for a closed document. |
| **Id** | [**Integer**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/propertiestypes.md), read-only | Specifies the document identifier. |
| **IsExported** | [**Boolean**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/propertiestypes.md), read-only | Specifies whether the document has been exported to the destination specified in the Document Definition (i.e. it has been exported with default parameters). |
| **IsVerified** | [**Boolean**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/propertiestypes.md), read-only | Specifies whether the document has been verified. |
| **LockType** | [**LockTypeEnum**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/locktypeenum.md), read-only | Returns the state of the document. The document can be closed, open for reading, or open for reading and writing. |
| **Pages** | [**Pages**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/pages.md), [read-only](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/properties.md#readonly-properties) | Returns a collection of pages of the document. |
| **RegistrationParameters** | [**RegistrationParameters**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/registrationparameters.md), read-only | Returns a collection of registration parameters of the document. |
| **RuleErrors** | [**RuleErrors**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/ruleerrors.md), [read-only](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/properties.md#readonly-properties) | Returns a collection of errors for unfulfilled rules. |
| **Sections** | [**Fields**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/fields.md), [read-only](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/properties.md#readonly-properties) | Provides access to the sections of the document. These sections have child fields. Each child [field](https://docs.abbyy.com/flexi-capture/sdk/api-reference/field.md) can be either a group of fields (and has own child fields), or a simple field (without child fields). See [Working with Recognized Data](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/workingwithrecognizeddata.md) for details. **Note:** To access the fields of the document, which belongs to some project, you must first open the document using the **Open** method. See the [Using a Document Object within a Project](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/document-using.md) section for details. |
| **Title** | [**String**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/propertiestypes.md) | Specifies the name of the document. |

## Methods

| **Name** | **Description** |
| - | - |
| [**ApplyImageEnhancementProfile**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/document-applyimageenhancementprofile.md) | Applies an image enhancement profile to the specified page. |
| [**CheckRules**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/document-checkrules.md) | Checks all rules imposed on data in the specified field. |
| [**Close**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/document-close.md) | Closes the document. |
| [**ContinueLineItems**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/document-continuelineitems.md) | Attempts to find more line items with the same structure as the first one. For invoices and purchase orders only. |
| [**Open**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/document-open.md) | Opens the document. |
| [**RecognizeBlocks**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/document-recognizeblocks.md) | Recognizes a collection of blocks in the document. |
| [**Save**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/document-save.md) | Saves changes made to the document. |

## Related objects

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

## Output parameter

This object is the output parameter of the [**Item**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/item.md), [**FindById**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documents-findbyid.md), [**Merge**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documents-merge.md), [**AddNewFromPage**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documents-addnewfrompage.md) methods of the [**Documents**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documents.md) object.

## Input parameter

This object is the input parameter of the following methods:

* [**ImportImages**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/project-importimages.md) method of the [**Project**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/project.md) object
* [**MoveDocument**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/batch-movedocument.md) method of the [**Batch**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/batch.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

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

[Using a Document Object within a Project](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/document-using.md)

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

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