AddEndnoteCrossRef

function AddEndnoteCrossRef(
  sRefType: endnoteRefTo = null,
  oParaTo: ApiParagraph = null,
  bLink: boolean = true,
  bAboveBelow: boolean = false,
): boolean

Description

Adds an endnote cross-reference to the current paragraph. Please note that this paragraph must be in the document.

Parameters

sRefTypeendnoteRefTodefault: null

The text or numeric value of an endnote reference you want to insert.

oParaToApiParagraphdefault: null

The first paragraph from an endnote to be referred to (must be in the document).

bLinkbooleandefault: true

Specifies if the reference will be inserted as a hyperlink.

bAboveBelowbooleandefault: false

Specifies if the above/below words indicating the position of the reference should be included (don't used with the "aboveBelow" sRefType).

Returns

boolean

Try It

var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0); 
oParagraph.AddText("This is just a sample text.");
oDocument.AddEndnote();
var aEndNotesFirstParagraphs = oDocument.GetEndNotesFirstParagraphs();
aEndNotesFirstParagraphs[0].AddText("Endnote 1");
oParagraph = Api.CreateParagraph();
oParagraph.AddText("For more information on previous sentences see endnote on page ");
oDocument.Push(oParagraph);
oParagraph.AddEndnoteCrossRef("pageNum", aEndNotesFirstParagraphs[0]);

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).