Подтвердить что ты не робот

Добавить изображения в Google Документ через Google Apps Script

Как вы можете добавлять изображения в Документ Google (не электронную таблицу или презентацию) через Google Apps Script. Я не вижу метод addImage. Разумеется, команда не оставила бы это.

http://code.google.com/googleapps/appsscript/class_document.html

4b9b3361

Ответ 1

Из документов:

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-адрес.