文档配置参数

... 2023-8-11 大约 2 分钟

# 文档配置参数

# CommonOptions

通过配置选项 commonOptions,可以配置页面的通用选项。 配置项说明

配置项 类型 说明
isShowTitleBar boolean 是否展示标题栏
isShowToolBar boolean 是否展示工具栏

代码演示:

const instance = TencentDocsSDK.init({
      appId: 'xxx',
      fileId: 'xxx',
      commonOptions: {
        // 展示标题栏
        isShowTitleBar: true,
        // 展示工具栏
        isShowToolBar: true,
      }
    });
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10

# WordOptions

通过配置选项 wordOptions,可以配置文字文档页面。 配置项说明

配置项 类型 说明
isShowStatusBar boolean 是否展示 pc 端底部状态栏
isShowMobileBottomBar boolean 是否展示移动端的底部胶囊bar
isShowOutline boolean 是否展示目录

代码演示:

const instance = TencentDocsSDK.init({
      officeType: 'docx',
      appId: 'xxx',
      fileId: 'xxx',
      wordOptions: {
        // 展示移动端的底部胶囊bar
        isShowMobileBottomBar: true,
        // 展示 pc 端底部状态栏
        isShowStatusBar: true,
        // 展示目录
        isShowOutline: false
      }
    });
1
2
3
4
5
6
7
8
9
10
11
12
13
1
2
3
4
5
6
7
8
9
10
11
12
13

# ExcelOptions

通过配置选项 excelOptions,可以配置表格文档页面。 配置项说明

配置项 类型 说明
isShowStatusBar boolean 是否展示 pc 端底部状态栏
isShowMobileBottomBar boolean 是否展示移动端的底部胶囊bar

代码演示:

const instance = TencentDocsSDK.init({
      officeType: 'xlsx',
      appId: 'xxx',
      fileId: 'xxx',
      excelOptions: {
        // 展示 pc 端底部状态栏
        isShowStatusBar: true,
        // 展示移动端的底部胶囊bar
        isShowMobileBottomBar: true,
      }
    });
1
2
3
4
5
6
7
8
9
10
11
1
2
3
4
5
6
7
8
9
10
11

# PptOptions

通过配置选项 pptOptions,可以配置演示文档页面。 配置项说明

配置项 类型 说明
isShowStatusBar boolean 是否展示 pc 端底部状态栏
isShowMobileBottomBar boolean 是否展示移动端的底部胶囊bar
isSlidesStatusPlay boolean 是否默认进入播放模式

代码演示:

const instance = TencentDocsSDK.init({
      officeType: 'pptx',
      appId: 'xxx',
      fileId: 'xxx',
      pptOptions: {
        // 展示 pc 端底部状态栏
        isShowStatusBar: true,
        // 不默认进入播放模式
        isSlidesStatusPlay: false,
        // 展示移动端的底部胶囊bar
        isShowMobileBottomBar: true,
      }
    });
1
2
3
4
5
6
7
8
9
10
11
12
13
1
2
3
4
5
6
7
8
9
10
11
12
13

# PdfOptions

通过配置选项 pdfOptions,可以配置 PDF 文档页面。 配置项说明

配置项 类型 说明
isShowMobileBottomBar boolean 是否展示移动端的底部胶囊bar

代码演示:

const instance = TencentDocsSDK.init({
      officeType: 'pdfx',
      appId: 'xxx',
      fileId: 'xxx',
      pdfOptions: {
        // 展示移动端的底部胶囊bar
        isShowMobileBottomBar: true
      }
    });
1
2
3
4
5
6
7
8
9
1
2
3
4
5
6
7
8
9
上次编辑于: 2023年8月11日 16:44
贡献者: muyanyang