Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetAllOleObjects returned undefined #183

Open
elkon028 opened this issue Jul 7, 2023 · 0 comments
Open

GetAllOleObjects returned undefined #183

elkon028 opened this issue Jul 7, 2023 · 0 comments
Assignees

Comments

@elkon028
Copy link

elkon028 commented Jul 7, 2023

https://api.onlyoffice.com/plugin/executemethod/text/getalloleobjects

  • config.json
{
  "name": "report",
  "guid": "asc.{4B8FEA54-6EDA-1B1B-EF2F-EF9F12248E44}",
  "version": "1.0.0",
  "baseUrl": "",

  "variations": [
    {
      "description": "test report",
      "url": "index.html",

      "icons": ["resources/light/icon.png", "resources/light/icon@2x.png"],
      "icons2": [
        {
          "style": "light",
          "100%": {
            "normal": "resources/light/icon.png"
          },
          "125%": {
            "normal": "resources/light/icon@1.25x.png"
          },
          "150%": {
            "normal": "resources/light/icon@1.5x.png"
          },
          "175%": {
            "normal": "resources/light/icon@1.75x.png"
          },
          "200%": {
            "normal": "resources/light/icon@2x.png"
          }
        },
        {
          "style": "dark",
          "100%": {
            "normal": "resources/dark/icon.png"
          },
          "125%": {
            "normal": "resources/dark/icon@1.25x.png"
          },
          "150%": {
            "normal": "resources/dark/icon@1.5x.png"
          },
          "175%": {
            "normal": "resources/dark/icon@1.75x.png"
          },
          "200%": {
            "normal": "resources/dark/icon@2x.png"
          }
        }
      ],

      "EditorsSupport": ["word"],
      "isSystem": false,
      "isViewer": false,
      "isVisual": true,
      "isModal": true,
      "isInsideMode": false,

      "initDataType": "none",
      "initData": "",

      "size": [700, 10000]
    }
  ]
}
  • code.js
// ....
plugin.init = function () {
  var plugin = window.Asc.plugin
  plugin.init = function () {
    plugin.executeMethod ("GetAllOleObjects", [plugin.guid], function (data) {
        console.info('GetAllOleObjects', data)  // data is undefined
    });
  }
}

// OR

plugin.init = function () {
  var plugin = window.Asc.plugin
  var image = {
    data: '',
    imgSrc: 'https://fanyi-cdn.cdn.bcebos.com/static/translation/img/header/logo_e835568.png',
    guid: plugin.guid,
    "width": 70,
    "height": 70,
    "widthPix": 60 * 36000,
    "heightPix": 60 * 36000
  }

  plugin.executeMethod('AddOleObject', [image], function () {
    plugin.executeMethod('GetAllOleObjects', [plugin.guid], function (data) {
      console.info('GetAllOleObjects', data)  // data is undefined
    })
  })
}

data is undefined, why?

@askonev askonev self-assigned this Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants