CreateTextAnnot
创建文本批注。
语法
expression.CreateTextAnnot(rect);
expression - 表示 Api 类的变量。
参数
| 名称 | 必需/可选 | 数据类型 | 默认值 | 描述 |
|---|---|---|---|---|
| rect | 必需 | Rect | 批注矩形。 |
返回值
示例
在 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);