SetTopBorder

function SetTopBorder(
  sType: any = null,
  nSize: any = null,
  nSpace: any = null,
  r: any = null,
  g: any = null,
  b: any = null,
): void

Description

Specifies the border which will be displayed above a set of paragraphs which have the same set of paragraph border settings. The paragraphs of the same style going one by one are considered as a single block, so the border is added to the whole block rather than to every paragraph in this block.

Parameters

sTypeanydefault: null

The border style.

nSizeanydefault: null

The width of the current top border measured in eighths of a point.

nSpaceanydefault: null

The spacing offset above the paragraph measured in points used to place this border.

ranydefault: null

Red color component value.

ganydefault: null

Green color component value.

banydefault: null

Blue color component value.

Returns

void

Try It

var oDocument = Api.GetDocument();
var oMyStyle = oDocument.CreateStyle("My document style");
var oParaPr = oMyStyle.GetParaPr();
oParaPr.SetTopBorder("single", 24, 0, 255, 111, 61);
var oParagraph = oDocument.GetElement(0);
oParagraph.SetStyle(oMyStyle);
oParagraph.AddText("This is the first paragraph. ");
oParagraph.AddText("The paragraph properties styled above set a border above it.");

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