# Javascript: SignatureFieldCollection.addAtFixedPositionInDocument Method

> Creates and inserts a new signature field which has a fixed geometrical position in the document. This position is specified through a location relative to the top left corner of the complete document. All gaps between the pages must be included.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 31.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: SignatureFieldCollection.addAtFixedPositionInDocument Method
- **638 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/signaturefieldcollection/addatfixedpositionindocument-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/signaturefieldcollection/addatfixedpositionindocument-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/signaturefieldcollection/addatfixedpositionindocument-method/llms-full.txt

---

### Description

Creates and inserts a new signature field which has a fixed geometrical position in the document. This position is specified through a location relative to the top left corner of the complete document. All gaps between the pages must be included.

### Syntax

```javascript
<void> SignatureFieldCollection.addAtFixedPositionInDocument(<Size> size, <Point> location, <FrameInsertionMode> insertionMode, [<RequestSignatureFieldCallback> callback], [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| size | The signature field's size in twips. |
| location | Specifies the location, in twips, at which the signature field is to be inserted. This is a location relative to the top left corner of the complete document. All gaps between the pages must be included. |
| insertionMode | Specifies how the text flow is handled. |
| callback | Optional. The newly created signature field object is returned via this callback function. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `SignatureFieldCollection.addAtFixedPositionInDocument` in a practical document-editing workflow. It creates and inserts a new signature field which has a fixed geometrical position in the document. This position is specified through a location relative to the top left corner of the complete document. All gaps between the pages must be included.

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

TXTextControl.signatureFields.addAtFixedPositionInDocument(
    { width: 2880, height: 1440 },
    { x: 1440, y: 720 },
    TXTextControl.FrameInsertionMode.AsCharacter,
    function(signatureField) {
        if (!signatureField) {
            console.warn("No signature field was returned.");
            return;
        }
        
        console.log("add at fixed position in document result:", signatureField);
    },
    onTxError
);
```

---

## Nearby

- **Previous:** [Javascript: SignatureFieldCollection.addAnchoredAtLocation Method](https://docs.textcontrol.com/ds-server/reference/javascript/signaturefieldcollection/addanchoredatlocation-method/llms-full.txt)
- **Next:** [Javascript: SignatureFieldCollection.addAtFixedPositionOnPage Method](https://docs.textcontrol.com/ds-server/reference/javascript/signaturefieldcollection/addatfixedpositiononpage-method/llms-full.txt)
