AddLinkToResetForm

Annotations and hotspot links, Form fields and AcroForms

Description

Adds a clickable hotspot rectangle to the selected page which triggers a PDF reset-form action when activated. A reset-form action restores AcroForm fields to their default values without requiring JavaScript

Use FieldNames to restrict the fields affected by the reset action. Leave FieldNames empty to let the viewer reset all applicable fields

Use the SetAnnotBorderColor function to change the color of the hotspot border

Syntax

Delphi

Function TPDFlib.AddLinkToResetForm(Left, Top, Width, Height: Double; Const FieldNames: WideString; Flags, Options: Integer): Integer;

DLL

int DLAddLinkToResetForm(int InstanceID, double Left, double Top, double Width, double Height, const wchar_t * FieldNames, int Flags, int Options);

Parameters

LeftThe horizontal co-ordinate of the left edge of the hotspot rectangle
TopThe vertical co-ordinate of the top edge of the hotspot rectangle
WidthThe width of the hotspot rectangle
HeightThe height of the hotspot rectangle
FieldNamesOptional list of fully-qualified AcroForm field names separated by commas, semicolons, or line breaks. Leading and trailing whitespace around each name is trimmed
FlagsPDF reset-form action flags written to the action /Flags entry. Pass 0 for the default behavior. Standard viewers use the flag bits together with /Fields to decide whether the list is inclusive or exclusive
OptionsBitmask 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

Return values

0The action was not added because the document is in PDF/A mode or the rectangle is invalid
1The link annotation and reset-form action were added

Remarks

PDF/A mode blocks this action because interactive form actions are not suitable for archival conformance. The function requires PDF 1.2 or later