Javascript: SignatureFieldCollection.addInline Method
Description
Inserts a signature field inline, which means that it is treated in the text like a single character. The signature field is inserted at the specified text input position.
Syntax
<void> SignatureFieldCollection.addInline(<Size> size, <number> textPosition, [<ErrorCallback> errorCallback], [<RequestSignatureFieldCallback> callback])Parameters
| Parameter | Description |
|---|---|
| size | The signature field's size in twips. |
| textPosition | Specifies the text position at which the signature field is to be inserted. If -1 is specified, the signature field is inserted at the current input position. |
| errorCallback | Optional. Is called when the operation failed with an error. |
| callback | Optional. The newly created signature field object is returned via this callback function. |
Examples
The following example demonstrates SignatureFieldCollection.addInline in a practical document-editing workflow. It inserts a signature field inline, which means that it is treated in the text like a single character. The signature field is inserted at the specified text input position.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.signatureFields.addInline(
{ width: 2880, height: 1440 },
-1,
onTxError,
function(signatureField) {
if (!signatureField) {
console.warn("No signature field was returned.");
return;
}
console.log("add inline result:", signatureField);
}
);