Page setup

更新时间:
复制 MD 格式

This topic describes advanced APIs for configuring page settings in a presentation file, including the page setup object, page width, page ratio, and page height.

Page setup object

  • Syntax

    Expression.ActivePresentation.PageSetup

    Expression: A variable that represents the application object for the document type.

  • Example

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

Page width

  • Syntax

    Expression.ActivePresentation.PageSetup.SlideWidth

    Expression: Application object of the document type

  • Example

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

Page height

  • Syntax

    Expression.ActivePresentation.PageSetup.SlideHeight

    Expression: document type and application object

  • Example

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

Page ratio

  • Syntax

    Expression.ActivePresentation.PageSetup.SlideRatio

    Expression: A variable that represents the application object for the document type.

  • Return value

    Property

    Data type

    Description

    Ratio

    number

    The page ratio.

  • Example

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