title: How do I place an image at the right margin?
body: <p>I'm trying to place an image against the right-hand margin of a google doc using scripts. I've got this calculation for the left offset:</p>
  
  <pre><code>body.getPageWidth()-body.getMarginRight()-body.getMarginLeft()-myImage.imageWidth
  </code></pre>
  
  <p>This consistently places the image 5/8 of an inch inside the margin. I thought maybe this might be something to do with the automatic margin around a wrapped image? I can't find a way to control that in the PositionedImage documentation though.</p>
  
  <p>Is there an extra element I'm missing in my calculation for the left offset? Something else I'm failing to allow for? Is there another method I can use to place the image?</p>