# Cloud Vision V1 Client - Class TextAnnotation (2.2.1)

2.2.1 (latest) 2.2.0 2.1.3 2.0.3 1.10.3 1.9.4 1.8.0 1.7.6 1.6.8 Reference documentation and code samples for the Cloud Vision V1 Client class TextAnnotation.

TextAnnotation contains a structured representation of OCR extracted text.

The hierarchy of an OCR extracted text structure is like this:
TextAnnotation -\> Page -\> Block -\> Paragraph -\> Word -\> Symbol
Each structural component, starting from Page, may further have their own
properties. Properties describe detected languages, breaks etc.. Please refer
to the
[TextAnnotation.TextProperty](https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.TextAnnotation.TextProperty)
message definition below for more detail.

Generated from protobuf message `google.cloud.vision.v1.TextAnnotation`

## Namespace

Google \\ Cloud \\ Vision \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ pages` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.Page>` List of pages detected by OCR. |
| `↳ text` | `string` UTF-8 text detected on the pages. |

### getPages

List of pages detected by OCR.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.Page>` |   |

### setPages

List of pages detected by OCR.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.Page>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getText

UTF-8 text detected on the pages.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setText

UTF-8 text detected on the pages.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |