We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Is there a way to insert HTML element at the current cursor location?

Trying to insert HTML element e.g like DIV element at the current cursor location? could not find any example. 

Any help much appreciated 

regards

1 Reply

HC Harini Chellappa Syncfusion Team January 27, 2020 09:18 AM UTC

Hi Sampurnima, 

Syncfusion Greetings! 

Currently document editor doesn’t provide option to insert html content in document editor. 

As a workaround, you can convert the html to docx using DOCIO, and docx to sfdt using word editor.  

Please refer the below documentation for HTML to Docx conversion. 


·       Using paste(sfdt) API in editor module, you can insert a document (extract the document and insert element contains paragraph and table) at current cursor position. 
·        You can pass return server Sfdt string in this method. 
  
Code snippet
  
container.documentEditor.editor.paste(sfdt:string) 

Regards, 
Harini C 


Loader.
Up arrow icon