Interface: OfficeEditor

Core.Document. OfficeEditor

Represents an interface with APIs for editing office files

Methods


copySelectedText()

Copy the current selected text to clipboard.
Returns:
Returns a promise that resolves when the action finishes.
Type
Promise.<void>

decreaseIndent()

Decrease the indent of the current paragraphs.
Returns:
Type
Promise.<void>

increaseIndent()

Increase the indent of the current paragraphs.
Returns:
Type
Promise.<void>

isTextSelected()

Returns whether text is being selected.
Returns:
Type
boolean

pasteText(withFormatting)

Paste text from clipboard.
Parameters:
Name Type Description
withFormatting boolean Whether to paste with formatting or not.

removeSelection()

Remove the current selected text.

setCursorStyle(style)

Set the style of the cursor.
Parameters:
Name Type Description
style Core.Document.OfficeEditorCursorStyle The style object
Example
officeEditor.setCursorStyle({ pointSize: 24, italic: false, bold: false});

setListPreset(number)

Set the indent style of the selected text
Parameters:
Name Type Description
number Core.Document.OfficeEditorListStylePresets The style preset enum to set list to
Example
const officeEditor = instance.Core.documentViewer.getDocument().getOfficeEditor();
officeEditor.setListPreset(instance.Core.Document.OfficeEditorListStylePresets.DIAMOND);

toggleListSelection(listType)

Toggle the list selection.
Parameters:
Name Type Description
listType 'ordered' | 'unordered' The type of the list.
Returns:
Returns a promise that resolves when the action finishes.
Type
Promise.<void>

toggleSelectedTextStyle(style)

Toggle style of the selected text.
Parameters:
Name Type Description
style Core.Document.OfficeEditorToggleableStyles The style to toggle
Returns:
Returns a promise that resolves when the style has been toggled
Type
Promise.<void>

updateParagraphStyle(style)

Updates the style of the current paragraph.
Parameters:
Name Type Description
style Core.Document.OfficeEditorParagraphStyle The styles to apply.
Returns:
Returns a promise that resolves when the action finishes.
Type
Promise.<void>

updateSearchData()

Update the search data. Should be called whenever a search is performed to make sure all text data has been downloaded for the document.

updateSelectionStyle(style)

Update the style of the current selection.
Parameters:
Name Type Description
style Core.Document.OfficeEditorSelectionStyle The styles to apply.
Returns:
Returns a promise that resolves when the action finishes.
Type
Promise.<void>