PDF Creator Pilot documentation |
Download CHM version of this manual. |
|
![]() ![]() Collapse AllGets or sets a JavaScript action to be performed when the value of another field changes, to recalculate the value of this field.
|
| LONG PDFANNOTATION_OnOtherControlChanged { get; set; } |
Value
Action index.
Remarks
Action index can be retrieved from any action creating function likeĀ CreateJavaScriptAction.
Analogue in new interface: IPDFDocument4::OnControlOtherChanged.
Example
OnOtherControlChanged example
Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.BeginDoc;
a1 := PDF.CreateJavascriptAction('this.getField("edit2").value = this.getField("edit1").value * this.getField("edit1").value;');
PDF.PDFPAGE_CreateControl_Edit('edit1', 10, 10, 90, 24);
PDF.PDFANNOTATION_Text := '3';
PDF.PDFPAGE_CreateControl_Edit('edit2', 10, 30, 90, 44);
PDF.PDFANNOTATION_Text := '9';
PDF.PDFANNOTATION_OnOtherControlChanged := a1;
{ Now the square of the edit1 will be calculated }
{ in the edit2 when edit1 is changed. }
PDF.EndDoc;
C/C++
[copy to clipboard]
// PDF object is supposed to be created
PDF->BeginDoc();
LONG a1 = PDF->CreateJavascriptAction("this.getField('edit2').value = this.getField('edit1').value * this.getField('edit1').value;");
PDF->PDFPAGE_CreateControl_Edit("edit1", 10, 10, 90, 24);
PDF->PDFANNOTATION_Text = "3";
PDF->PDFPAGE_CreateControl_Edit("edit2", 10, 30, 90, 44);
PDF->PDFANNOTATION_Text = "9";
PDF->PDFANNOTATION_OnOtherControlChanged = a1;
// Now the square of the edit1 will be calculated
// in the edit2 when edit1 is changed.
PDF->EndDoc();
C#
[copy to clipboard]
// PDF object is supposed to be created
PDF.BeginDoc();
long a1 = PDF.CreateJavascriptAction("this.getField('edit2').value = this.getField('edit1').value * this.getField('edit1').value;");
PDF.PDFPAGE_CreateControl_Edit("edit1", 10, 10, 90, 24);
PDF.PDFANNOTATION_Text = "3";
PDF.PDFPAGE_CreateControl_Edit("edit2", 10, 30, 90, 44);
PDF.PDFANNOTATION_Text = "9";
PDF.PDFANNOTATION_OnOtherControlChanged = a1;
// Now the square of the edit1 will be calculated
// in the edit2 when edit1 is changed.
PDF.EndDoc();
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
PDF.BeginDoc
a1 = PDF.CreateJavascriptAction("this.getField('edit2').value = this.getField('edit1').value * this.getField('edit1').value;")
PDF.PDFPAGE_CreateControl_Edit "edit1", 10, 10, 90, 24
PDF.PDFANNOTATION_Text = "3"
PDF.PDFPAGE_CreateControl_Edit "edit2", 10, 30, 90, 44
PDF.PDFANNOTATION_Text = "9"
PDF.PDFANNOTATION_OnOtherControlChanged = a1
' Now the square of the edit1 will be calculated
' in the edit2 when edit1 is changed.
PDF.EndDoc
See Also


