SetVertAlign

function SetVertAlign(sType: baseline | subscript | superscript = null): ApiParagraph | "null"

Description

Specifies the alignment which will be applied to the contents of this paragraph in relation to the default appearance of the paragraph text: "baseline" - the characters in the current paragraph will be aligned by the default text baseline. "subscript" - the characters in the current paragraph will be aligned below the default text baseline. "superscript" - the characters in the current paragraph will be aligned above the default text baseline.

Parameters

sTypebaseline | subscript | superscriptdefault: null

The vertical alignment type applied to the text contents.

Returns

ApiParagraph | "null"

Try It

var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("This is a paragraph with the text aligned below the baseline vertically.");
oParagraph.SetVertAlign("subscript");
oParagraph = Api.CreateParagraph();
oParagraph.AddText("This is a paragraph with the text aligned above the baseline vertically.");
oParagraph.SetVertAlign("superscript");
oDocument.Push(oParagraph);

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).