Get Started
Documentation

AddBreak

AddBreak(breakType, position)

Inserts a break at the specified location in the main document.

Parameters:

Name Type Description
breakType number

0 -> page break, 1 -> line break.

position string

can bet "after" or "before"

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oParagraph = oDocument.GetElement(0);
oFill = Api.CreateSolidFill(Api.CreateRGBColor(104, 155, 104));
oStroke = Api.CreateStroke(0, Api.CreateNoFill());
oDrawing = Api.CreateShape("rect", 3212465, 963295, oFill, oStroke);
oParagraph.AddDrawing(oDrawing);
oDrawing.InsertParagraph("Added an LineBreak after this paragraph.", "before", false);
oDrawing.AddBreak(1, "before");
builder.SaveFile("docx", "AddBreak.docx");
builder.CloseFile();