TX Text Control .NET Server

TextChar Object

Object|Introduced in 28.0

Description

The TextChar object represents a single character in a document.

Syntax

TextChar

Examples

The following example demonstrates TextChar in a practical document-editing workflow. The TextChar object represents a single character in a document.

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

function inspectTextChar(textChar) {
    textChar.getBounds(
        function(rect) {
            if (!rect) {
                console.warn("No rectangle was returned.");
                return;
            }
            
            console.log("get bounds result:", rect);
        },
        onTxError
    );
}

Members

Methods

MethodDescription
getBoundsGets the bounding rectangle of the character.
getCharGets the value of the character.
getNumberGets the character's number.

Further Reading

  • Drag and Drop Files into the Current Input Position –
  • Getting the Input Position from the Mouse Position –