CreateResetFormAction
IPDFDocument3 :: Actions

See Also Example
Collapse All

Creates an action for resetting PDF form fields.

Syntax

LONG CreateResetFormAction ()
Return value
Index of the created action.

Remarks

CreateResetFormAction allows users to reset form fields in a PDF document. Use AddControlToAction to associate edit fields with this action and reset the fields. A Reset Form action resets selected PDF controls to their default values. The default value is the value of the control at time the PDF document was created.

The return value is an action identifier in the document's actions collection and can be used in AddControlToAction, OpenDocumentAction, PDFANNOTATION_OnBeforeFormatting, PDFANNOTATION_OnChange, PDFANNOTATION_OnKeyPress, PDFANNOTATION_OnSetFocus, PDFANNOTATION_OnLostFocus, PDFANNOTATION_OnMouseDown, PDFANNOTATION_OnMouseUp, PDFANNOTATION_OnMouseEnter, PDFANNOTATION_OnMouseExit, PDFANNOTATION_OnOtherControlChanged, PDFPAGE_SetAction, PDFANNOTATION_Action, PDFOUTLINENODE_Action.

Equivalent in new interface: IPDFDocument4::CreateResetFormAction.

Example

Resetting PDF Form Fields

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.BeginDoc;

e1 := PDF.PDFPAGE_CreateControl_Edit('field1', 20, 20, 120, 32);
PDF.PDFANNOTATION_Text := 'some text';

e2 := PDF.PDFPAGE_CreateControl_Edit('field2', 140, 20, 240, 32);
PDF.PDFANNOTATION_Text := 'other text';

c1 := PDF.PDFPAGE_CreateControl_Checkbox('check1', 250, 20, 262, 32);

b1 := PDF.PDFPAGE_CreateControl_Button('but1', 20, 60, 80, 80);
PDF.PDFANNOTATION_Caption := 'Reset';
PDF.PDFANNOTATION_OnMouseUp := PDF.CreateResetFormAction();

PDF.EndDoc;
C/C++
[copy to clipboard]
// PDF object is supposed to be created
PDF->BeginDoc();

LONG e1 = PDF->PDFPAGE_CreateControl_Edit("field1", 20, 20, 120, 32);
PDF->PDFANNOTATION_Text = "some text";

LONG e2 = PDF->PDFPAGE_CreateControl_Edit("field2", 140, 20, 240, 32);
PDF->PDFANNOTATION_Text = "other text";

LONG c1 = PDF->PDFPAGE_CreateControl_Checkbox("check1", 250, 20, 262, 32);

LONG b1 = PDF->PDFPAGE_CreateControl_Button("but1", 20, 60, 80, 80);
PDF->PDFANNOTATION_Caption = "Reset";
PDF->PDFANNOTATION_OnMouseUp = PDF->CreateResetFormAction();

PDF->EndDoc();
C#
[copy to clipboard]
// PDF object is supposed to be created
PDF.BeginDoc();

long e1 = PDF.PDFPAGE_CreateControl_Edit("field1", 20, 20, 120, 32);
PDF.PDFANNOTATION_Text = "some text";

long e2 = PDF.PDFPAGE_CreateControl_Edit("field2", 140, 20, 240, 32);
PDF.PDFANNOTATION_Text = "other text";

long c1 = PDF.PDFPAGE_CreateControl_Checkbox("check1", 250, 20, 262, 32);

long b1 = PDF.PDFPAGE_CreateControl_Button("but1", 20, 60, 80, 80);
PDF.PDFANNOTATION_Caption = "Reset";
PDF.PDFANNOTATION_OnMouseUp = PDF.CreateResetFormAction();

PDF.EndDoc();
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
PDF.BeginDoc

e1 = PDF.PDFPAGE_CreateControl_Edit("field1", 20, 20, 120, 32)
PDF.PDFANNOTATION_Text = "some text"

e2 = PDF.PDFPAGE_CreateControl_Edit("field2", 140, 20, 240, 32)
PDF.PDFANNOTATION_Text = "other text"

c1 = PDF.PDFPAGE_CreateControl_Checkbox("check1", 250, 20, 262, 32)

b1 = PDF.PDFPAGE_CreateControl_Button("but1", 20, 60, 80, 80)
PDF.PDFANNOTATION_Caption = "Reset"
PDF.PDFANNOTATION_OnMouseUp = PDF.CreateResetFormAction()

PDF.EndDoc

See Also

Reference