procedure SetFocusableAnnotationSubtypes(const Subtypes: array of TPdfAnnotationSubtype);
| Subtypes | Open array of TPdfAnnotationSubtype. The complete replacement list; annotations of any subtype not in the array cannot receive focus. An empty array clears the list |
The form fill environment keeps a list of annotation subtypes eligible for focus. By default that list covers the form widgets, which is what keyboard navigation such as FocusFormField moves through. This call replaces the whole list through the native interface (FPDFAnnot_SetFocusableSubtypes), for example to let a viewer give focus to free-text or other markup annotations as well
Each TPdfAnnotationSubtype value is encoded to its native value before the call. Passing an empty array forwards a nil pointer with count zero and clears the list, leaving nothing focusable until a new list is set
The call requires a loaded document and an initialized form fill environment; when forms are not initialized it raises an EPdfError with the message Form fill environment is not initialized. A failing native call raises Cannot set focusable annotation subtypes. Read the current list back with GetFocusableAnnotationSubtypes
begin
Pdf1.FileName := 'form.pdf';
Pdf1.Active := True;
// widgets stay focusable, free-text notes join them
Pdf1.SetFocusableAnnotationSubtypes([anWidget, anFreeText]);
end;