Insert text with reference in the document

Can I insert text in the document to access it via $ref?

1 Reply

SM Suriya Murugan Syncfusion Team February 16, 2021 07:09 AM UTC

Hi Hamud, 
 
Syncfusion Greetings! 
 
## Insert Text 
 
DocumentEditor have insertText() API in editor module to insert text in current position. 
 
Code snippet. 
this.$refs.container.ej2Instances.documentEditor.editor.insertText("Welcome") 
 
 
## To get selected text 
 
To retrieve the selected text, DocumentEditor have getText() API in selection module. 
 
Code snippet: 
this.$refs.container.ej2Instances.documentEditor.selection.text 
 
 
Please let us know if you have any questions. 
 
Regards, 
Suriya M. 


Loader.
Up arrow icon