Components for Developers
© 2000-2012, Two Pilots

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF-X Pilot History In the Lab

PDF Creator Pilot documentation

Download CHM version of this manual.
Annotations
PDFANNOTATION_Required

See Also Example
Collapse All

This property gets or sets the required status status for a control value that is part of a form.

Syntax

VARIANT_BOOL PDFANNOTATION_Required { get; set; }
Value
VARIANT_TRUE if the control's value is required, VARIANT_FALSE otherwise.

Remarks

If this property is set to VARIANT_TRUE, the control must have a value at the time it is exported by a submit-form action. (See CreateSubmitFormAction.) If the control doesn't contain a value, then the submit action is not executed.

Equivalent in new interface: IPDFDocument4::IsReaquiredControl.

Example

Creating a Form with a Required Field

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.BeginDoc;
PDF.PDFPAGE_CreateControl_Edit('ctrl1', 10, 10, 110, 23);
PDF.PDFANNOTATION_Text = 'Text1';
PDF.PDFANNOTATION_Required = false;
PDF.PDFPAGE_CreateControl_Edit('ctrl2', 10, 25, 110, 38);
PDF.PDFANNOTATION_Text := 'Text2';
PDF.PDFANNOTATION_Required := true;
PDF.PDFPAGE_CreateControl_Button('but1', 10, 60, 70, 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();
PDF.PDFPAGE_CreateControl_Edit("ctrl1", 10, 10, 110, 23);
PDF.PDFANNOTATION_Text = "Text1";
PDF.PDFANNOTATION_Required = FALSE;
PDF.PDFPAGE_CreateControl_Edit("ctrl2", 10, 25, 110, 38);
PDF.PDFANNOTATION_Text = "Text2";
PDF.PDFANNOTATION_Required = FALSE;
PDF.PDFPAGE_CreateControl_Button("but1", 10, 60, 70, 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();
PDF.PDFPAGE_CreateControl_Edit("ctrl1", 10, 10, 110, 23);
PDF.PDFANNOTATION_Text = "Text1";
PDF.PDFANNOTATION_Required = false;
PDF.PDFPAGE_CreateControl_Edit("ctrl2", 10, 25, 110, 38);
PDF.PDFANNOTATION_Text = "Text2";
PDF.PDFANNOTATION_Required = true;
PDF.PDFPAGE_CreateControl_Button("but1", 10, 60, 70, 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
PDF.PDFPAGE_CreateControl_Edit "ctrl1", 10, 10, 110, 23
PDF.PDFANNOTATION_Text = "Text1"
PDF.PDFANNOTATION_Required = False
PDF.PDFPAGE_CreateControl_Edit "ctrl2", 10, 25, 110, 38
PDF.PDFANNOTATION_Text = "Text2"
PDF.PDFANNOTATION_Required = True
PDF.PDFPAGE_CreateControl_Button("but1", 10, 60, 70, 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-X Pilot History In the Lab

 

 

PDF Library | Virtual Printer | Converters to PDF

Support | Blog | Forum | Contacts

© 2000-2012, Two Pilots