Asc.plugin.callCommand does nothing and returns undefined for most PDFs

Do you want to: Ask a how-to question
Document Server version: 8.3.3

Hi

We are developing a plugin for which we rely on the docs API functionality such as

  • searching for ApiRanges
  • highlighting ApiRanges
  • navigating to ApiRanges

It all works fine when working with a docx but with pdfs it does not really work unless the pdf was created via onlyoffice itself.

Now one thing I noticed is that when I execute a callCommand it works fine with a pdf created in onlyoffice but it just returns undefined and does nothing for any other pdfs (which have textboxes).


Only office pdfs seem to be editable within the editor like a docx while other pdfs require you edit only single textboxes.

I see that there seem to be some pdf specific js sdk methods for search and highlight

Is that functionality supposed to work on all pdfs or just something for pdfs created within onlyoffice?

If that is the case, are there maybe other ways to search text within pdfs and add highlights?