Get Started
Plugins
Macros
More information

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

Description

Defines the method that allows adding the OLE object to the current document position.

Usage

This method should be used in the following way:

window.Asc.plugin.executeMethod ("AddOleObject", [NewObject]);
Parameters
Parameter Description Type Example
NewObject The OLEObjectData object which contains the following parameters:
  • Data - OLE object data (internal format),
    type: string,
    example: "{data}";
  • ImageData - an image in the base64 format stored in the OLE object and used by the plugin,
    type: string,
    example: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAYAAABy6";
  • ApplicationId - an identifier of the plugin which can edit the current OLE object and must be of the asc.{UUID} type,
    type: string,
    example: "asc.{38E022EA-AD92-45FC-B22B-49DF39746DB4}";
  • Width - the OLE object width measured in millimeters,
    type: number,
    example: 70;
  • Height - the OLE object height measured in millimeters,
    type: number,
    example: 70;
  • WidthPix - the OLE object image width in pixels,
    type: number,
    example: 60 * 36000;
  • HeightPix - the OLE object image height in pixels,
    type: number,
    example: 60 * 36000.
object
Returns

The method returns the undefined value.

Example
window.Asc.plugin.executeMethod("AddOleObject", [{"Data": "{data}", "ImageData": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAYAAABy6", "ApplicationId": "asc.{38E022EA-AD92-45FC-B22B-49DF39746DB4}", "Width": 70, "Height": 70, "WidthPix": 60 * 36000, "HeightPix": 60 * 36000}]);