# PdfImageHandlerCollection

## Content

[**DsPdfJS API v9.1.3**](../README)

***

[DsPdfJS API](../globals) / PdfImageHandlerCollection

# Class: PdfImageHandlerCollection

Represents a collection of [PdfImageHandler](PdfImageHandler) objects.

## Extends

- `PdfKeyedObjectCollection`\<[`Image`](Image), [`PdfImageHandler`](PdfImageHandler)\>

## Accessors

### count

#### Get Signature

> **get** **count**(): `number`

Gets the number of items in the map.

##### Returns

`number`

#### Overrides

`PdfKeyedObjectCollection.count`

***

### id

#### Get Signature

> **get** **id**(): `number`

Gets the reference to the object.

##### Returns

`number`

#### Inherited from

`PdfKeyedObjectCollection.id`

***

### last

#### Get Signature

> **get** **last**(): `TItem` \| `null`

Gets last item in the collection.

##### Returns

`TItem` \| `null`

#### Inherited from

`PdfKeyedObjectCollection.last`

***

### om

#### Get Signature

> **get** **om**(): [`ObjectManager`](ObjectManager)

Gets the owner [ObjectManager](ObjectManager) instance.

##### Returns

[`ObjectManager`](ObjectManager)

#### Inherited from

`PdfKeyedObjectCollection.om`

## Methods

### add()

> **add**(`item`): `void`

Adds an item to the end of the collection.

#### Parameters

##### item

[`PdfImageHandler`](PdfImageHandler)

The item to add.

#### Returns

`void`

#### Inherited from

`PdfKeyedObjectCollection.add`

***

### clear()

> **clear**(): `void`

Clears the collection.

#### Returns

`void`

#### Overrides

`PdfKeyedObjectCollection.clear`

***

### contains()

> **contains**(`item`): `boolean`

Determines whether the item is in the collection.

#### Parameters

##### item

[`PdfImageHandler`](PdfImageHandler)

#### Returns

`boolean`

true if the item is in the collection, false otherwise.

#### Overrides

`PdfKeyedObjectCollection.contains`

***

### containsKey()

> **containsKey**(`key`): `boolean`

Determines whether the item with specified key exists in the collection.

#### Parameters

##### key

[`Image`](Image)

#### Returns

`boolean`

true if the item with the specified key exists in the collection, false otherwise.

#### Overrides

`PdfKeyedObjectCollection.containsKey`

***

### free()

> **free**(): `void`

Detaches the object from the [ObjectManager](ObjectManager) and deallocates its memory, if possible.

#### Returns

`void`

#### Inherited from

`PdfKeyedObjectCollection.free`

***

### get()

> **get**(`key`): [`PdfImageHandler`](PdfImageHandler) \| `undefined`

Gets the item with the specified key.

#### Parameters

##### key

[`Image`](Image)

#### Returns

[`PdfImageHandler`](PdfImageHandler) \| `undefined`

#### Overrides

`PdfKeyedObjectCollection.get`

***

### getAt()

> **getAt**(`index`): [`PdfImageHandler`](PdfImageHandler)

Gets the item with the specified index.

#### Parameters

##### index

`number`

The index of the item.

#### Returns

[`PdfImageHandler`](PdfImageHandler)

#### Overrides

`PdfKeyedObjectCollection.getAt`

***

### getImageHandler()

> **getImageHandler**(`image`): [`PdfImageHandler`](PdfImageHandler)

Gets an existing [PdfImageHandler](PdfImageHandler) associated with a specified [Image](Image),
or creates a new one if such image does not exist.

#### Parameters

##### image

[`Image`](Image)

The image

#### Returns

[`PdfImageHandler`](PdfImageHandler)

The existing or newly created [PdfImageHandler](PdfImageHandler).

***

### insert()

> **insert**(`index`, `item`): `void`

Inserts an item at a specific position in the collection.

#### Parameters

##### index

`number`

The position where the item will be inserted.

##### item

[`PdfImageHandler`](PdfImageHandler)

The item to insert.

#### Returns

`void`

#### Overrides

`PdfKeyedObjectCollection.insert`

***

### rebind()

> **rebind**(`omTo`): `void`

Rebinds the object from the current [ObjectManager](ObjectManager) to the specified one.

#### Parameters

##### omTo

[`ObjectManager`](ObjectManager)

The new [ObjectManager](ObjectManager) for the object.

#### Returns

`void`

#### Inherited from

`PdfKeyedObjectCollection.rebind`

***

### remove()

> **remove**(`item`): `boolean`

Removes the specified item from the collection.

#### Parameters

##### item

[`PdfImageHandler`](PdfImageHandler)

The item to remove.

#### Returns

`boolean`

true if the item was actually removed, false otherwise.

#### Overrides

`PdfKeyedObjectCollection.remove`

***

### removeAt()

> **removeAt**(`index`): `void`

Removes the item at specified index.

#### Parameters

##### index

`number`

The index of the item to remove.

#### Returns

`void`

#### Overrides

`PdfKeyedObjectCollection.removeAt`

***

### removeByKey()

> **removeByKey**(`key`): `boolean`

Removes the item with specified key from the collection.

#### Parameters

##### key

[`Image`](Image)

The key to remove.

#### Returns

`boolean`

true if the item with specified key was actually removed, false otherwise.

#### Overrides

`PdfKeyedObjectCollection.removeByKey`

***

### setAt()

> **setAt**(`index`, `item`): `void`

Sets the item at the specified index.

#### Parameters

##### index

`number`

The index of the item, starting from 0.

##### item

[`PdfImageHandler`](PdfImageHandler)

The object to set.

#### Returns

`void`

#### Overrides

`PdfKeyedObjectCollection.setAt`
