ToJSON
将 ApiTableRowPr 对象转换为 JSON 对象。
语法
expression.ToJSON();
expression - 表示 ApiTableRowPr 类的变量。
参数
此方法没有任何参数。
返回值
JSON
示例
此示例将 ApiTableRowPr 对象转换为 JSON 对象。
// How to get a JSON from the table row properties.
// Convert the table row properties to json and add it to the document.
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);