I’m utilizing Google Apps Script to transfer data from Google Forms into a Google Document. Among the form submissions, there are several images, and while I can successfully insert them into the document, I also want to append a descriptive text label. Currently, I’m using the following code snippet within a loop:
content.insertParagraph(positionIndex++, entry[0] + ': ');
content.insertImage(positionIndex++, fetchImage(resource[entry[0]][0]));
However, there are instances where the image and its corresponding label are displayed on different pages, as illustrated in the screenshot below:
What approach should I take to ensure they remain together on the same page?
