Skip to main content

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​
ParameterTypeDescription
textRangeITextRangetext range.
Returns​

IPositionInText

deleteTextToDirection()​
deleteTextToDirection(direction): void;

Deletes the selected text or character relative to the current cursor position.

Parameters​
ParameterTypeDescription
directionMoveDirectionTypedirection 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​
ParameterTypeDescription
paragraphIndexanyparagraph index (from 0).
Returns​

ITextRange

getTextModel()​
getTextModel(): Text;

Returns the text model.

Returns​

Text

getTextRangeByPositions()​
getTextRangeByPositions(startPosition, endPosition): ITextRange;

Returns the range of text by starting and ending position.

Parameters​
ParameterTypeDescription
startPositionIPositionInTextstarting position.
endPositionIPositionInTextending position.
Returns​

ITextRange

insertFormattedText()​
insertFormattedText(text): void;

Inserts formatted text relative to the current cursor position.

Parameters​
ParameterTypeDescription
textstringtext 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​
ParameterTypeDescription
textstringtext to insert.
Returns​

void

measureText()​
measureText(scale, isExtendToBlackBox?): RectangleF;

Measures text.

Parameters​
ParameterTypeDescription
scalenumberscale.
isExtendToBlackBox?booleanindicates if extend to black box.
Returns​

RectangleF

measureTextFrames()​
measureTextFrames(useActiveText): RectangleF;

Measures the text frame.

Parameters​
ParameterTypeDescription
useActiveTextbooleantrue 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​
ParameterTypeDescription
modelTexttext model.
Returns​

void

setWrappingPath()​
setWrappingPath(data): void;

Sets the wrapping path.

Parameters​
ParameterTypeDescription
dataIWrappingPathDatawrapping path data.
Returns​

void

Was this page helpful?