# Cloud Vision V1 Client - Class AnnotateFileRequest (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 AnnotateFileRequest.

A request to annotate one single file, e.g. a PDF, TIFF or GIF file.

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

## Namespace

Google \\ Cloud \\ Vision \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ input_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.InputConfig` Required. Information about the input file. |
| `↳ features` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.Feature>` Required. Requested features. |
| `↳ image_context` | `https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.ImageContext` Additional context that may accompany the image(s) in the file. |
| `↳ pages` | `int[]` Pages of the file to perform image annotation. Pages starts from 1, we assume the first page of the file is page 1. At most 5 pages are supported per request. Pages can be negative. Page 1 means the first page. Page 2 means the second page. Page -1 means the last page. Page -2 means the second to the last page. If the file is GIF instead of PDF or TIFF, page refers to GIF frames. If this field is empty, by default the service performs image annotation for the first 5 pages of the file. |

### getInputConfig

Required. Information about the input file.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.InputConfig|null` |   |

### hasInputConfig

### clearInputConfig

### setInputConfig

Required. Information about the input file.

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

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

### getFeatures

Required. Requested features.

| **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.Feature>` |   |

### setFeatures

Required. Requested features.

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

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

### getImageContext

Additional context that may accompany the image(s) in the file.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.ImageContext|null` |   |

### hasImageContext

### clearImageContext

### setImageContext

Additional context that may accompany the image(s) in the file.

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

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

### getPages

Pages of the file to perform image annotation.

Pages starts from 1, we assume the first page of the file is page 1.
At most 5 pages are supported per request. Pages can be negative.
Page 1 means the first page.
Page 2 means the second page.
Page -1 means the last page.
Page -2 means the second to the last page.
If the file is GIF instead of PDF or TIFF, page refers to GIF frames.
If this field is empty, by default the service performs image annotation
for the first 5 pages of the file.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<int>` |   |

### setPages

Pages of the file to perform image annotation.

Pages starts from 1, we assume the first page of the file is page 1.
At most 5 pages are supported per request. Pages can be negative.
Page 1 means the first page.
Page 2 means the second page.
Page -1 means the last page.
Page -2 means the second to the last page.
If the file is GIF instead of PDF or TIFF, page refers to GIF frames.
If this field is empty, by default the service performs image annotation
for the first 5 pages of the file.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int[]` |

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