AddLinkToHideField
Annotations and hotspot links, Form fields and AcroForms
Description
Adds a clickable hotspot rectangle to the selected page which triggers a PDF hide action when activated. A hide action toggles the visibility of one or more AcroForm fields, allowing dynamic show/hide behaviour without JavaScript. The action is defined in ISO 32000-1 §12.6.4.10, Table 196.
Typical use: a “Show details” / “Hide details” link in a form layout, or mutually-exclusive field groups where clicking one link hides one group and shows another (combine two AddLinkToHideField calls with opposite HideFlag values).
Use the SetAnnotBorderColor function to change the color of the hotspot border.
Syntax
Delphi
function TPDFlib.AddLinkToHideField(Left, Top, Width, Height: Double; Const FieldNames: WideString; HideFlag: Integer; Options: Integer): Integer;DLL
int DLAddLinkToHideField(int InstanceID, double Left, double Top, double Width, double Height, wchar_t * FieldNames, int HideFlag, int Options);Parameters
| Left | The horizontal co-ordinate of the left edge of the hotspot rectangle |
|---|---|
| Top | The vertical co-ordinate of the top edge of the hotspot rectangle |
| Width | The width of the hotspot rectangle |
| Height | The height of the hotspot rectangle |
| FieldNames | One or more fully-qualified AcroForm field names, separated by commas, semicolons, or line breaks. Leading and trailing whitespace around each name is trimmed. A single name emits /T as a text string; two or more emit /T as an array of text strings. |
| HideFlag | Selects the visibility direction. A non-zero value hides the listed fields (/H true). Zero shows them (/H false). |
| Options | Bitmask controlling the link appearance. Bit 0 (value 1): draw a border around the hotspot rectangle. Bits 1–3 select the click highlight mode (2 = Invert, 4 = Outline, 8 = Push); when no highlight bit is set, Invert is used as the default. Same convention as AddLinkToWeb / AddLinkToNamedAction. |
Remarks
The annotation is PDF/A-compatible because no external resource is referenced. PDF 1.2 or later is required.