AddLinkToImportData
Annotations and hotspot links, Form fields and AcroForms
Description
Adds a clickable hotspot rectangle to the selected page which triggers a PDF import-data action when activated. An import-data action populates the document's AcroForm fields from a Forms Data Format (FDF) file on disk. The action is defined in ISO 32000-1 §12.6.4.8, Table 198.
Typical use: a “Reload sample data” or “Reset to defaults” link in an interactive form, where the FDF file ships alongside the PDF and holds the canonical field values.
Use the SetAnnotBorderColor function to change the colour of the hotspot border.
Syntax
Delphi
function TPDFlib.AddLinkToImportData(Left, Top, Width, Height: Double; Const FileName: WideString; Options: Integer): Integer;DLL
int DLAddLinkToImportData(int InstanceID, double Left, double Top, double Width, double Height, wchar_t * FileName, 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 |
| FileName | The path to the FDF file from which the form fields will be populated. Backslashes are converted to forward-slashes per ISO 32000-1 §7.11.2.1 PDF-canonical path form. The file does not need to exist at PDF-creation time but must be present at viewing time for the action to succeed. |
| 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 / AddLinkToHideField. |
Remarks
NOT permitted in PDF/A because the action references an external resource. When the document is in PDF/A mode the function silently returns 0 and no annotation is added. PDF 1.4 or later is required.