跳到主要内容

SetRectDiff

设置批注矩形差值。

语法

expression.SetRectDiff(rectDiff);

expression - 表示 ApiFreeTextAnnotation 类的变量。

参数

名称必需/可选数据类型默认值描述
rectDiff必需RectDiff描述两个矩形之间数值差异的四个数字的集合。

返回值

boolean

示例

调整 PDF 中文本注释周围的边框间距。

// How do I control the distance between the text and the annotation border in a PDF?

// Modify the boundary offset and confirm the change in a PDF.

let doc = Api.GetDocument();
let freeTextAnnot = Api.CreateFreeTextAnnot([160, 50, 360, 135]);
let page = doc.GetPage(0);
page.AddObject(freeTextAnnot);
freeTextAnnot.SetRectDiff([10, 10, 10, 10]);
console.log(`Annot rect diff is: ${freeTextAnnot.GetRectDiff()}`);