跳到主要内容

CreatePolygonAnnot

创建多边形批注。

语法

expression.CreatePolygonAnnot(rect, path);

expression - 表示 Api 类的变量。

参数

名称必需/可选数据类型默认值描述
rect必需Rect批注矩形。
path必需Path多边形路径

返回值

ApiPolygonAnnotation

示例

创建多边形注释并将其添加到页面。

// How do I create the polygon annot in a PDF document?

// Create the polygon annot and display the result in a PDF document.

let doc = Api.GetDocument();
let polygonAnnot = Api.CreatePolygonAnnot([40, 40, 200, 200], [{x: 100, y: 100}, {x: 150, y: 150}, {x: 100, y: 150}]);
let page = doc.GetPage(0);
page.AddObject(polygonAnnot);