Error processing SSI file
LEADTOOLS Leadtools.Documents.UI (Leadtools.Documents.UI assembly)

Operation Event

Show in webframe
Example 
Occurs when an operation is invoked inside this document viewer.
Syntax
add_operation(function(sender, e))
operation.add(function(sender, e))
remove_operation(function(sender, e))
operation.remove(function(sender, e))
    

The Operation event occurs anytime the document viewer is performing an operation. Such as when rendering the place holder of a page on the View, when a new annotation object is added, and so forth.

Each Operation event fires twice, first with the value of DocumentViewerOperationEventArgs.IsPostOperation set to false to indicate that the operation is about to happen. Then with DocumentViewerOperationEventArgs.IsPostOperation set to true to indicate that the operation is completed.

The operation type is stored in Operation. When IsPostOperation is false, some operations allow the user to change the behavior or abort the operation.

Refer to Document Viewer Operations for a detailed list of all document viewer operations.

Example

Start with the example created in DocumentViewer, remove all the code in the Example function and add the code below.

When the user clicks the example button, we will intercept when the user clicks on a link in the page and show a message box.

// Disable the example button, this should only run once
$("#exampleButton").prop("disabled", true);
this._documentViewer.operation.add(function(sender, e) {
   if (e.operation == lt.Documents.UI.DocumentViewerOperation.runLink && !e.isPostOperation) {
      var link = e.data1;
      alert("Linked at specified location clicked and ignored: " + link.bounds.x + "," + link.bounds.y + "," + link.bounds.width + "," + link.bounds.bottom);
      e.abort = true;
   }
});
Event Data
Parameter Type Description
sender 'var' The source of the event.
e DocumentViewerOperationEventArgs The event data.
See Also

Reference

DocumentViewer Object
DocumentViewer Members
Document Viewer Commands

Error processing SSI file
  Leadtools.Documents.UI requires a Document or Medical toolkit license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features