window.Asc.plugin.executeMethod("AddOleObject", [args], callback)


Defines the method that allows adding an OLE object to the document.


This method should be used in the following way:

window.Asc.plugin.executeMethod("AddOleObject", [data]);

Where data is a JSON object of the following form:

    "width" : number,
    "height" : number,
    "data" : "string",
    "guid" : "string",
    "imgSrc" : "string",
    "widthPix" : number,
    "heightPix" : number

The data object can have the following values:

  • "width" (e.g. {"width": 70}) is an object width measured in millimeters;
  • "height" (e.g. {"height": 70}) is an object height measured in millimeters;
  • "data" (e.g. {"data": "{data}"}) is OLE object data (internal format);
  • "guid" (e.g. {"guid": "asc.{UUID}"}) is an OLE object program identifier which must be of the asc.{UUID} type;
  • "imgSrc" (e.g. {"imgSrc": "{link}"}) is a link to the image (its visual representation) stored in the OLE object and used by the plugin;
  • "widthPix" (e.g. {"widthPix": 60 * 36000}) is an image width in pixels;
  • "heightPix" (e.g. {"heightPix": 60 * 36000}) is an image height in pixels.

The method returns the undefined value.

window.Asc.plugin.executeMethod("AddOleObject", [{"width": 70, "height": 70, "data": "{data}", "guid": "asc.{UUID}", "imgSrc": "{link}", "widthPix": 60 * 36000, "heightPix": 60 * 36000}]);