> ## 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 オブジェクト（IDocument インターフェイス）

このオブジェクトは、処理対象のドキュメントに対応します。ドキュメントは、バッチの一部である場合と、単独のインスタンスである場合があります。バッチの一部としてのドキュメントは、Project内でデータを処理する際に取得されます。このようなドキュメントのコレクションは、[**Documents**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/documents.md) オブジェクトで表されます。

新しく作成された **Document** オブジェクトには文書ページのコレクションが含まれており、**Pages** プロパティからアクセスできます。ドキュメント定義のマッチング中に、ドキュメント内のデータfieldが検出されます。これらの field には、ドキュメントのセクションを参照する **Sections** プロパティからアクセスできます。各セクションは子 field を持ちます。各子 field は、field グループ (独自の子 field を持つ) と単純な field (子 field を持たない) のいずれかです。詳細については、[認識データの操作](https://docs.abbyy.com/ja/flexi-capture/sdk/guided-tour/workingwithrecognizeddata.md)を参照してください。データ抽出と認識が完了すると、ドキュメントをエクスポートできます。文書処理中にエラーが発生した場合は、**Document** オブジェクトの対応するプロパティ (**AssemblingErrors**、**RuleErrors**) でエラー情報を確認できます。

ドキュメントを操作したり、その構造やパラメーターなどにアクセスしたりするには、まず **Open** メソッドでドキュメントを開く必要があります。作業が完了したら、**Close** メソッドでドキュメントを閉じます。詳細については、[Project内での Document オブジェクトの使用](https://docs.abbyy.com/ja/flexi-capture/sdk/guided-tour/document-using.md)を参照してください。

**Document** オブジェクトは [**IField**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/field.md) インターフェイスをサポートしています。つまり、ドキュメント全体を、ドキュメントのすべてのデータfieldを含む最上位の field と見なすことができます。このインターフェイスをサポートしているため、**Document** オブジェクトを **Field** オブジェクトとして扱うことができます。

## Properties

| **名前** | **型** | **説明** |
| - | - | - |
| **AsBatchItem** | [**BatchItem**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/batchitem.md)、[読み取り専用](https://docs.abbyy.com/ja/flexi-capture/sdk/guided-tour/properties.md#readonly-properties) | **Document** をバッチアイテムとして表します。ドキュメントがバッチアイテムでない場合、このプロパティは NULL になります。 |
| **AsClassificationTrainingDocument** | [**ClassificationTrainingDocument**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/classificationtrainingdocument.md)、[読み取り専用](https://docs.abbyy.com/ja/flexi-capture/sdk/guided-tour/properties.md#readonly-properties) | 対応する分類学習オブジェクトにアクセスできます。 |
| **AssemblingErrors** | [**AssemblingErrors**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/assemblingerrors.md)、[読み取り専用](https://docs.abbyy.com/ja/flexi-capture/sdk/guided-tour/properties.md#readonly-properties) | 文書構成エラーのコレクションを返します。 |
| **Batch** | [**Batch**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/batch.md)、[読み取り専用](https://docs.abbyy.com/ja/flexi-capture/sdk/guided-tour/properties.md#readonly-properties) | ドキュメントが属する **Batch** オブジェクトへのアクセスを提供します。 |
| **Comment** | [**String**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/propertiestypes.md) | 文書に自由なテキストでコメントを指定できます。このコメントはABBYY FlexiCaptureで表示できます。 |
| **DocumentDefinition** | [**DocumentDefinition**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/documentdefinition.md)、[読み取り専用](https://docs.abbyy.com/ja/flexi-capture/sdk/guided-tour/properties.md#readonly-properties) | ドキュメントに適用された Document Definition を返します。 |
| **HasRuleErrors** | [**Boolean**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/propertiestypes.md)、読み取り専用 | ドキュメントにルールエラーがあるかどうかを示します。**RuleErrors** プロパティとは異なり、このプロパティはドキュメントが閉じられた状態でも使用できます。 |
| **Id** | [**Integer**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/propertiestypes.md)、読み取り専用 | ドキュメントの識別子を示します。 |
| **IsExported** | [**ブール型**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/propertiestypes.md)、読み取り専用 | ドキュメントが Document Definition で指定された出力先にエクスポート済みかどうか (つまり、既定のパラメーターでエクスポートされたかどうか) を示します。 |
| **IsVerified** | [**ブール型**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/propertiestypes.md)、読み取り専用 | ドキュメントが検証済みかどうかを示します。 |
| **LockType** | [**LockTypeEnum**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/locktypeenum.md)、読み取り専用 | ドキュメントの状態を返します。ドキュメントは、閉じている状態、読み取り用に開いている状態、または読み書き用に開いている状態のいずれかです。 |
| **Pages** | [**Pages**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/pages.md)、[読み取り専用](https://docs.abbyy.com/ja/flexi-capture/sdk/guided-tour/properties.md#readonly-properties) | ドキュメント内のページのコレクションを返します。 |
| **RegistrationParameters** | [**RegistrationParameters**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/registrationparameters.md)、読み取り専用 | ドキュメントの登録パラメーターのコレクションを返します。 |
| **RuleErrors** | [**RuleErrors**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/ruleerrors.md), [読み取り専用](https://docs.abbyy.com/ja/flexi-capture/sdk/guided-tour/properties.md#readonly-properties) | 条件を満たしていないルールに関するエラーのコレクションを返します。 |
| **Sections** | [**Fields**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/fields.md)、[読み取り専用](https://docs.abbyy.com/ja/flexi-capture/sdk/guided-tour/properties.md#readonly-properties) | ドキュメントのセクションへのアクセスを提供します。これらのセクションには子 field が含まれます。各子 [field](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/field.md) は、field グループ (独自の子 field を持つ) または単純な field (子 field を持たない) のいずれかです。詳細については、[認識データの操作](https://docs.abbyy.com/ja/flexi-capture/sdk/guided-tour/workingwithrecognizeddata.md)を参照してください。 **注:** プロジェクトに属するドキュメントの field にアクセスするには、まず **Open** メソッドでドキュメントを開く必要があります。詳細については、[Project 内での Document オブジェクトの使用](https://docs.abbyy.com/ja/flexi-capture/sdk/guided-tour/document-using.md)セクションを参照してください。 |
| **Title** | [**String**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/propertiestypes.md) | ドキュメントの名前を指定します。 |

## メソッド

| **名前** | **説明** |
| - | - |
| [**ApplyImageEnhancementProfile**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/document-applyimageenhancementprofile.md) | 指定したページに画像補正プロファイルを適用します。 |
| [**CheckRules**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/document-checkrules.md) | 指定した field のデータに設定されているすべてのルールをチェックします。 |
| [**Close**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/document-close.md) | ドキュメントを閉じます。 |
| [**ContinueLineItems**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/document-continuelineitems.md) | 最初の明細項目と同じ構造を持つ明細項目を、さらに検索しようと試みます。請求書および購買注文書でのみ使用できます。 |
| [**Open**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/document-open.md) | ドキュメントを開きます。 |
| [**RecognizeBlocks**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/document-recognizeblocks.md) | ドキュメント内のブロックのコレクションを認識します。 |
| [**Save**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/document-save.md) | ドキュメントに加えた変更を保存します。 |

## 関連オブジェクト

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

## 出力パラメーター

このオブジェクトは、[**Documents**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/documents.md) オブジェクトの [**Item**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/item.md)、[**FindById**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/documents-findbyid.md)、[**Merge**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/documents-merge.md)、[**AddNewFromPage**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/documents-addnewfrompage.md) の各メソッドの出力パラメーターです。

## 入力パラメーター

このオブジェクトは、次のメソッドの入力パラメーターです。

* [**Project**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/project.md) オブジェクトの [**ImportImages**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/project-importimages.md) メソッド
* [**Batch**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/batch.md) オブジェクトの [**MoveDocument**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/batch-movedocument.md) メソッド

## サンプル

このオブジェクトは、次のコード サンプルで使用されています：[分類](https://docs.abbyy.com/ja/flexi-capture/sdk/guided-tour/samples.md#classification)、[請求書の処理と学習](https://docs.abbyy.com/ja/flexi-capture/sdk/guided-tour/samples.md#invoicesprocessingandtraining)。

## 関連項目

[認識データの操作](https://docs.abbyy.com/ja/flexi-capture/sdk/guided-tour/workingwithrecognizeddata.md)

[Project 内での Document オブジェクトの使用](https://docs.abbyy.com/ja/flexi-capture/sdk/guided-tour/document-using.md)

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

[Properties の操作](https://docs.abbyy.com/ja/flexi-capture/sdk/guided-tour/properties.md)
