跳到主要内容

GetRectDiff

获取批注矩形差值。

语法

expression.GetRectDiff();

expression - 表示 ApiFreeTextAnnotation 类的变量。

参数

此方法没有任何参数。

返回值

Rect

示例

计算 PDF 中注释边框之间的间距。

// How do I measure the padding around a comment box in a PDF?

// Get the inner border margins of an annotation in a PDF.

let doc = Api.GetDocument();
let freeTextAnnot = Api.CreateFreeTextAnnot([160, 50, 360, 135]);
let page = doc.GetPage(0);
page.AddObject(freeTextAnnot);
freeTextAnnot.SetIntent("freeTextCallout");
freeTextAnnot.SetCallout([{x: 161, y: 51}, {x: 249, y: 125}, {x: 261, y: 125}]);
freeTextAnnot.SetRectDiff([100, 64, 0.5, 0.5]);
console.log(`Annot rect diff is: ${freeTextAnnot.GetRectDiff()}`);