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>

getEmbeddedFonts()

Gets the embedded fonts in the document.
Returns:
Returns a promise that resolves to array containing the embedded fonts metadata
Type
Promise.<Core.Document.EmbeddedFontMetaData>

isLicenseValid()

Returns true if the license key is valid for office editor and false otherwise.
Returns:
Type
boolean
Example
officeEditor.isLicenseValid();

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.OfficeEditorTextStyle The style object
Example
officeEditor.setCursorStyle({ pointSize: 24, italic: false, bold: false});

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.OfficeEditorTextStyle The styles to apply.
Returns:
Returns a promise that resolves when the action finishes.
Type
Promise.<void>