All Products
Search
Document Center

Intelligent Media Management:Page setup

Last Updated:Oct 29, 2024

This topic describes the advanced operations for the page setup of a presentation document including the operations for page setup objects, page width, page scale, and page height.

Obtain the page setup object

  • Syntax

    Expression.ActivePresentation.PageSetup

    Expression: the document type application object.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Obtain the presentation object.
      const presentation = await app.ActivePresentation;
    
      // Obtain the page setup object.
      const pageSetup = await presentation.PageSetup;
    }

Obtain the page width

  • Syntax

    Expression.ActivePresentation.PageSetup.SlideWidth

    Expression: the document type application object.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Obtain the presentation object.
      const presentation = await app.ActivePresentation;
    
      // Obtain the page setup object.
      const pageSetup = await presentation.PageSetup;
     
      // Obtain the page width.
      const slideWidth = await pageSetup.SlideWidth;
      console.log(slideWidth);
    }

Obtain the page height

  • Syntax

    Expression.ActivePresentation.PageSetup.SlideHeight

    Expression: the document type application object.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Obtain the presentation object.
      const presentation = await app.ActivePresentation;
    
      // Obtain the page setup object.
      const pageSetup = await presentation.PageSetup;
     
      // Obtain the page height.
      const slideHeight = await pageSetup.SlideHeight;
      console.log(slideHeight);
    }

Obtain the page scale

  • Syntax

    Expression.ActivePresentation.PageSetup.SlideRatio

    Expression: the document type application object.

  • Return value

    Parameter

    Type

    Description

    Ratio

    number

    The page scale.

  • Example

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      // Obtain the presentation object.
      const presentation = await app.ActivePresentation;
    
      // Obtain the page setup object.
      const pageSetup = await presentation.PageSetup;
     
      // Obtain the page scale.
      const slideHeight = await pageSetup.SlideRatio;
      console.log(slideHeight);
    }