window.Asc.plugin.init(data)

Description

Defines the data sent to the plugin describing what actions are to be performed and how they must be performed. This method is called when the plugin is launched.

Parameters
Name Description Type
data Defines the data parameter that depends on the initDataType setting specified in the plugin configuration config.json file. The type of the data is as follows: none - an empty string, text - the text of the selected document, html - a fragment of the selected document, ole - the data of the OLE object. string
Example
window.Asc.plugin.init = function () {
    this.callCommand(function() {
        var oDocument = Api.GetDocument();
        var oParagraph = Api.CreateParagraph();
        oParagraph.AddText("Hello world!");
        oDocument.InsertContent([oParagraph]);
    }, true);
};