Get Started
Documentation
Macros
More information
|
window.Asc.plugin.infoDescription
Defines the auxiliary window.Asc.plugin.info object which is available when the plugin works. It stores all the information about the editor that uses the plugin (the used editorType - text documents, spreadsheets, presentations) and additional settings for OLE objects (their width, height, millimeter to pixel ratio for the OLE objects vector drawing and some other OLE object parameters). This object is used to change the object data and to send additional parameters when executing the window.Asc.plugin.executeCommand. For example, if the document content is changed and recalculation is needed, the parameter window.Asc.plugin.info.recalculate must be set to true. This action is necessary because the recalculation process is asynchronous. Moreover, some other data might need to be uploaded (e.g. a font or something else). See the available window.Asc.plugin.info object methods and properties below to find out more about them. Methods and properties
Example
window.Asc.plugin.button = function (id) { var _info = window.Asc.plugin.info; var _method = (_info.objectId === undefined) ? "asc_addOleObject" : "asc_editOleObject"; _info.width = _info.width ? _info.width : 70; _info.height = _info.height ? _info.height : 70; _info.widthPix = (_info.mmToPx * _info.width) >> 0; _info.heightPix = (_info.mmToPx * _info.height) >> 0; _info.imgSrc = window.g_board.getResult(_info.widthPix, _info.heightPix).image; _info.data = window.g_board.getData(); var _code = "Api." + _method + "(" + JSON.stringify(_info) + ");"; this.executeCommand("close", _code); }; |
||||||||||||||||||||||||||||||||||||||||||||
© Ascensio System SIA 2021. All rights reserved
|