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
CreateSubmitFormAction

See Also Example
Collapse All

Creates an action for submitting PDF form fields.

Syntax

LONG CreateSubmitFormAction (
BSTR url,
VARIANT_BOOL sendEmptyFields,
TxPDFSubmitType submitType
)
Parameters
url
Form submiting destination.

sendEmptyFields
Specifies whether to send empty fields as well.

submitType
Data submit type.

Return value
Created action index.

Remarks

CreateSubmitFormAction is an Action category function that allows users to submit form fields values. A submit-form action transmits the names and values of selected PDF controls to a specified uniform resource locator (URL). TheĀ URL is usually the address of a World Wide Web server that processes the data and sends a response.

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.

Example

Submit form action example

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 := 'Submit';
PDF.PDFANNOTATION_OnMouseUp := PDF.CreateSubmitFormAction('http://127.0.0.1', true, stGet);

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 = "Submit";
PDF->PDFANNOTATION_OnMouseUp = PDF->CreateSubmitFormAction("http://127.0.0.1", true, TxPDFSubmitType.stGet);

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 = "Submit";
PDF.PDFANNOTATION_OnMouseUp = PDF.CreateSubmitFormAction("http://127.0.0.1", true, TxPDFSubmitType.stGet);

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 = "Submit"
PDF.PDFANNOTATION_OnMouseUp = PDF.CreateSubmitFormAction("http://127.0.0.1", true, 0)

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