Namespace: EventList

WebPDF. EventList

Enumerate the events of reader.

Members


<static> ANNOT_ADDED

Triggered when an annotation is added.

Example
WebPDF. ViewerInstance.on(WebPDF.EventList. ANNOT_ADDED, function(event, data){
     alert('pageIndex:' + data.pageIndex + ', annot:' + data.annot + ', annotsArr:' + data.annotsArr +
     ', pageAnnotUnload:' + data.pageAnnotUnload + ', isShow:' + data.isShow + ';' +
'Please refer to the code at webapp/scripts/reader/control/pc(mobile)/commentlist.js');
});

<static> ANNOT_DELETED

Triggered when an annotation is deleted.

Example
WebPDF. ViewerInstance.on(WebPDF.EventList. ANNOT_DELETED, function(event, data){
     alert('annotName:' + data.annotName + ', pageIndex:' + data.pageIndex + ';' +
'Please refer to the code at webapp/scripts/reader/control/pc(mobile)/commentlist.js');
});

<static> ANNOT_SELECTED

Triggered when an annotation has been selected.

Example
WebPDF. ViewerInstance.on(WebPDF.EventList. ANNOT_SELECTED, function(event, data){
      alert('annotName:' + data.annotName + ', pageIndex:'+ data.pageIndex +
'Please refer to the code at webapp/scripts/reader/control/pc(mobile)/commentlist.js');
});

<static> ANNOT_UPDATED

Triggered when an annotation is updated.

Example
WebPDF. ViewerInstance.on(WebPDF.EventList. ANNOT_UPDATED, function(event, data){
     alert('annot:' + data.annot + ', pageIndex:' + data.pageIndex + ';' +
'Please refer to the code at webapp/scripts/reader/control/pc(mobile)/commentlist.js');
});

<static> ANNOTS_VISIBILITY_CHANGED

Triggered when annotation visibility changes. (Show/hide annotations)

Example
WebPDF. ViewerInstance.on(WebPDF.EventList.ANNOTS_VISIBILITY_CHANGED, function(event, data){
      alert('isShow:' + data.isShow + 'pageAnnotUnload:' + data.pageAnnotUnload + ';' +
'Please refer to the code at webapp/scripts/reader/control/pc(mobile)/commentlist.js');
});

<static> APP_READY

A jQuery event bound on the app instance, triggered when the reader is ready, with the premise that a document has been loaded.

Example
WebPDF. ViewerInstance.on(WebPDF.EventList.APP_READY,function(event, data){
    alert('App ready.');
 })

<static> DOC_MODIFY_STATE_CHANGED

Triggered when modification state of current document is changed.

Example
WebPDF. ViewerInstance.on(WebPDF.EventList.DOC_MODIFY_STATE_CHANGED,function(event,isModified){
     alert('Is modified:' + isModified);
 })

<static> DOCUMENT_CLOSED

Triggered when the file is closed.

Example
WebPDF. ViewerInstance.on(WebPDF.EventList.DOCUMENT_CLOSED, function(event, data){
		alert('......');
});

<static> DOCUMENT_LOADED

Triggered when the document has been loaded.

Example
WebPDF. ViewerInstance.on(WebPDF.EventList.DOCUMENT_LOADED,function(event, data){
     alert('plugins' + data.plugins, 'readOnly' + data.readOnly, 'disablePrint'+ data.disablePrint,'disableDownload' + data.disableDownload);
     plugins {interger} which plug-in module will be load. Currently supports the following two:
                     WebPDF.Config.Plugins.flag.FindTool
                     WebPDF.Config.Plugins.flag.Print
                     WebPDF.Config.Plugins.flag.Comments
                     WebPDF.Config.Plugins.flag.Thumbnail
                     WebPDF.Config.Plugins.flag.TextSelection
                     WebPDF.Config.Plugins.flag.Form
                     WebPDF.Config.Plugins.flag.Bookmark
                     WebPDF.Config.Plugins.flag.Menu
                     WebPDF.Config.Plugins.flag.Signature
                     WebPDF.Config.Plugins.flag.InkSign
     readOnly {boolean} The boolean value indicates whether the reader is readonly or not.
     disablePrint {boolean} The boolean value indicate whether to disable print function or not.
     disableDownload {boolean} The boolean value indicates whether to disable export current PDF file to local machine or not.
 })

<static> DOCUMENT_PRE_CLOSED

Triggered before the file is closed.

Example
WebPDF. ViewerInstance.on(WebPDF.EventList.DOCUMENT_PRE_CLOSED, function(event, data){
     alert('......');
});

<static> DOCUMENT_PRE_OPEN

Triggered when called openFileByUri or openFileByStream

Example
WebPDF. ViewerInstance.on(WebPDF.EventList.DOCUMENT_PRE_OPEN, function(event, data){
     console.log('Another document will be opened, you can do some actions like saving current document!');
})

<static> DOCUMENT_PRE_SAVED

Triggered before the file is saved.

Example
WebPDF. ViewerInstance.on(WebPDF.EventList.DOCUMENT_PRE_SAVED, function(event, data){
     alert('......');
});

<static> DOCUMENT_PRINTED

Triggered after the file is printed.

Example
WebPDF. ViewerInstance.on(WebPDF.EventList.DOCUMENT_PRINTED, function(event, data){
     alert('......');
});

<static> DOCUMENT_PROPERTIES_CHANGED

Triggered when the Document's properties are updated

Example
WebPDF. ViewerInstance.on(WebPDF.EventList.DOCUMENT_PROPERTIES_CHANGED, function(event, data){
 	var newMetadata = data.metadata;
		var docProperties = WebPDF.Tool.getReaderApp().getPDFDoc().getDocProperties();
     for(var key in newMetadata) {
			console.log(docProperties.getPropertyValue(key));
		}
})

<static> DOCUMENT_SAVED

Triggered when the file is saved.

Example
WebPDF. ViewerInstance.on(WebPDF.EventList.DOCUMENT_CLOSED, function(event, data){
     alert('......');
});

<static> DOCVIEW_PAGE_CHANGED

Triggered when the current page index is changed.

Example
WebPDF. ViewerInstance.on(WebPDF.EventList.DOCVIEW_PAGE_CHANGED,function(event,data){
     alert('Old page index:' + data.oldIndex + ', New page index:' + data.curIndex);
 })

<static> DOCVIEW_PRE_RESIZE

Triggered before the size of the viewing area is changed.

Example
WebPDF. ViewerInstance.on(WebPDF.EventList.DOCVIEW_PRE_RESIZE,function(event, data){
     alert('doc view pre resize.');
 })

<static> DOCVIEW_RESIZE

Triggered when the size of the viewing area is changed.

Example
WebPDF. ViewerInstance.on(WebPDF.EventList.DOCVIEW_RESIZE,function(event, data){
     alert('doc view resized.');
 })

<static> DOCVIEW_ROTATE_CHANGED

Triggered when the rotate angle of the viewer is changed.

Example
WebPDF. ViewerInstance.on(WebPDF.EventList.DOCVIEW_ROTATE_CHANGED,function(event,data){
     alert('Old rotate:' + data.oldRotate + ', New rotate:' + data.newRotate);
 })

<static> DOCVIEW_SCROLL

Triggered when the user scrolls the page view.

Example
WebPDF. ViewerInstance.on(WebPDF.EventList.docViewScroll,function(event,data){
     alert('doc view scrolls');
 })

<static> DOCVIEW_ZOOM_CHANGED

Triggered when the zoom level of viewer is changed.

Example
WebPDF. ViewerInstance.on(WebPDF.EventList.DOCVIEW_ZOOM_CHANGED,function(event,data){
     alert('Old scale:' + data.oldScale + ', New scale:' + data.newScale);
 })

<static> FORM_LOADED

Triggered after form data is loaded.

Example
WebPDF. ViewerInstance.on(WebPDF.EventList.FORM_LOADED,function(event, data){
     alert('form data loaded');
 })

<static> LAYOUTSHOWMODE_CHANGED

Triggered when the current page layout show mode has been changed.

Example
WebPDF. ViewerInstance.on(WebPDF.EventList.LAYOUTSHOWMODE_CHANGED, function(event,data){
     alert('name of old layout show mode:' + data.oldlayoutShowMode + ', name of new layout show mode:' + data.newLayoutShowMode);
 })

<static> MAINFRAME_RESIZE

Triggered when the size of the mainframe area is changed.


<static> MASK_MODIFY_STATE_CHANGED

Triggered when modification state of current document amsk is changed.

Example
WebPDF. ViewerInstance.on(WebPDF.EventList.MASK_MODIFY_STATE_CHANGED,function(event,isModified){
     alert('Is modified:' + isModified);
 })

<static> PAGE_INVISIBLE

Triggered when the page becomes invisible.

Example
WebPDF. ViewerInstance.on(WebPDF.EventList.PAGE_INVISIBLE, function(event, data){
    console.log("invisible pages:" + data.pages);
 }

<static> PAGE_SHOW_COMPLETE

Triggered when the background of the page has been displayed.

Example
WebPDF. ViewerInstance.on(WebPDF.EventList.PAGE_SHOW_COMPLETE,function(event, data){
     alert('Current page index:' + data.pageView.getPageIndex());
 })

<static> PAGE_SHOW_LIMIT

Triggered when the page show limit is reached.

Example
WebPDF. ViewerInstance.on(WebPDF.EventList.PAGE_SHOW_LIMIT, function(event, data){
      alert('pageIndex:'+ data.pageIndex);
});

<static> PAGE_TEXT_LOADED

Triggered when the pageText is loaded.

Example
WebPDF. ViewerInstance.on(WebPDF.EventList.PAGE_TEXT_LOADED, function(event, data){
     alert('......');
});

<static> PAGE_VISIBLE

Triggered when user scrolls and the page is visible.

Example
WebPDF. ViewerInstance.on(WebPDF.EventList.PAGE_VISIBLE, function(event, data){
    console.log("visible pages:" + data.pages);
    console.log(data.contentPanelWidth);
    console.log(data.contentPaneHeight);
    console.log(data.contentPanelOffset);
 }

<static> PAGES_PREPARE_PRINT

Triggered when print pages through RESTFUL API

Example
WebPDF. ViewerInstance.on(WebPDF.EventList.PAGES_PREPARE_PRINT, function(event, data){
       alert(null,null,"printRange:" + data.printRange + ",can print page count:" + data.remainingPrintCount + "");
  });
 

<static> PPO_PAGE_SELECT_CHANGE

Triggered when the selected page changes in the page organizer.

Example
WebPDF. ViewerInstance.on(WebPDF.EventList.PPO_PAGE_SELECT_CHANGE, function(event, data){
      alert('isSelect:'+ data.isSelect);
});

<static> PPO_SAVE_CHANGES

Triggered when user confirmed to save changes in the organizer page.

Example
WebPDF.ViewerInstance.on(WebPDF.EventList.PPO_SAVE_CHANGES, function(event, data) {
 // data.fileid,
 // data.filename,
 // data.sourcefrom,
 // data.bufferarray
})

<static> TOOL_CHANGED

Triggered when the current tool has been changed.

Example
WebPDF. ViewerInstance.on(WebPDF.EventList.TOOL_CHANGED,function(event,data){
     alert('name of old tool:' + data.oldToolName + ', name of new tool:' + data.newToolName);
 })