跳到主要内容

GetRect

设置批注矩形。

语法

expression.GetRect();

expression - 表示 ApiBaseAnnotation 类的变量。

参数

此方法没有任何参数。

返回值

Rect

示例

此示例创建方形注释并获取其矩形。

let doc = Api.GetDocument();
let squareAnnot = Api.CreateSquareAnnot([10, 10, 160, 32]);
let page = doc.GetPage(0);
page.AddObject(squareAnnot);
console.log(`Annotation rect is: ${squareAnnot.GetRect()}`);