Handling OnAnnotKeyPress
Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
a1 := PDF.CreateJavascriptAction('this.getField("edit2").value = event.change;');
PDF.AddEditBox(10, 10, 60, 24, 'edit1');
PDF.AnnotUnicodeText := 'edit me';
PDF.OnControlKeyPress := a1;
PDF.AddEditBox(10, 30, 60, 44, 'edit2');
PDF.SaveToFile('test.pdf', true);
C/C++
[copy to clipboard]
// PDF object is supposed to be created
long a1 = PDF->CreateJavascriptAction("this.getField('edit2').value = event.change;");
PDF->AddEditBox(10, 10, 60, 24, "edit1");
PDF->AnnotUnicodeText = L"edit me";
PDF->OnControlKeyPress = a1;
PDF->AddEditBox(10, 30, 60, 44, "edit2");
PDF->SaveToFile("test.pdf", true);
// PDF object is supposed to be created
long a1 = PDF.CreateJavascriptAction("this.getField('edit2').value = event.change;");
PDF.AddEditBox(10, 10, 60, 24, "edit1");
PDF.AnnotUnicodeText = "edit me";
PDF.OnControlKeyPress = a1;
PDF.AddEditBox(10, 30, 60, 44, "edit2");
PDF.SaveToFile("test.pdf", true);
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
a1 = PDF.CreateJavascriptAction("this.getField('edit2').value = event.change;")
PDF.AddEditBox 10, 10, 60, 24, "edit1"
PDF.AnnotUnicodeText = "edit me"
PDF.OnControlKeyPress = a1
PDF.AddEditBox 10, 30, 60, 44, "edit2"
PDF.SaveToFile "test.pdf", true