跳到主要内容

ToJSON

Converts the ApiTableRowPr object into the JSON object.

Syntax

expression.ToJSON();

expression - A variable that represents a ApiTableRowPr class.

Parameters

This method doesn't have any parameters.

Returns

JSON

Example

This example converts the ApiTableRowPr object into the JSON object.

let doc = Api.GetDocument();
let tableStyle = doc.CreateStyle("CustomTableStyle", "table");
tableStyle.SetBasedOn(doc.GetStyle("Bordered"));
let table = Api.CreateTable(3, 3);
table.SetWidth("percent", 100);
let tableRowPr = tableStyle.GetTableRowPr();
tableRowPr.SetHeight("atLeast", 720);
table.SetStyle(tableStyle);
doc.Push(table);
let json = tableRowPr.ToJSON();
let tableRowPrFromJSON = Api.FromJSON(json);
let classType = tableRowPrFromJSON.GetClassType();
let paragraph = doc.GetElement(0);
paragraph.AddText("Class type = " + classType);