# Javascript: BarcodeCollection.addAtFixedPositionOnPage Method

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

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Javascript: BarcodeCollection.addAtFixedPositionOnPage Method
- **670 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/barcodecollection/addatfixedpositiononpage-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/barcodecollection/addatfixedpositiononpage-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/barcodecollection/addatfixedpositiononpage-method/llms-full.txt

---

### Description

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> BarcodeCollection.addAtFixedPositionOnPage(<RequestBarcodeFrameCallback> callback, [<ErrorCallback> errorCallback], <BarcodeType> barcodeType, <string> text, <number> pageNumber, <Point> location, <FrameInsertionMode> insertionMode)
```

### Parameters

| Parameter | Description |
|---|---|
| callback | The newly created barcode object is returned via this callback function. |
| errorCallback | Optional. Is called when the operation failed with an error. |
| barcodeType | The barcode type. |
| text | The text the barcode should encrypt. |
| pageNumber | Specifies the number of a page beginning with 1 where the barcode is located. |
| location | Specifies the location, in twips, at which the barcode 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. |

### Examples

The following example demonstrates `BarcodeCollection.addAtFixedPositionOnPage` in a practical document-editing workflow. It 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;
}

function addAtFixedPositionOnPage(barcodeType) {
    TXTextControl.barcodes.addAtFixedPositionOnPage(
        function(barcodeFrame) {
            if (!barcodeFrame) {
                console.warn("No barcode frame was returned.");
                return;
            }
            
            console.log("add at fixed position on page result:", barcodeFrame);
        },
        onTxError,
        barcodeType,
        "Quarterly report",
        1,
        { x: 1440, y: 720 },
        TXTextControl.FrameInsertionMode.AsCharacter
    );
}
```

---

## Nearby

- **Previous:** [Javascript: BarcodeCollection.addAtFixedPositionInDocument Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/barcodecollection/addatfixedpositionindocument-method/llms-full.txt)
- **Next:** [Javascript: BarcodeCollection.addInline Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/barcodecollection/addinline-method/llms-full.txt)
