I'm trying to add a border in a google Document image, but I cannot get the result with InlineImage or PositionedImage.
PositionedImage doesn't support setAttributes(), so I will use InlineImage for the example:
Example: https://docs.google.com/document/d/19f_vFb6dFov7X8rBZSeThG3xW8ODZaIJuchRl-BPIXk/edit?usp=sharing
The bounded script add the image and try to make it bordered, but it's not working: the border is still absent
function test() {
var doc = DocumentApp.getActiveDocument();
var body = doc.getBody();
body.clear();
var par1 = body.appendParagraph("Test");
var bordered = {};
bordered[DocumentApp.Attribute.BORDER_COLOR] = "#000000";
bordered[DocumentApp.Attribute.BORDER_WIDTH] = 1;
var image = DriveApp.getFileById("1Z_Tc6LPFTrfl5-BOCkJ6u-Us6jaTAG_-").getBlob();
par1.appendInlineImage(image);
par1.setAttributes(bordered);
}
Thanks