function GetFocusableAnnotationSubtypes: TPdfAnnotationSubtypes;
| Result | TPdfAnnotationSubtypes。可聚焦子類型的動態陣列;清單已被清空時為空陣列 |
讀回表單填寫環境維護的聚焦清單 — 這份清單決定哪些註解可以取得鍵盤焦點,也因此決定 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;