How to add hyperlink to onlyoffice doc with plugin?

287 views Asked by At

I am trying to write a plugin in onlyoffice(4.4.3) and the plugin is expected to add a hyperlink to content of current doc. I spent quit a lot of time to search the related api in onlyoffice doc(https://api.onlyoffice.com/docbuilder/textdocumentapi), but just can't find it. Meanwhile seems the onlyoffice editor can do that in the UI.

My questions are:

  1. If it is feasible to add a hyperlink to content of current doc via the public apis?
  2. If yes, how to make that?
1

There are 1 answers

0
ibnpetr On

There is no direct way way to add a hyperlink, but there is an alternative solution - try using PasteHtml method

window.Asc.plugin.executeMethod("PasteHtml", ["<a href=\"onlyoffice.com\">link text</a>"]);

New methods will be added soon to the documentation, we are already working on it