ApiParaPr

new ApiParaPr()

Class representing the paragraph properties.

Methods

Name Description
GetClassType

Returns a type of the ApiParaPr class.

GetIndFirstLine

Returns the paragraph first line indentation.

GetIndLeft

Returns the paragraph left side indentation.

GetIndRight

Returns the paragraph right side indentation.

GetJc

Returns the paragraph contents justification.

GetSpacingAfter

Returns the spacing after value of the current paragraph.

GetSpacingBefore

Returns the spacing before value of the current paragraph.

GetSpacingLineRule

Returns the paragraph line spacing rule.

GetSpacingLineValue

Returns the paragraph line spacing value.

SetBullet

Sets the bullet or numbering to the current paragraph.

SetIndFirstLine

Sets the paragraph first line indentation.

SetIndLeft

Sets the paragraph left side indentation.

SetIndRight

Sets the paragraph right side indentation.

SetJc

Sets the paragraph contents justification.

SetSpacingAfter

Sets the spacing after the current paragraph. If the value of the isAfterAuto parameter is true, then any value of the nAfter is ignored. If isAfterAuto parameter is not specified, then it will be interpreted as false.

SetSpacingBefore

Sets the spacing before the current paragraph. If the value of the isBeforeAuto parameter is true, then any value of the nBefore is ignored. If isBeforeAuto parameter is not specified, then it will be interpreted as false.

SetSpacingLine

Sets the paragraph line spacing. If the value of the sLineRule parameter is either "atLeast" or "exact", then the value of nLine will be interpreted as twentieths of a point. If the value of the sLineRule parameter is "auto", then the value of the nLine parameter will be interpreted as 240ths of a line.

SetTabs

Specifies a sequence of custom tab stops which will be used for any tab characters in the current paragraph. Warning: The lengths of aPos array and aVal array MUST BE equal to each other.

Example

Copy code
builder.CreateFile("xlsx");
var oWorksheet = Api.GetActiveSheet();
var oFill = Api.CreateSolidFill(Api.CreateRGBColor(255, 111, 61));
var oStroke = Api.CreateStroke(0, Api.CreateNoFill());
var oShape = oWorksheet.AddShape("flowChartOnlineStorage", 120 * 36000, 70 * 36000, oFill, oStroke, 0, 2 * 36000, 0, 3 * 36000);
var oDocContent = oShape.GetContent();
var oParagraph = oDocContent.GetElement(0);
var oParaPr = oParagraph.GetParaPr();
oParagraph.AddText("This is a paragraph with the text in it aligned by the center. ");
oParaPr.SetJc("center");
oParaPr.SetIndFirstLine(1440);
var oParagraph1 = Api.CreateParagraph();
var nIndFirstLine = oParaPr.GetIndFirstLine();
oParagraph1.AddText("First line indent: " + nIndFirstLine);
oDocContent.Push(oParagraph1);
var oParagraph2 = Api.CreateParagraph();
var sClassType = oParaPr.GetClassType();
oParagraph2.AddText("Class Type = " + sClassType);
oDocContent.Push(oParagraph2);
builder.SaveFile("xlsx", "ApiParaPr.xlsx");
builder.CloseFile();

Resulting document