如何通过 Google Docs API 插入嵌入的 sheet?
How to insert an embedded sheet via Google Docs API?
我想通过 Google 文档 API 将嵌入的 Google 表格 table 插入到 Google 文档中。我曾希望我可以通过 EmbeddedObject. The definition of EmbeddedObject includes a field for LinkedContentReference 来做到这一点,但尽管有通用名称,LinkedContentReference 对象似乎仅指 Sheets 图表。
有没有办法通过 API 在 Google 文档中嵌入表格 table?
我确实注意到 Google 表格提供了 Table 图表作为图表类型。这可能是一个有效的解决方法。
您需要插入 sheet table 作为 inline image
An InlineObject contains an EmbeddedObject such as an image.
现在,当您发布 Google Sheet 时,您可以选择将其发布为 pdf,而不是图像。这意味着您需要执行一个额外的步骤,将 pdf 转换为支持的图像格式。
或者,您可以通过对 Sheet 执行 Files: get 请求来获取(并保存在您的驱动器上)作为 thumbNail
的 Sheet并将 fields
设置为 thumbnailLink
。请注意,thumbNail 包含整个 sheet 视图 - 而不仅仅是数据范围。
重要提示:
执行documents.batchUpdate request InsertInlineImageRequest时,需要指定格式uri
https://docs.google.com/uc?export=view&id=PASTE_HERE_YOUR_ID
我想通过 Google 文档 API 将嵌入的 Google 表格 table 插入到 Google 文档中。我曾希望我可以通过 EmbeddedObject. The definition of EmbeddedObject includes a field for LinkedContentReference 来做到这一点,但尽管有通用名称,LinkedContentReference 对象似乎仅指 Sheets 图表。
有没有办法通过 API 在 Google 文档中嵌入表格 table?
我确实注意到 Google 表格提供了 Table 图表作为图表类型。这可能是一个有效的解决方法。
您需要插入 sheet table 作为 inline image
An InlineObject contains an EmbeddedObject such as an image.
现在,当您发布 Google Sheet 时,您可以选择将其发布为 pdf,而不是图像。这意味着您需要执行一个额外的步骤,将 pdf 转换为支持的图像格式。
或者,您可以通过对 Sheet 执行 Files: get 请求来获取(并保存在您的驱动器上)作为
thumbNail
的 Sheet并将fields
设置为thumbnailLink
。请注意,thumbNail 包含整个 sheet 视图 - 而不仅仅是数据范围。
重要提示:
执行documents.batchUpdate request InsertInlineImageRequest时,需要指定格式uri
https://docs.google.com/uc?export=view&id=PASTE_HERE_YOUR_ID