I am using templated html and HtmlService in Google Apps Scripts to generate pdf reports. I am trying to insert an image from my Google Drive into the html template.
The templated html looks like this:
<img src= <?= DriveApp.getFileById("1234567890-abcdefghijklmnopqrstuvwxyz").getAs("image/jpeg");?> >
and the output html looks like this:
<img src="Blob">
If I remove the .getAs()
function then the output is:
<img src="image name.jpg">
Both snippets of code only result in a hollow, square box only a few pixels wide when the html is evaluated. Is there any way that the image can be inserted into the html instead of a Blob
or File
objects?