Sub

Updated at:

This topic describes the properties of the Sub object.

Sub.CurrentPageChange

You can configure a listener for the current page change event by using Sub.CurrentPageChange (only text documents and PDF documents are supported).

  • Syntax

    expression.Sub.CurrentPageChange=eventHandle

    expression: the document type application object.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Configure a listener for the current page change event.
      app.Sub.CurrentPageChange  = async (curryPage) => {
        console.log ('Current page:', curryPage);
      };
    }

Sub.ModelVisible

Important

Only JS-SDK V1.1.10 and later support this feature.

By using Sub.ModelVisible, you can configure the notification when modal dialog boxes appear or disappear.

  • Syntax

    expression.Sub.ModelVisible=eventHandle

    expression: the document type application object.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Configure the notification when modal dialog boxes appear or disappear.
      app.Sub.ModelVisible  = async (e) => {
        console.log ('Modal dialog', e);
      };
    }

Sub.OnBroadcast

Important

Only JS-SDK V1.1.13 and later support this feature.

You can receive global broadcasts by using Sub.OnBroadcast.

  • Syntax

    expression.Sub.OnBroadcast=eventHandle

    expression: the document type application object.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Receive global broadcasts.
      app.Sub.OnBroadcast  = async (e) => {
        console.log ('Receive global broadcast', e);
      };
    }