【问题标题】:How to custom page margin in google docs api?如何在 google docs api 中自定义页边距?
【发布时间】:2020-02-10 07:26:35
【问题描述】:

我尝试自定义页面大小和边距,但它不起作用。 我曾尝试在站点中使用自动 API,但结果仍然没有改变边距。 google docs api有什么变化吗?

【问题讨论】:

    标签: node.js google-docs-api google-apis-explorer


    【解决方案1】:

    不幸的是,在现阶段,documentStylecontent 似乎无法用documents.create 的方法设置。 Ref我确认这仍然没有被修改。那么作为当前的解决方法,下面的流程如何?

    流程:

    1. 使用documents.create的方法创建新文档。在这种情况下,可以设置标题。

    2. 使用documents.batchUpdate的方法设置updateDocumentStyle

      • 从您的问题来看,documents.batchUpdate 的请求正文如下。

        {
          "requests": [
            {
              "updateDocumentStyle": {
                "documentStyle": {
                  "marginTop": {
                    "magnitude": 100,
                    "unit": "PT"
                  },
                  "marginLeft": {
                    "magnitude": 500,
                    "unit": "PT"
                  }
                },
                "fields": "marginTop,marginLeft"
              }
            }
          ]
        }
        

    参考资料:

    如果这不是您想要的方向,我深表歉意。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-07-08
      • 1970-01-01
      • 1970-01-01
      • 2011-11-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-16
      相关资源
      最近更新 更多