PDF Creator Pilot documentation |
Download CHM version of this manual. |
|
![]() ![]() Collapse AllThis property gets or sets a JavaScript action to be performed when the value of another field changes, thus recalculating the value of the current field.
|
| LONG OnControlOtherChanged { get; set; } |
Value
Number of the action
Remarks
Example
Handling OnAnnotOtherControlChanged
Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
a := PDF.CreateJavascriptAction('this.getField("edit2").value = this.getField("edit1").value * this.getField("edit1").value;');
PDF.AddEditBox(10, 10, 90, 24, 'edit1');
PDF.AnnotUnicodeText := '3';
PDF.AddEditBox(10, 30, 90, 44, 'edit2');
PDF.AnnotUnicodeText := '9';
PDF.OnControlOtherControl := a;
{ Now the square of the edit1 will be calculated }
{ in the edit2 when edit1 is changed. }
PDF.SaveToFile('test.pdf', true);
C/C++
[copy to clipboard]
// PDF object is supposed to be created
long a = PDF->CreateJavascriptAction("this.getField('edit2').value = this.getField('edit1').value * this.getField('edit1').value;");
PDF->AddEditBox(10, 10, 90, 24, "edit1");
PDF->AnnotUnicodeText = L"3";
PDF->AddEditBox(10, 30, 90, 44, "edit2");
PDF->AnnotUnicodeText = L"9";
PDF->OnControlOtherControl = a;
// Now the square of the edit1 will be calculated
// in the edit2 when edit1 is changed.
PDF->SaveToFile("test.pdf", true);
C#
[copy to clipboard]
// PDF object is supposed to be created
long a = PDF.CreateJavascriptAction("this.getField('edit2').value = this.getField('edit1').value * this.getField('edit1').value;");
PDF.AddEditBox(10, 10, 90, 24, "edit1");
PDF.AnnotUnicodeText = "3";
PDF.AddEditBox(10, 30, 90, 44, "edit2");
PDF.AnnotUnicodeText = "9";
PDF.OnControlOtherControl = a;
// Now the square of the edit1 will be calculated
// in the edit2 when edit1 is changed.
PDF.SaveToFile("test.pdf", true);
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
a = PDF.CreateJavascriptAction("this.getField('edit2').value = this.getField('edit1').value * this.getField('edit1').value;")
PDF.AddEditBox 10, 10, 90, 24, "edit1"
PDF.AnnotUnicodeText = "3"
PDF.AddEditBox 10, 30, 90, 44, "edit2"
PDF.AnnotUnicodeText = "9"
PDF.OnControlOtherControl = a
' Now the square of the edit1 will be calculated
' in the edit2 when edit1 is changed.
PDF.SaveToFile "test.pdf", true
See Also
Reference


