跳到主要内容

SetStartPoint

设置线条起点。

语法

expression.SetStartPoint(point);

expression - 表示 ApiLineAnnotation 类的变量。

参数

名称必需/可选数据类型默认值描述
point必需Point线条的起始点。

返回值

boolean

示例

重新定位 PDF 中线条注释的起始位置。

// How do I move the starting position of a line in a PDF?

// Update the coordinates for the line's starting location in a PDF.

let doc = Api.GetDocument();
let lineAnnot = Api.CreateLineAnnot([10, 10, 160, 32], {x: 12, y: 12}, {x: 155, y: 30});
lineAnnot.SetEndStyle("openArrow");
lineAnnot.SetStartPoint({x: 20, y: 20});
let page = doc.GetPage(0);
page.AddObject(lineAnnot);
console.log(`Start point set to: ${lineAnnot.GetEndPoint()}`);