Components for Developers
© 2000-2008, Two Pilots

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF Add-on History In the Lab

PDF Creator Pilot documentation

Download CHM version of this manual.
Actions
CreateResetFormAction

See Also Example
Collapse All

Creates an action for resetting PDF form fields.

Syntax

LONG CreateResetFormAction ()
Return value
Created action index.

Remarks

CreateResetFormAction is an Action category function that 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 of the PDF document creation.

The return value is an action identifier in 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.

Analogue 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

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF Add-on History In the Lab

 

 

PDF Library | Virtual Printer | Converters to PDF

Support | Blog | Forum | Contacts

© 2000-2008, Two Pilots