跳到主要内容

CreateTextAnnot

创建文本批注。

语法

expression.CreateTextAnnot(rect);

expression - 表示 Api 类的变量。

参数

名称必需/可选数据类型默认值描述
rect必需Rect批注矩形。

返回值

ApiTextAnnotation

示例

在 PDF 中向页面添加文本注释。

// How do I add a text annotation to a PDF?

// Create and insert a text annotation at specified coordinates in a PDF.

let doc = Api.GetDocument();
let textAnnot = Api.CreateTextAnnot([10, 10, 160, 32]);
let page = doc.GetPage(0);
page.AddObject(textAnnot);