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

> The Document object — properties and methods for reading the document being processed, including fields, pages, classification results, and source files.

`Document` represents the document currently being processed in a Custom activity script — its fields, pages, classification results, source files, and export results.

<Note>
  Depending on which processing stages have completed, some properties may return empty values. For example, only `DocumentId` and `SourceFiles` are populated before any skill is applied. `ResultClass` is populated after a Classification skill runs. `Fields` is populated after extraction.
</Note>

## Properties

| Name                       | Type                                                                                                            | Access     | Description                                                                                                                                                                                                       |
| :------------------------- | :-------------------------------------------------------------------------------------------------------------- | :--------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **ClassConfidences**       | [ClassConfidenceModel](/vantage/documentation/skill-designer/process/custom-activity/class-confidence-model)\[] | Read-only  | The confidence values for each class.                                                                                                                                                                             |
| **DocumentId**             | string                                                                                                          | Read-only  | The unique document identifier.                                                                                                                                                                                   |
| **DocumentSkillId**        | string                                                                                                          | Read-only  | The unique identifier of the Document skill applied to the document.                                                                                                                                              |
| **DocumentSkillName**      | string                                                                                                          | Read-only  | The name of the Document skill applied to the document.                                                                                                                                                           |
| **Fields**                 | [Field](/vantage/documentation/skill-designer/process/custom-activity/field)\[]                                 | Read-only  | Fields detected on the document. Populated only after a Document skill runs.                                                                                                                                      |
| **IsResultClassConfident** | bool                                                                                                            | Read-only  | `true` if the document's class was determined with confidence.                                                                                                                                                    |
| **Pages**                  | [Page](/vantage/documentation/skill-designer/process/custom-activity/page)\[]                                   | Read-only  | The pages of the document.                                                                                                                                                                                        |
| **ResultClass**            | string                                                                                                          | Read-only  | The class assigned by the Classification skill. Empty if the document wasn't classified.                                                                                                                          |
| **RuleErrors**             | [RuleError](/vantage/documentation/skill-designer/process/custom-activity/rule-error)\[]                        | Read-only  | Field extraction validation rule errors.                                                                                                                                                                          |
| **SourceFiles**            | [BinaryFile](/vantage/documentation/skill-designer/process/custom-activity/binary-file)\[]                      | Read-only  | Document source files. Contains the image before preprocessing. Source metadata (including EXIF data) is preserved for JPEGs.                                                                                     |
| **Exports**                | [ResultFiles](/vantage/documentation/skill-designer/process/custom-activity/document-export-result#resultfiles) | Read-write | Document export results.                                                                                                                                                                                          |
| **RegistrationParameters** | `Record<string, Parameter>`                                                                                     | Read-only  | Dictionary of the source file's registration parameters for the first page — keys are parameter names, values are [`Parameter`](/vantage/documentation/skill-designer/process/custom-activity/parameter) objects. |

<Note>
  `ClassConfidences` and `IsResultClassConfident` are populated only when a Classification skill has been applied.
</Note>

## Methods

### ToJsonString

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

Returns the document data as a JSON-formatted string.

### GetField

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

Returns the [`Field`](/vantage/documentation/skill-designer/process/custom-activity/field) object for the named field.

## Related topics

* [Transaction](/vantage/documentation/skill-designer/process/custom-activity/transaction)
* [Field](/vantage/documentation/skill-designer/process/custom-activity/field)
* [Page](/vantage/documentation/skill-designer/process/custom-activity/page)
* [BinaryFile](/vantage/documentation/skill-designer/process/custom-activity/binary-file)
* [Object model](/vantage/documentation/skill-designer/process/custom-activity/object-model)
* [Custom activity](/vantage/documentation/skill-designer/process/custom-activity/custom-activity)
