10
如何通过Google Apps脚本将图像添加到Google文档(不是电子表格或演示文稿)。我没有看到一个addImage方法。当然,球队不会放弃这一点。通过Google Apps脚本将图像添加到Google文档
http://code.google.com/googleapps/appsscript/class_document.html
如何通过Google Apps脚本将图像添加到Google文档(不是电子表格或演示文稿)。我没有看到一个addImage方法。当然,球队不会放弃这一点。通过Google Apps脚本将图像添加到Google文档
http://code.google.com/googleapps/appsscript/class_document.html
从文档:
function insertImage() {
// Retrieve an image from the web.
var resp = UrlFetchApp.fetch("http://www.google.com/intl/en_com/images/srpr/logo2w.png");
// Create a document.
var doc = DocumentApp.openById("");
// Append the image to the first paragraph.
doc.getChild(0).asParagraph().appendInlineImage(resp.getBlob());
}
http://code.google.com/googleapps/appsscript/class_documentapp_listitem.html#appendInlineImage
我不知道,如果你可以上传图片。但是你确定可以通过url将它插入到段落中。
没看到这个。谢谢! – ehfeng
我能够用PNG做到这一点,但出于某种原因,不能用JPEG制作。我为它提交了一个错误报告。 – Fred
@Frederic - 我可以使用所有格式。看到[示例这里](http://stackoverflow.com/questions/15461170/upload-an-image-to-a-google-spreadsheet/15474002#15474002) –