TextCharCollection Object
Description
Contains all characters in a Text Control document or part of the document.
Syntax
TextCharCollectionExamples
The following example demonstrates TextCharCollection in a practical document-editing workflow. It contains all characters in a Text Control document or part of the document.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function inspectTextCharCollection(textChars) {
textChars.getItem(
{ x: 1440, y: 720 },
true,
function(textChar) {
if (!textChar) {
console.warn("No text char was returned.");
return;
}
console.log("get item result:", textChar);
},
onTxError
);
}Members
Methods
| Method | Description |
|---|---|
| add | Inserts a character at the specified position using the specified font. |
| addControlChar | Inserts a control character at the specified text input position. |
| elementAt | Returns the element at a specified index in the collection. (Inherited from Collection.) |
| forEach | Executes a callback function for each element. (Inherited from Collection.) |
| getCount | Gets the number of elements contained in the collection. (Inherited from Collection.) |
| getItem | Gets a particular character from the collection specified through a certain geometrical position. |
| remove | Removes the character by number. |