Events

The following events can trigger any valid Actions.

Page Reader Events

The following events can be triggered for each page in a PDF.

The example below demonstrates how to trigger a JavaScript alert window when a specific page is opened.

Page page = new Page();
JavaScriptAction action = new JavaScriptAction("app.alert(\"Welcome !!\")");
page.ReaderEvents.Open = action;       
Dim page As Page = New Page()
Dim action As JavaScriptAction = New JavaScriptAction("app.alert('Welcome !!')")
page.ReaderEvents.Open = action 

Document Reader Events

The following events can be triggered at the document level.

The example below demonstrates how to trigger a JavaScript alert window when saving a PDF.

Document document = new Document();
JavaScriptAction action = new JavaScriptAction("app.alert(\"Hello your text Saved!!\")");
document.ReaderEvents.WillSave = action;       
Dim document As Document = New Document()
Dim action As JavaScriptAction = New JavaScriptAction("app.alert('Hello your text Saved!!')")
document.ReaderEvents.WillSave = action 

Form Field Reader Events

The following events can be triggered for each form field.

The example below demonstrates how to trigger a JavaScript alert window when a text field receives focus.

TextField textField = new TextField("Text1", 0, 0, 100, 15); 
JavaScriptAction action = new JavaScriptAction("app.alert(\"Welcome !!\")");
textField.ReaderEvents.OnFocus = action;        
Dim textField As TextField = New TextField("Text1", 0, 0, 100, 15)
Dim action As JavaScriptAction = New JavaScriptAction("app.alert('Welcome !!')")
textField.ReaderEvents.OnFocus = action

In this topic