Pin a text/image to the last paragraph of the document

Is there a way to pin a text/image to the last paragraph of the document? Regardless of whether more than one page in the editor is opened, I want the text to always be in the last paragraph before the footer, so that it prevents the user from typing after the fixed text/image.

I did some tests on this, here’s the test:

docConnector.callCommand(
      function () {
        var oDocument = Api.GetDocument();
        var oNewParagraph = Api.CreateParagraph();
        oNewParagraph.AddText("last paragraph.");

        var totalElements = oDocument.GetElementsCount();
        var lastElement = oDocument.GetElement(totalElements - 1);
        if (lastElement.GetClassType() == 'paragraph') {
          lastElement.Select();
          lastElement.InsertParagraph(oNewParagraph, "after", true);
        }
    }
);

Hello, we are currently analysing the issue, please wait.

Hello, no problem, I will wait.

Hello, sorry for the delayed response. Theoretically, the following methods can be used to insert something in the end:

  1. Push - ONLYOFFICE Api Documentation
    This method by default adds element to the end
  2. InsertContent - ONLYOFFICE Api Documentation
    Using this method you can get the list of all elements and then pass your needed parameter as i +1 (so it would be the last).

But there is no way to actually make it so, that the element would always be in the end and other users won’t be able to continue filling in the document after the element. Such pinning is impossible