Insert content from extension into document

To insert the content from extension into the current writer document.

Syntax

WriterClient.dispatch("insertContent", data).then(function(response){console.log("response::"+response);

Data parameters

ParameterData TypeDescription
contentStringContent to be inserted into the  document
contentTypeHTML/TextContent format
htmlFormatSourceFormat | DestinationFormat 
scrollIntoViewboolean (true/false) 

 

 

Sample data with HTML

Copieddata: {
    "content": "<b>Hello world, I am content from extension.</b>",
    "contentType": "html"
}

Sample data with text

Copieddata: {
    "content": "Hello world, I am content from extension.",
    "contentType": "text"     
}