GetClassType
返回 ApiRichParaPr 类的类型。
语法
expression.GetClassType();
expression - 表示 ApiRichParaPr 类的变量。
参数
此方法没有任何参数。
返回值
"richParaPr"
示例
识别 PDF 中段落属性对象的数据类型。
// How do I determine what type an object is in a PDF?
// Find the classification of a paragraph formatting object 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]);
let richContent = freeTextAnnot.GetContent();
let para = richContent.GetElement(0);
para.AddText("Example text");
let paraPr = para.GetParaPr();
console.log(`Object class type is: ${paraPr.GetClassType()}`);