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 OnControlChange { get; set; } |
Value
Number of the action
Remarks
Example
Handling OnAnnotChange
Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
a1 := PDF.CreateJavascriptAction('this.getField("edit1").value = "edit2 is changed!";');
a2 := PDF.CreateJavascriptAction('this.getField("edit2").value = "edit1 is changed!";');
PDF.AddEditBox(10, 10, 100, 24, 'edit1');
PDF.AnnotUnicodeText := 'Edit1';
PDF.OnAnnotChange := a2;
PDF.AddEditBox(10, 30, 100, 44, "edit2');
PDF.AnnotUnicodeText := 'Edit2';
PDF.OnAnnotChange := a1;
PDF.SaveToFile('test.pdf', true);
C/C++
[copy to clipboard]
// PDF object is supposed to be created
long a1 = PDF->CreateJavascriptAction("this.getField('edit1').value = 'edit2 is changed!';");
long a2 = PDF->CreateJavascriptAction("this.getField('edit2').value = 'edit1 is changed!';");
PDF->AddEditBox(10, 10, 100, 24, "edit1");
PDF->AnnotUnicodeText = L"Edit1";
PDF->OnControlChange = a2;
PDF->AddEditBox(10, 30, 100, 44, "edit2");
PDF->AnnotUnicodeText = L"Edit2";
PDF->OnControlChange = a1;
PDF->SaveToFile("test.pdf", true);
C#
[copy to clipboard]
// PDF object is supposed to be created
long a1 = PDF.CreateJavascriptAction("this.getField('edit1').value = 'edit2 is changed!';");
long a2 = PDF.CreateJavascriptAction("this.getField('edit2').value = 'edit1 is changed!';");
PDF.AddEditBox(10, 10, 100, 24, "edit1");
PDF.AnnotUnicodeText = "Edit1";
PDF.OnControlChange = a2;
PDF.AddEditBox(10, 30, 100, 44, "edit2");
PDF.AnnotUnicodeText = "Edit2";
PDF.OnControlChange = a1;
PDF.SaveToFile("test.pdf", true);
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
a1 = PDF.CreateJavascriptAction("this.getField('edit1').value = 'edit2 is changed!';")
a2 = PDF.CreateJavascriptAction("this.getField('edit2').value = 'edit1 is changed!';")
PDF.AddEditBox 10, 10, 100, 24, "edit1"
PDF.AnnotUnicodeText = "Edit1"
PDF.OnControlChange = a2
PDF.AddEditBox 10, 30, 100, 44, "edit2"
PDF.AnnotUnicodeText = "Edit2"
PDF.OnControlChange = a1
PDF.SaveToFile "test.pdf", true
See Also
Reference


