Editor API in Vue DocumentEditor API component - Syncfusion

Editor API in Vue DocumentEditor API component

Editor module

Methods

applyBorders

Applies the borders based on given settings.

ParameterTypeDescription
settingsBorderSettingsSpecify the border settings to be applied.

Returns void

applyBullet

Applies the bullet list to selected paragraphs.

ParameterTypeDescription
bulletstringSpecify the bullet character to be applied.
fontFamilystringSpecify the bullet font family name.

Returns void

applyContinueNumbering

Applies the continue numbering from the previous list.

Returns void

applyNumbering

Applies the numbering list to selected paragraphs.

ParameterTypeDescription
numberFormatstring“%n” representations in ‘numberFormat’ parameter will be replaced by respective list level’s value.
“%1)” will be displayed as “1)”
listLevelPattern (optional)ListLevelPatternDefault value of ‘listLevelPattern’ parameter is ListLevelPattern.Arabic

Returns void

applyStyle

Applies the specified style for paragraph.

ParameterTypeDescription
stylestringSpecify the style name to apply.
clearDirectFormatting (optional)booleanRemoves manual formatting (formatting not applied using a style)
from the selected text, to match the formatting of the applied style. Default value is false.

Returns void

autoFitTable

Fits the table based on AutoFitType.

ParameterTypeDescription
fitTypeAutoFitTypeSpecify the auto fit type.

Returns void

beginBatchEdit

Initiates a batch update mode where multiple editing operations can be grouped together. This prevents intermediate re-layout during the execution of grouped operations, improving performance for bulk updates.

Returns void

canMergeCells

Determines whether the merge cell operation can be done.

Returns boolean

clearElementRevision

Clears the specified revision from the document.

ParameterTypeDescription
revisionRevisionSpecify the revision to clear from the document.

Returns void

clearFormatting

Clears the formatting.

Returns void

clearList

Clears the list format for selected paragraphs.

Returns void

continueNumbering

Continues the numbering sequence of the current list from the selected paragraph.

Returns void

createStyle

Creates a new style or modifies an existing style with the specified style properties.

If modifyExistingStyle parameter is set to true and a style already exists with same name, it modifies the specified properties in the existing style. If modifyExistingStyle parameter is set to false and a style already exists with same name, it creates a new style with unique name by appending ‘_1’. Hence, the newly style will not have the specified name. If no style exists with same name, it creates a new style.

ParameterTypeDescription
styleStringstringThe style properties.
modifyExistingStyle (optional)booleanThe Boolean value denotes whether to modify the properties in the existing style or create a new style.

Returns string

cut

Moves the selected content in the document editor control to clipboard.

Returns void

decreaseIndent

Decreases the left indent of selected paragraphs to a factor of 36 points.

Returns void

delete

Removes the current selected content or one character right of the cursor.

Returns void

deleteAllComments

Deletes all the comments in the current document.

Returns void

deleteBookmark

Deletes the specified bookmark in the current document.

ParameterTypeDescription
bookmarkNamestringSpecify the name of bookmark to be deleted.

Returns void

deleteColumn

Deletes the selected column(s).

Returns void

deleteComment

Deletes the specified comment. If the provided id corresponds to a parent comment, the entire comment along with its replies will be deleted. If the provided id corresponds to a single reply comment, only that particular reply will be deleted.

Returns void

deleteRow

Deletes the selected row(s).

Returns void

deleteTable

Deletes the entire table at selection.

Returns void

endBatchEdit

Ends the batch update mode and triggers a single re-relayout or change notification to reflect all the modifications made during the batch update.

Returns void

enforceProtection

Enforces the document protection by protection type.

ParameterTypeDescription
credentialstringSpecify the credential to protect the document.
protectionTypeProtectionTypeSpecify the document protection type.

Returns void

enforceProtection

Enforces the document protection with the specified credential.

ParameterTypeDescription
credentialstringSpecify the credential to protect the document.
limitToFormattingbooleanTrue if to limit the document formatting; Otherwise, false.
isReadOnlybooleanTrue if to allow read-only access to the document; Otherwise, false.

Returns void

enforceProtectionAsync

Enforces the document protection with the specified protection type.

ParameterTypeDescription
credentialstringSpecify the credential to protect the document.
protectionTypeProtectionTypeSpecify the document protection type.

Returns Promise

enforceProtectionAsync

Enforces the document protection with the specified credential.

ParameterTypeDescription
credentialstringSpecify the credential to protect the document.
limitToFormattingbooleanTrue if to limit the document formatting; Otherwise, false.
isReadOnlybooleanTrue if to allow read-only access to the document; Otherwise, false.

Returns Promise

increaseIndent

Increases the left indent of selected paragraphs to a factor of 36 points.

Returns void

insertBookmark

Inserts the specified bookmark at the current selection range.

Returns void

insertColumn

Inserts the specified number of columns to the table left or right to the column at cursor position.

ParameterTypeDescription
left (optional)booleanThe left parameter is optional and if omitted, it takes the value as false and
inserts to the right of column at cursor position.
count (optional)numberThe count parameter is optional and if omitted, it takes the value as 1.

Returns void

insertColumnBreak

Inserts a column break at cursor position.

Returns void

insertComment

Inserts the comment.

ParameterTypeDescription
text (optional)stringSpecify the comment text to be inserted.

Returns void

insertComment

Inserts a comment with the specified properties.

ParameterTypeDescription
textstringSpecify the comment text to be inserted.
commentPropertiesCommentPropertiesThe properties of the comment (author, isResolved, dateTime).

Returns Comment

insertContentControl

Inserts a content control.

Returns ContentControlInfo

insertContentControl

Inserts a content control.

Returns ContentControlInfo

insertContentControl

Inserts a content control.

Returns ContentControlInfo

insertContentControl

Inserts a content control with the specified content control properties.

ParameterTypeDescription
infoContentControlInfoThe content control information specifying the properties of the content control to insert

Returns ContentControlInfo

insertEditingRegion

Inserts the editing region where everyone can edit.

Returns void

insertEditingRegion

Inserts the editing region where mentioned user can edit.

ParameterTypeDescription
userstringSpecifies the native rendering

Returns void

insertEndnote

Inserts the endnote at the current selection

Returns void

insertField

Inserts the specified field at cursor position.

ParameterTypeDescription
codestringSpecify the field code.
result (optional)stringSpecify the field result.

Returns void

insertFootnote

Inserts the footnote at the current selection.

Returns void

insertFormField

Inserts the specified form field at the current selection.

ParameterTypeDescription
typeFormFieldTypeSpecify the Form field type to insert.

Returns void

Inserts the Hyperlink.

ParameterTypeDescription
addressstringSpecify the Hyperlink URL to be inserted.
displayText (optional)stringSpecify the display text for the hyperlink
screenTip (optional)stringSpecify the screen tip text.

Returns void

insertImage

Inserts the image with specified size at cursor position in the document editor.

ParameterTypeDescription
imageStringstringBase64 string, web URL or file URL.
width (optional)numberSpecify the image width.
height (optional)numberSpecify the image height.
alternateText (optional)stringSpecify the image alternateText.

Returns void

insertImageAsync

Inserts an image with a specified size at the cursor position in the DocumentEditor component.

ParameterTypeDescription
imageStringstringThe Base64 string, web URL, or file URL of the image to be inserted.
width (optional)numberThe width of the image. Optional parameter, if not specified, the original width of the image will be used.
height (optional)numberThe height of the image. Optional parameter, if not specified, the original height of the image will be used.
alternateText (optional)stringThe alternate text of the image. Optional parameter, if specified, this text will be displayed when the image is not available or when images are disabled in the document.

Returns Promise

insertPageBreak

Inserts the page break at the cursor position.

Returns void

insertPageNumber

Inserts the page number in the current cursor position.

ParameterTypeDescription
numberFormat (optional)stringOptional switch that overrides the numeral style of the page number.

Returns void

insertReplyComment

Inserts a reply to a comment.

ParameterTypeDescription
idstringThe unique identifier of the comment to reply to.
textstringThe text of the reply.
commentPropertiesCommentPropertiesThe properties of the reply (author, isResolved, dateTime).

Returns Comment

insertRow

Inserts the specified number of rows to the table above or below to the row at cursor position.

ParameterTypeDescription
above (optional)booleanThe above parameter is optional and if omitted,
it takes the value as false and inserts below the row at cursor position.
count (optional)numberThe count parameter is optional and if omitted, it takes the value as 1.

Returns void

insertSectionBreak

Inserts the section break at cursor position with specified section break type.

Returns void

insertTable

Inserts a table of specified size at cursor position in the document editor.

ParameterTypeDescription
rows (optional)numberDefault value of ‘rows’ parameter is 1.
columns (optional)numberDefault value of ‘columns’ parameter is 1.

Returns void

insertTableOfContents

Inserts, modifies or updates the table of contents based on given settings.

ParameterTypeDescription
tableOfContentsSettings (optional)TableOfContentsSettingsSpecify the table of content settings to be inserted.

Returns void

insertText

Inserts the specified text at cursor position

ParameterTypeDescription
textstringSpecify the text to insert.

Returns void

mergeCells

Merges the selected cells.

Returns void

paste

Pastes the provided content into the editor.

Returns void

paste

Pastes the provided sfdt content or the data present in local clipboard if any.

ParameterTypeDescription
sfdt (optional)stringSpecifies the sfdt content to paste at current position.
defaultPasteOption (optional)PasteOptionsSpecifies the paste options.

Returns void

removeEditingRegion

Removes the editing permission range at the current selection position that matches the specified username. If user is provided, removes the editing region specific to that user. If user is not provided (null or undefined), it defaults to ‘Everyone’.

Returns void

Removes the hyperlink if selection is within hyperlink.

Returns void

removeRevision

Removes the specified revision from the document.

ParameterTypeDescription
revisionToRemoveRevisionSpecify the revision to be removed.

Returns any

restartNumbering

Restarts the numbering of the current list from the selected paragraph.

Returns void

retrieveFieldResultantText

Retrieves the resultant field text from the specified field element box.

ParameterTypeDescription
itemFieldElementBoxSpecify the field element box to retrieve field text.

Returns string

setContentControlInfo

Sets the existing content control within the editor using the provided information. The content control is identified by its unique combination of title and tag.

Returns ContentControlInfo

setFieldInfo

Sets the field information for the selected field.

ParameterTypeDescription
fieldInfoFieldInfo– Specifies the field information.

Returns void

stopProtection

Stops the document protection.

ParameterTypeDescription
passwordstringSpecify the password to stop protection.

Returns void

stopProtectionAsync

Stops the document protection.

ParameterTypeDescription
passwordstringSpecify the password to stop protection.

Returns Promise

toggleAllCaps

Toggles the all Caps formatting for the selected content.

Returns void

toggleBaselineAlignment

Toggles the baseline alignment property of selected contents.

ParameterTypeDescription
baseAlignmentBaselineAlignmentSpecifies the baseline alignment.

Returns void

toggleBold

Toggles the bold property of selected contents.

Returns void

toggleHighlightColor

Toggles the highlight color property of selected contents.

ParameterTypeDescription
highlightColor (optional)HighlightColorSpecify the highlight color to be applied (default: Yellow).

Returns void

toggleItalic

Toggles the bold property of selected contents.

Returns void

toggleStrikethrough

Toggles the strike through property of selected contents.

ParameterTypeDescription
strikethrough (optional)StrikethroughSpecify the strike through to be toggled (default: SingleStrike).

Returns void

toggleSubscript

Toggles the subscript formatting of selected contents.

Returns void

toggleSuperscript

Toggles the superscript formatting of selected contents.

Returns void

toggleTextAlignment

Toggles the text alignment of selected paragraphs.

ParameterTypeDescription
textAlignmentTextAlignmentSpecifies the text alignment.

Returns void

toggleUnderline

Toggles the underline property of selected contents.

ParameterTypeDescription
underline (optional)UnderlineSpecify the underline to be toggled (default: Single).

Returns void

updateSelectedCellsInTable

private

Returns CellInfo