Download as from plugin

Integration questions/issues
Post Reply
digimip09
Posts: 10
Joined: Tue Nov 17, 2020 1:05 pm

Download as from plugin

Post by digimip09 » Wed Jun 02, 2021 12:13 pm

Hello everyone,

I would like to download the current file from the Document Editor, using a custom plugin. But I'm not sure about how I can call the "downloadAs" method from the API.

The code I've tried inside of my plugin is :

Code: Select all

var onDownloadAs = function (event) {
	console.log("ONLYOFFICE Document Editor create file: " + event.data);
};

var docEditor = new DocsAPI.DocEditor("placeholder", {
	"events": {
		"onDownloadAs": onDownloadAs
	}
});
								
docEditor.downloadAs();
For now, I get "ReferenceError: DocsAPI is not defined" in Chrome developer console... What do I need to do ?

Thank you in advance for your help :)

Alexandre
Posts: 268
Joined: Thu Dec 12, 2019 11:08 am

Re: Download as from plugin

Post by Alexandre » Thu Jun 03, 2021 1:39 pm

Hello digimip09.
Unfortunately, we don’t have ready-to-go solution for your request. I’m not sure that calling ‘download as’ method from the plugin is workable solution.
Sorry for the inconvenience.

digimip09
Posts: 10
Joined: Tue Nov 17, 2020 1:05 pm

Re: Download as from plugin

Post by digimip09 » Fri Jun 04, 2021 6:20 am

Hello Alexandre,

Thank you for your response. Is there a way then to close the file and download the edited version of the document, from the plugin ?

Alexandre
Posts: 268
Joined: Thu Dec 12, 2019 11:08 am

Re: Download as from plugin

Post by Alexandre » Fri Jun 04, 2021 11:18 am

Unfortunately, there’s no way for such actions from plugin.

Post Reply