Get Started
Usage API
More information

GetJc

GetJc() → { "left" | "right" | "both" | "center" | undefined }

Inherited From: ApiParaPr.GetJc

Get paragraph contents justification.

Parameters:

This method doesn't have any parameters.

Returns:

Type
"left" | "right" | "both" | "center" | undefined

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oParagraph = oDocument.GetElement(0);
oParagraph.AddText("This is a paragraph with the text in it aligned by the center. ");
oParagraph.AddText("These sentences are used to add lines for demonstrative purposes. ");
oParagraph.AddText("These sentences are used to add lines for demonstrative purposes.");
oParagraph.SetJc("center");
sJc = oParagraph.GetJc();
oParagraph = Api.CreateParagraph();
oParagraph.AddText("Justification: " + sJc);
oDocument.Push(oParagraph);
builder.SaveFile("docx", "GetJc.docx");
builder.CloseFile();

Resulting document