I am creating Word DOCX files with embedded vector graphics. Apparently DrawingML is now the preferred way of inserting vector graphics. I am having trouble working out how to clip a diagram within the drawing canvas. It seems to keep scaling my shapes within the group shape.
Is clipping possible in DrawingML, and if so, does anyone have a wee snippet of code or XML to point me in the right direction?
Cropping in DrawingML is from the
<scrRect/>tag. If it is anything but empty, it means it is cropped. This tag is used for all visual graphics, such as images, shapes, charts, etc.Take these two examples of an .EMF inserted in Word:
and
Note that they are the same, except for the line
<a:srcRect l="23111" r="19768" b="32841"/>in the second one. What this means is that the source rectangle (i.e. the image's dimensions) is cut/clipped/cropped by 23.111% off the left, 19.768% off the right and 32.841% off the bottom. The top has not been cropped.