跳到主要内容

GetClassType

返回 ApiLineAnnotation 类的类型。

语法

expression.GetClassType();

expression - 表示 ApiLineAnnotation 类的变量。

参数

此方法没有任何参数。

返回值

"lineAnnot"

示例

检查 PDF 文档中线条注释返回的类类型。

// How do I check what type a line annotation object is in a PDF document?

// Retrieve and output the class type string for a line annotation in a PDF document.

let doc = Api.GetDocument();
let lineAnnot = Api.CreateLineAnnot([10, 10, 160, 32], {x: 12, y: 12}, {x: 155, y: 30});
lineAnnot.SetEndStyle("openArrow");
let page = doc.GetPage(0);
page.AddObject(lineAnnot);
console.log(`Annot class type is: ${lineAnnot.GetClassType()}`);