文档

页面设置

更新时间:

本文介绍演示文件页面设置相关高级接口,包含页面设置对象、页面宽度、页面比例和页面高度。

页面设置对象

  • 语法

    表达式.ActivePresentation.PageSetup

    表达式:文档类型应用对象

  • 示例

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      //演示文稿对象
      const presentation = await app.ActivePresentation;
    
      //页面设置对象
      const pageSetup = await presentation.PageSetup;
    }

页面宽度

  • 语法

    表达式.ActivePresentation.PageSetup.SlideWidth

    表达式:文档类型应用对象

  • 示例

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      //演示文稿对象
      const presentation = await app.ActivePresentation;
    
      //页面设置对象
      const pageSetup = await presentation.PageSetup;
     
      //获取宽度
      const slideWidth = await pageSetup.SlideWidth;
      console.log(slideWidth);
    }

页面高度

  • 语法

    表达式.ActivePresentation.PageSetup.SlideHeight

    表达式:文档类型应用对象

  • 示例

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      //演示文稿对象
      const presentation = await app.ActivePresentation;
    
      //页面设置对象
      const pageSetup = await presentation.PageSetup;
     
      //获取高度
      const slideHeight = await pageSetup.SlideHeight;
      console.log(slideHeight);
    }

页面比例

  • 语法

    表达式.ActivePresentation.PageSetup.SlideRatio

    表达式:文档类型应用对象

  • 返回值

    属性

    数据类型

    描述

    Ratio

    number

    页面比例。

  • 示例

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      //演示文稿对象
      const presentation = await app.ActivePresentation;
    
      //页面设置对象
      const pageSetup = await presentation.PageSetup;
     
      //获取比例
      const slideHeight = await pageSetup.SlideRatio;
      console.log(slideHeight);
    }

  • 本页导读 (1)
文档反馈