PDFium Delphi Component Docs

GetFocusableAnnotationSubtypes 方法

组件: TPdf  ·  单元: PDFium
返回表单填充环境当前视为可获得焦点的注释子类型

语法

function GetFocusableAnnotationSubtypes: TPdfAnnotationSubtypes;

ResultTPdfAnnotationSubtypes。可获得焦点的子类型的动态数组;列表被清空时为空

说明

读回表单填充环境维护的焦点列表 — 该列表决定哪些注释可以接收键盘焦点,因而也决定 FocusFormField 等导航调用依次经过的内容

读取需要两次原生往返:先取数量(FPDFAnnot_GetFocusableSubtypesCount),再取值(FPDFAnnot_GetFocusableSubtypes),每个值都被解码回 TPdfAnnotationSubtype。当数量为零时,结果是空数组而不是错误

该调用要求已加载文档和已初始化的表单填充环境;当表单未初始化时,会引发消息为 Form fill environment is not initialized 的 EPdfError。原生查询失败会引发 Cannot retrieve focusable annotation subtypes。使用 SetFocusableAnnotationSubtypes 更改列表

示例

var
  Subtypes: TPdfAnnotationSubtypes;
  Subtype: TPdfAnnotationSubtype;
begin
  Subtypes := Pdf1.GetFocusableAnnotationSubtypes;
  for Subtype in Subtypes do
    Memo1.Lines.Add(GetEnumName(TypeInfo(TPdfAnnotationSubtype),
      Ord(Subtype)));
end;

参见

SetFocusableAnnotationSubtypes, FocusFormField, FocusedFormFieldIndex, FormField