TX Text Control .NET Server

DocumentLinkCollection Object

Object|Introduced in 28.0

Description

The DocumentLinkCollection contains a collection of document links.

Syntax

DocumentLinkCollection

Examples

The following example demonstrates DocumentLinkCollection in a practical document-editing workflow. The DocumentLinkCollection contains a collection of document links .

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

TXTextControl.textParts.getMainText(function(mainText) {
    const documentLinks = mainText.documentLinks;
    documentLinks.getItem(
        function(result) {
            if (!result) {
                console.warn("No document link was returned.");
                return;
            }
            
            console.log("get item result:", result);
        },
        onTxError,
        25
    );
}, onTxError);

Members

Methods

MethodDescription
addAdds a new document link to the collection.
clearRemoves all document links from the collection.
elementAtReturns the element at a specified index in the collection. (Inherited from Collection.)
forEachExecutes a callback function for each element. (Inherited from Collection.)
getCountGets the number of elements contained in the collection. (Inherited from Collection.)
getItemGets the document link at the current text input position or the document link with the specified id.
removeRemoves the link from the collection.