function IsAnnotationObjectSubtypeSupported(Subtype: TPdfAnnotationSubtype): Boolean;
| Subtype | TPdfAnnotationSubtype。要测试的子类型:anUnknown、anText、anLink、anFreeText、anLine、anSquare、anCircle、anPolygon、anPolyLine、anHighlight、anUnderline、anSquiggly、anStrikeout、anStamp、anCaret、anInk、anPopup、anFileAttachment、anSound、anMovie、anWidget、anScreen、anPrinterMark、anTrapNet、anWaterMark、anThreed、anRichMedia、anXfaWidget、anRedact |
| Result | Boolean。当模块支持以对象级方式处理该子类型时为 True |
IsAnnotationSubtypeSupported 的对象级对应版本。那个调用报告子类型能否通过 CreateAnnotation 创建,而这个调用询问模块是否支持处理该子类型的对象 — 即支配注释对象 API 的查询,例如 AnnotationObjectInfo 和 AnnotationObjectCount,它们读取并编辑绘制在注释内部的页面对象
答案因 PDFium 构建而异。先做测试可让应用程序提前启用或禁用对象级编辑功能,而不是稍后在真正调用时失败
当已加载的 PDFium 构建未导出原生查询(FPDFAnnot_IsObjectSupportedSubtype)时,结果为 False,使调用方保持保守
if Pdf1.IsAnnotationObjectSubtypeSupported(anStamp) then
BtnEditStampObjects.Enabled := True
else
// 此 PDFium 构建不支持对象级的图章编辑
BtnEditStampObjects.Enabled := False;