I’m trying to open a template file from my custom plugin. I don’t get any errors. But for some reason nothing happens when I call OpenFile.
Here is my code that I’m trying to run:
const templateId = Asc.scope.step.data.template;
const template = await fetch(`http://localhost:3000/templates/${templateId}`);
const arrayBuffer = await template.arrayBuffer();
const uint8Array = new Uint8Array(arrayBuffer);
window.Asc.plugin.executeMethod('OpenFile', [uint8Array, ['id', `${templateId}.xlsx`]], function (result) {
console.log('OpenFile.result', result);
});
An example of a table (template) that I want to open (below):
Query result where I get the table to open:
The size of the uint8Array is exactly the same as the size of the file I want to open.
Here is the version of my editor:
I will attach a video describing the problem:
https://files.fm/f/g6qa4xk82z