TX Text Control .NET Server

Javascript: SignatureFieldCollection.addAtFixedPositionInDocument Method

Method|Introduced in 31.0

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

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

Parameters

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

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
);