1

I'm trying to find a way to get a border around an image in Google Docs using Google Apps Script. This is possible in the GUI of Google Docs but I can't find how to do this using the GAS. I've tried using style attributes but these don't seem to affect the image at all. (https://developers.google.com/apps-script/reference/document/text#setattributesattributes)

Video of what I want to do: https://www.youtube.com/watch?v=FC2wpheln_o

Any help would be welcome!

Rubén
  • 34,714
  • 9
  • 70
  • 166
  • I don't think it's now possible with GAS and I can't see it in the [documentation](https://developers.google.com/apps-script/guides/docs). You can only set border color & style in spreadsheet as stated [here](http://stackoverflow.com/questions/12900359). I suggest to include a [border attribute](https://developers.google.com/apps-script/reference/document/#attribute) when [adding an image](http://stackoverflow.com/questions/7898497/) in Google Docs via Apps Script. However, you can file a [feature request](https://code.google.com/p/google-apps-script-issues/) for this. – abielita Mar 25 '17 at 04:44
  • In DocumentApp.Attribute there is an enum which contains BORDER_WIDTH. – Cooper Mar 25 '17 at 16:04
  • @Cooper I have tried using it, but it doesn't do anything. – Thibault Molleman Mar 27 '17 at 09:57
  • My current workaround is to use Imagemagick (command line tool for editing images) to make a border around the images (since the images are being extracted from a pdf and need to be processed by imagemagick anyway) I used "-bordercolor Black -border 2x2" options on Imagemagick btw – Thibault Molleman Mar 27 '17 at 09:59
  • Since a feature request does not appear to have been opened for this, I have opened one here: https://issuetracker.google.com/issues/147968327 – Paul Donohue Jan 20 '20 at 16:12

0 Answers0