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

<CardGroup cols={3}>
  <Card title="Transaction" icon="exchange" href="/vantage/documentation/skill-designer/process/custom-activity/transaction">
    The current transaction and access to all of its documents.
  </Card>

  <Card title="Field" icon="font" href="/vantage/documentation/skill-designer/process/custom-activity/field">
    Provides access to the field value and its properties.
  </Card>

  <Card title="Page" icon="file" href="/vantage/documentation/skill-designer/process/custom-activity/page">
    Properties of a single document page, including image dimensions.
  </Card>

  <Card title="BinaryFile" icon="file-binary" href="/vantage/documentation/skill-designer/process/custom-activity/binary-file">
    File data in binary format — typically the pre-preprocessing source image.
  </Card>

  <Card title="Object model" icon="diagram-project" href="/vantage/documentation/skill-designer/process/custom-activity/object-model">
    Full JavaScript object reference for Custom activity scripts.
  </Card>

  <Card title="Custom activity" icon="code" href="/vantage/documentation/skill-designer/process/custom-activity/custom-activity">
    Extend skills with scripted logic and third-party integrations.
  </Card>
</CardGroup>
