Scale the document window and view

更新时间:
复制 MD 格式

This topic describes how to use the advanced operations to scale the document window and set autofit for the view when you use a PDF document.

Obtain and set the scale of a document window

  • Syntax

    Expression. ActivePDF.Zoom

    Expression: the document type application object.

  • Return value

    Returns a number that represents the scale of the document window.

  • Example

    async function example() {
      await instance.ready();
      
      const app = instance.Application;
    
      // Obtain the scale of the document window.
      const result = await app.ActivePDF.Zoom;
      console.log(result);
    
      // Set the scale of the document window.
      app.ActivePDF.Zoom = 66;
    }

Set autofit for the view

Set whether to enable autofit for the view to fit the document window after the document window is resized.

  • Syntax

    Expression.ActivePDF.ZoomToFit = Number

    Expression: the document type application object.

    Valid values of Number:

    • -1: enables autofit for the view.

    • 0: does not enable autofit for the view.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Do not enable autofit for the view.
      app.ActivePDF.ZoomToFit = 0;
    }