ITextService
Interfaces
ITextService
Service for performing basic operations with text content.
Extended by
Properties
textChangedEvent
textChangedEvent: EventObject<void>;
Text content change event.
Methods
deleteAllText()
deleteAllText(): void;
Deletes all text.
Returns
void
deleteTextByRange()
deleteTextByRange(textRange): IPositionInText;
Deletes text by range
Parameters
| Parameter | Type | Description |
|---|---|---|
textRange | ITextRange | text range. |
Returns
deleteTextToDirection()
deleteTextToDirection(direction): void;
Deletes the selected text or character relative to the current cursor position.
Parameters
| Parameter | Type | Description |
|---|---|---|
direction | MoveDirectionType | direction of text deletion. |
Returns
void
getFormattedText()
getFormattedText(): string;
Returns formatted text.
Returns
string
getParagraphCount()
getParagraphCount(): number;
Returns paragraph count.
Returns
number
getParagraphText()
getParagraphText(paragraphIndex): ITextRange;
Returns the text range of a paragraph by index.
Parameters
| Parameter | Type | Description |
|---|---|---|
paragraphIndex | any | paragraph index (from 0). |
Returns
getTextModel()
getTextModel(): Text;
Returns the text model.
Returns
getTextRangeByPositions()
getTextRangeByPositions(startPosition, endPosition): ITextRange;
Returns the range of text by starting and ending position.
Parameters
| Parameter | Type | Description |
|---|---|---|
startPosition | IPositionInText | starting position. |
endPosition | IPositionInText | ending position. |
Returns
insertFormattedText()
insertFormattedText(text): void;
Inserts formatted text relative to the current cursor position.
Parameters
| Parameter | Type | Description |
|---|---|---|
text | string | text to insert. |
Returns
void
insertNewLine()
insertNewLine(): void;
Inserts a new line relative to the current cursor position.
Returns
void
insertPlainText()
insertPlainText(text): void;
Inserts plain text relative to the current cursor position.
Parameters
| Parameter | Type | Description |
|---|---|---|
text | string | text to insert. |
Returns
void
measureText()
measureText(scale, isExtendToBlackBox?): RectangleF;
Measures text.
Parameters
| Parameter | Type | Description |
|---|---|---|
scale | number | scale. |
isExtendToBlackBox? | boolean | indicates if extend to black box. |
Returns
RectangleF
measureTextFrames()
measureTextFrames(useActiveText): RectangleF;
Measures the text frame.
Parameters
| Parameter | Type | Description |
|---|---|---|
useActiveText | boolean | true if you want to use the currently active text, false if the item's original text. |
Returns
RectangleF
setTextModel()
setTextModel(model): void;
Sets the text model.
Parameters
| Parameter | Type | Description |
|---|---|---|
model | Text | text model. |
Returns
void
setWrappingPath()
setWrappingPath(data): void;
Sets the wrapping path.
Parameters
| Parameter | Type | Description |
|---|---|---|
data | IWrappingPathData | wrapping path data. |
Returns
void