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

> Document オブジェクト — field、ページ、分類結果、ソース ファイルなど、処理中の Document を参照するためのプロパティとメソッド。

`Document` は、カスタム アクティビティ スクリプトで現在処理中の Document (その field、ページ、分類結果、ソース ファイル、エクスポート結果) を表します。

<Note>
  どの処理ステージが完了しているかによっては、一部のプロパティが空の値を返すことがあります。たとえば、いずれの Skill も適用される前に設定されるのは `DocumentId` と `SourceFiles` のみです。`ResultClass` は分類スキルの実行後に設定されます。`Fields` は抽出後に設定されます。
</Note>

<div id="properties">
  ## プロパティ
</div>

| 名前                         | 型                                                                                                                  | アクセス      | 説明                                                                                                                                                |
| :------------------------- | :----------------------------------------------------------------------------------------------------------------- | :-------- | :------------------------------------------------------------------------------------------------------------------------------------------------ |
| **ClassConfidences**       | [ClassConfidenceModel](/ja/vantage/documentation/skill-designer/process/custom-activity/class-confidence-model)\[] | 読み取り専用    | 各クラスの信頼度の値です。                                                                                                                                     |
| **DocumentId**             | string                                                                                                             | 読み取り専用    | 一意のDocument識別子です。                                                                                                                                 |
| **DocumentSkillId**        | string                                                                                                             | 読み取り専用    | Documentに適用された Document skill の一意の識別子です。                                                                                                          |
| **DocumentSkillName**      | string                                                                                                             | 読み取り専用    | Documentに適用された Document skill の名前です。                                                                                                              |
| **Fields**                 | [Field](/ja/vantage/documentation/skill-designer/process/custom-activity/field)\[]                                 | 読み取り専用    | Document上で検出された field です。Document skill の実行後にのみ設定されます。                                                                                            |
| **IsResultClassConfident** | bool                                                                                                               | 読み取り専用    | Documentのクラスが信頼できるものとして判定された場合は `true` です。                                                                                                        |
| **Pages**                  | [Page](/ja/vantage/documentation/skill-designer/process/custom-activity/page)\[]                                   | 読み取り専用    | Documentのページです。                                                                                                                                   |
| **ResultClass**            | string                                                                                                             | 読み取り専用    | 分類スキルによって割り当てられたクラスです。Documentが分類されていない場合は空です。                                                                                                    |
| **RuleErrors**             | [RuleError](/ja/vantage/documentation/skill-designer/process/custom-activity/rule-error)\[]                        | 読み取り専用    | field 抽出のバリデーションルールエラーです。                                                                                                                         |
| **SourceFiles**            | [BinaryFile](/ja/vantage/documentation/skill-designer/process/custom-activity/binary-file)\[]                      | 読み取り専用    | Documentのソースファイルです。前処理前の画像が含まれます。JPEG では、ソースのメタデータ (EXIF データを含む) が保持されます。                                                                         |
| **Exports**                | [ResultFiles](/ja/vantage/documentation/skill-designer/process/custom-activity/document-export-result#resultfiles) | 読み取り/書き込み | Documentのエクスポート結果です。                                                                                                                              |
| **RegistrationParameters** | `Record<string, Parameter>`                                                                                        | 読み取り専用    | 最初のページに対するソースファイルの登録パラメーターの辞書です。キーはパラメーター名、値は [`Parameter`](/ja/vantage/documentation/skill-designer/process/custom-activity/parameter) オブジェクトです。 |

<Note>
  `ClassConfidences` と `IsResultClassConfident` は、分類スキルが適用された場合にのみ設定されます。
</Note>

<div id="methods">
  ## メソッド
</div>

<div id="tojsonstring">
  ### ToJsonString
</div>

```javascript theme={null}
string ToJsonString();
```

Documentデータを JSON 形式の文字列として返します。

<div id="getfield">
  ### GetField
</div>

```javascript theme={null}
Field GetField(string fieldName);
```

指定した名前の field に対応する [`Field`](/ja/vantage/documentation/skill-designer/process/custom-activity/field) オブジェクトを返します。

<div id="related-topics">
  ## 関連トピック
</div>

* [トランザクション](/ja/vantage/documentation/skill-designer/process/custom-activity/transaction)
* [Field](/ja/vantage/documentation/skill-designer/process/custom-activity/field)
* [ページ](/ja/vantage/documentation/skill-designer/process/custom-activity/page)
* [BinaryFile](/ja/vantage/documentation/skill-designer/process/custom-activity/binary-file)
* [オブジェクト モデル](/ja/vantage/documentation/skill-designer/process/custom-activity/object-model)
* [カスタム アクティビティ](/ja/vantage/documentation/skill-designer/process/custom-activity/custom-activity)
