TextPart Object
Description
Represents a part of the document, which can be the main text, a header or footer or a text frame. The callback function argument for the getTextParts function.
Syntax
TextPartExamples
The following example demonstrates TextPart in a practical document-editing workflow. It represents a part of the document, which can be the main text, a header or footer or a text frame. The callback function argument for the getTextParts function.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.textParts.getMainText(function(textPart) {
textPart.getID(
function(result) {
console.log("get id result:", result);
},
onTxError
);
}, onTxError);Members
Properties
| Property | Description |
|---|---|
| index | Obsolete. This property will be removed in one of the next versions. The 0-based index of the text part. |
| selection | Obsolete. This property will be removed in one of the next versions. The getter returns an object of type Selection. The setter changes the selection to a given start position and a given length using an object of type SelectionBounds. |
| type | Obsolete. This property will be removed in one of the next versions. The Text part type. Possible values are "mainText", "headerFooter" and "textFrame". |
Methods
| Method | Description |
|---|---|
| addSubTextPart | Obsolete. This method will be removed in one of the next versions. Inserts a new SubTextPart into the TextPart at the current input position. |
| addTextField | Obsolete. This method will be removed in one of the next versions. Inserts a new ApplicationField or TextField into the TextPart at the current input position. |
| getSubTextParts | Obsolete. This method will be removed in one of the next versions. Requests a collection of either all subtextparts the current text part contains or only the subtextpart containing the input position from the server and returns the collection by calling a callback function which has to be provided as a parameter to the function. |
| getTextFields | Obsolete. This method will be removed in one of the next versions. Requests a collection of either all text fields in the text part or only the text field containing the input position from the server and returns the collection by calling a callback function which has to be provided as a parameter to the function. |
| removeSubTextPart | Obsolete. This method will be removed in one of the next versions. Removes a SubTextPart from the TextPart. |