Get Started
Plugins
Macros
More information

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

Description

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

Usage

This method should be used in the following way:

window.Asc.plugin.executeMethod ("AddOleObject", [data]);
Parameters
Parameter Description Type Example
data A JSON object which can have the following values:
  • width - the object width measured in millimeters,
    type: number,
    example: 70;
  • height - the object height measured in millimeters,
    type: number,
    example: 70;
  • data - OLE object data (internal format),
    type: string,
    example: "{data}";
  • guid - an OLE object program identifier which must be of the asc.{UUID} type,
    type: string,
    example: "asc.{UUID}";
  • imgSrc - a link to the image (its visual representation) stored in the OLE object and used by the plugin,
    type: string,
    example: "./resources/image.png";
  • widthPix - the image width in pixels,
    type: number,
    example: 60 * 36000;
  • heightPix - the image height in pixels,
    type: number,
    example: 60 * 36000.
object
Returns

The method returns the undefined value.

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