# Javascript: ImageCollection.addAtFixedPosition Method

> Obsolete. This method will be removed in one of the next versions. Inserts a new image which has a fixed geometrical position in the document. This position is specified through a page number and a location on this page.

> **Note:** This is deprecated and should not be used in new work.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: ImageCollection.addAtFixedPosition Method
- **504 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/imagecollection/addatfixedposition-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/imagecollection/addatfixedposition-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/imagecollection/addatfixedposition-method/llms-full.txt

---

### Description

`Obsolete. This method will be removed in one of the next versions.` Inserts a new image which has a fixed geometrical position in the document. This position is specified through a page number and a location on this page.

### Syntax

```javascript
<void> ImageCollection.addAtFixedPosition(<string> imageData, <number> pageNumber, <Point> location, <ImageInsertionMode> insertionMode, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| imageData | The base64 encoded image data. |
| pageNumber | Specifies the number of a page beginning with 1 where the image is located. |
| location | Specifies the location, in twips, at which the image is to be inserted. This is a location relative to the top left corner either of a page or of a paragraph. |
| insertionMode | Specifies how the text flow is handled. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `ImageCollection.addAtFixedPosition` in a practical document-editing workflow. Obsolete. This method will be removed in one of the next versions. Inserts a new image which has a fixed geometrical position in the document. This position is specified through a page number and a location on this page.

```javascript
function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

TXTextControl.images.addAtFixedPosition(
    "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAFgAH/qbPzWQAAAABJRU5ErkJggg==",
    1,
    { x: 1440, y: 720 },
    TXTextControl.ImageInsertionMode.AsCharacter,
    onTxError
);
```

---

## Nearby

- **Previous:** [Javascript: ImageCollection.addAnchoredAtLocation Method](https://docs.textcontrol.com/ds-server/reference/javascript/imagecollection/addanchoredatlocation-method/llms-full.txt)
- **Next:** [Javascript: ImageCollection.addAtFixedPositionInDocument Method](https://docs.textcontrol.com/ds-server/reference/javascript/imagecollection/addatfixedpositionindocument-method/llms-full.txt)
