I thought that this answer might be useful for understanding for resolving your issue. Auto Transfer Google sheet generated QR code to Google Doc as Image When the script of this answer is reflected in your showing script, how about the following modification?
Unfortunately, I cannot know your actual script. So, this is a simple modification. Please reflect this in your actual script.
Please add the following function to your script.
// ref: https://stackoverflow.com/a/71151203/7108653
var replaceTextToImage = function (body, searchText, url, width = 200) {
var next = body.findText(searchText);
if (!next) return;
var r = next.getElement();
r.asText().setText("");
var img = r.getParent().asParagraph().insertInlineImage(0, UrlFetchApp.fetch(url).getBlob());
if (width && typeof width == "number") {
var w = img.getWidth();
var h = img.getHeight();
img.setWidth(width);
img.setHeight(width * h / w);
}
return next;
};
And, please modify your script as follows.
newFileBody.replaceText('<<emp-sign>>', emp_sign);
newFileBody.replaceText('<<it-sign>>', it_sign);
replaceTextToImage(newFileBody, '<<emp-sign>>', emp_sign);
replaceTextToImage(newFileBody, '<<it-sign>>', it_sign);
var emp_sign = data[i][11]
and var it_sign = data[i][12]
are the image URLs. Also, it supposes that the files of your URLs are publicly shared, and your URLs can be directly accessed to the images. Please be careful about this.replaceTextToImage
.