Does Google Apps Script support the use of base64-encoded images with HTML service? I am trying to add images to an HTML page using base64 encoding, but they are not displaying in the final page.
The HTML I am trying to use is:
<img src="data:'+contentType+';base64,'+encoded+'"/>
When I log the html content just before it is rendered by HTML service this appears as:
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUh.....(base64 string)/>
This works fine in JSFiddle and in normal HTML, but in Apps Script, the images do not display. When viewing the source code on the rendered page, the image tags appear as follows:
<img src="null">
Is there another way to add base64-encoded images to the page? I can get the images as a blob, but I don't think there is a way to directly add a blob to the HTML content.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…