title: Docx4j scale image to parent element
body: <p>I want to scale an image in docx4j to match the width of it's parent if it's too large to fit on the page. For example maybe it's inside a table cell which has a width or bigger than the page.</p>
  
  <p>I'm currently playing with the <code>int width = box.getContainingBlock().getWidth();</code> and <code>int imagewidth = imagePart.getImageInfo().getSize().getWidthMpt();</code> but the values don't seem to be correct. Is there a better way of doing this?</p>