跳到主要内容

CreateParagraph

创建新段落。

语法

expression.CreateParagraph();

expression - 表示 Api 类的变量。

参数

此方法没有任何参数。

返回值

ApiParagraph

示例

创建新段落并将其插入文档。

// Create the paragraph object, add a text to it, and insert it into the document class.

// How to create a paragraph with the specified text and add it to the current document.

let doc = Api.GetDocument();
let paragraph = Api.CreateParagraph();
paragraph.AddText("This is a new paragraph");
doc.Push(paragraph);