While inserting an image in the google docs using google apps script, using class positioned image, the layout option does not have the option for setting the image behind text. If we insert and image through the doc, the text wrapping setting has an option for setting the image behind the text, how to access that using apps script.
The sample code is -
var body = DocumentApp.getActiveDocument().getBody(); var paragraph = body.appendParagraph("Text for Image ");
var image = "https://upload.wikimedia.org/wikipedia/commons/thumb/2/2f/Google_2015_logo.svg/1920px-Google_2015_logo.svg.png"; var image = UrlFetchApp.fetch(image).getBlob();
paragraph.addPositionedImage(image)
.setWidth(300)
.setHeight(100)
.setLayout(DocumentApp.PositionedLayout.)
The positioned layout class does not allow me to put the image behind the text while it has options for putting image in front of text as well as wrapping the text around the image.
Link for Positioned Layout Class - https://developers.google.com/apps-script/reference/document/positioned-layout
Link for Positioned Image Class - https://developers.google.com/apps-script/reference/document/positioned-image