使用Google Apps脚本将图像从Google表格复制到Google文档 [英] Copy image from Google Sheets to Google Docs using Google Apps Script

查看:123
本文介绍了使用Google Apps脚本将图像从Google表格复制到Google文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用电子表格中的数据来生成报告作为Google Docs文档.工作表的某些部分包含分步的屏幕快照演练(即,文本,图像,文本,垂直图像).需要将其复制到文档中.

I was working on generating a report as Google Docs document using data from spreadsheets. Some parts of the sheets contain a step-by-step screenshot walkthrough (That is, text, image, text, image vertically). That needs to be copied to the doc.

我通读了Google Apps脚本参考,发现OverGridImage代表文件中的图像.但是,没有方法允许导出为Blob或URL. (由于粘贴在纸张上的图像直接来自剪贴板,因此图像的URL最初没有,因此getUrl()不起作用.)

I have read through Google Apps Script reference and found that OverGridImage represent the image in the file. However, there was no method that allows exporting as a blob, or even a URL. (Since the image pasted on the sheets come directly from clipboard, there is no URL of the image in the first place, so getUrl() does not work.)

有没有可能的解决方法?

Is there any workaround that is possible?

推荐答案

恐怕您目前正试图无法实现.

OverGridImage 是最近才发布的( 2018年10月),正如您所说,这是不可能的检索此类图像的Blob.与此相关,实际上在问题跟踪器中有一个 打开功能请求.

The 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 in Issue Tracker regarding this.

因为没有与此相关的 BlobSource接口类,如果没有URL,则无法获取该图像的引用.而且,Sheets API也无法检索该图像.

Since there is no BlobSource interface related to this class, there is no way to get a reference of that image, if you have no URL. And the image cannot be retrieved by Sheets API either.

  • OverGridImage
  • Feature Request: Update OverGridImage to support BlobSource interface

这篇关于使用Google Apps脚本将图像从Google表格复制到Google文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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