PDFium Delphi Component 文件

IsAnnotationObjectSubtypeSupported 方法

组件: TPdf  ·  单元: PDFium
询问已加载的 PDFium 模块是否支持把给定的注释子类型作为注释对象处理

语法

function IsAnnotationObjectSubtypeSupported(Subtype: TPdfAnnotationSubtype): Boolean;

SubtypeTPdfAnnotationSubtype。要测试的子类型:anUnknownanTextanLinkanFreeTextanLineanSquareanCircleanPolygonanPolyLineanHighlightanUnderlineanSquigglyanStrikeoutanStampanCaretanInkanPopupanFileAttachmentanSoundanMovieanWidgetanScreenanPrinterMarkanTrapNetanWaterMarkanThreedanRichMediaanXfaWidgetanRedact
ResultBoolean。当模块支持以对象级方式处理该子类型时为 True

说明

IsAnnotationSubtypeSupported 的对象级对应版本。那个调用报告子类型能否通过 CreateAnnotation 创建,而这个调用询问模块是否支持处理该子类型的对象 — 即支配注释对象 API 的查询,例如 AnnotationObjectInfoAnnotationObjectCount,它们读取并编辑绘制在注释内部的页面对象

答案因 PDFium 构建而异。先做测试可让应用程序提前启用或禁用对象级编辑功能,而不是稍后在真正调用时失败

当已加载的 PDFium 构建未导出原生查询(FPDFAnnot_IsObjectSupportedSubtype)时,结果为 False,使调用方保持保守

示例

if Pdf1.IsAnnotationObjectSubtypeSupported(anStamp) then
  BtnEditStampObjects.Enabled := True
else
  // 此 PDFium 构建不支持对象级的图章编辑
  BtnEditStampObjects.Enabled := False;

参见

IsAnnotationSubtypeSupported, AnnotationObjectInfo, AnnotationObjectCount, CreateAnnotation