TRY NEW VERSION

Try now New API BETA

Try out the new view and capabilities of the API documentation

START

ToJSON

ToJSON() → { JSON }

Inherited From: ApiTableRowPr#ToJSON

Converts the ApiTableRowPr object into the JSON object.

Parameters:

This method doesn't have any parameters.

Returns:

Type
JSON

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oTable = Api.CreateTable(3, 3);
oDocument.Push(oTable);
oTable.SetTableBorderTop("single", 32, 0, 51, 51, 51);
oTable.SetTableBorderBottom("single", 32, 0, 51, 51, 51);
oTable.SetTableBorderLeft("single", 32, 0, 51, 51, 51);
oTable.SetTableBorderRight("single", 32, 0, 51, 51, 51);
oTable.SetTableBorderInsideV("single", 32, 0, 255, 111, 61);
oTable.SetTableBorderInsideH("single", 32, 0, 255, 111, 61);
oTable.SetWidth("percent", 100);
var oRow = oTable.GetRow(1);
var json = oRow.ToJSON();
var oParagraph = Api.CreateParagraph();
oParagraph.AddText("The ApiTableRow object in the JSON format: ").SetBold(true);
oParagraph.AddLineBreak();
oParagraph.AddText(json);
oDocument.Push(oParagraph);
builder.SaveFile("docx", "ToJSON.docx");
builder.CloseFile();

Resulting document