使用 Google Apps 脚本将图像从 Google 表格复制到 Google 文档
Copy image from Google Sheets to Google Docs using Google Apps Script
我正在使用电子表格中的数据将报告生成为 Google Docs 文档。工作表的某些部分包含逐步的屏幕截图演练(即文本、图像、文本、垂直图像)。需要将其复制到文档中。
我已通读 Google Apps 脚本参考,发现 OverGridImage
代表文件中的图像。但是,没有允许导出为 blob 甚至 URL 的方法。 (由于粘贴在表格上的图像直接来自剪贴板,所以首先没有图像 URL,所以 getUrl()
不起作用。)
是否有任何可行的解决方法?
恐怕你现在想做的事不可能。
Issue Tracker 中的 class OverGridImage was released fairly recently (October 2018) and, as you said, there is no way to retrieve the Blob for such images. There is actually an open Feature Request 关于此问题。
由于没有 BlobSource interface 与此 class 相关,如果没有 URL,则无法获得该图像的参考。而且这张图片也无法被 Sheets API 检索到。
参考:
我正在使用电子表格中的数据将报告生成为 Google Docs 文档。工作表的某些部分包含逐步的屏幕截图演练(即文本、图像、文本、垂直图像)。需要将其复制到文档中。
我已通读 Google Apps 脚本参考,发现 OverGridImage
代表文件中的图像。但是,没有允许导出为 blob 甚至 URL 的方法。 (由于粘贴在表格上的图像直接来自剪贴板,所以首先没有图像 URL,所以 getUrl()
不起作用。)
是否有任何可行的解决方法?
恐怕你现在想做的事不可能。
Issue Tracker 中的 class OverGridImage was released fairly recently (October 2018) and, as you said, there is no way to retrieve the Blob for such images. There is actually an open Feature Request 关于此问题。
由于没有 BlobSource interface 与此 class 相关,如果没有 URL,则无法获得该图像的参考。而且这张图片也无法被 Sheets API 检索到。