【问题标题】:Replace text with image Google Script?用图像 Google 脚本替换文本?
【发布时间】:2013-10-03 23:50:45
【问题描述】:

我正在尝试使用this API 对一些 Google 文档进行迭代。但是,我对 Javascript 的经验很少。如何用来自 URL 的实际内联图像替换关键字,例如 <"image">? ChildIndex 是否支持段落内的索引?代码加分!

【问题讨论】:

    标签: javascript image api google-apps-script google-docs


    【解决方案1】:

    如果您想从 URL 添加实际的内联图像,请尝试以下操作:

    var img_name_Url = "URL of the image";
    
    var img_name_Blob = UrlFetchApp.fetch(img_name).getBlob().setName("img_name_Blob");
    

    在你要使用的文档中:

    htmlBody : "The content for the inline image <img src='cid:img_name'>",
           inlineImages:
           {
             img: img_name_Blob
           }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-06
      • 2014-04-06
      • 2013-10-23
      • 1970-01-01
      • 1970-01-01
      • 2010-09-19
      • 2012-11-10
      • 1970-01-01
      相关资源
      最近更新 更多