使用API​​通过nodejs使用batchupdate()使用API​​更改Google文档中所有内容的行高 [英] Change the line height of all content in a Google doc using the API via nodejs using batchupdate()

查看:44
本文介绍了使用API​​通过nodejs使用batchupdate()使用API​​更改Google文档中所有内容的行高的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用方法:documents.get 可以检索文档.结果的结构如资源:文档所述.但是,我需要选择整个文档并将行高更改为1.5,但是我找不到解决方法.

Using Method: documents.get I can retrieve a document. The result is structured as described at Resource: documents. However, I need to select the whole document and change the line-height to 1.5, but I am unable to find a way to do it.

    var updateObject = {
      documentId: documentId,
      resource: {
        requests: [{
          'updateTextStyle': {
            'range': {
              'startIndex': 1,
              'endIndex': 0
            },
            'textStyle': {
              'line-height': 1.5
            },
            'fields': 'line-height'
          }
        }],
      },
    };
    docs.documents.batchUpdate(updateObject)
      .then(function(res) { // Modified
        console.log(res);
      }, function(err) {
        console.error(err);
      });

推荐答案

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆