M2Doc Documentation

asImage(uri: java.lang.String, java.lang.String) = MImage

Convert a String representing an URI to an Image and serialize it in the given format.

Expression Result
'image.png'.asImage('jpg') insert the image 'image.jpg'


asImage(uri: java.lang.String) = MImage

Convert a String representing an URI to an Image.

Expression Result
'image.png'.asImage() insert the image 'image.png'


fit(image: org.obeonetwork.m2doc.element.MImage, width: java.lang.Integer, height: java.lang.Integer) = MImage

Fits the Image in the given the given rectangle width and height.

Expression Result
myImage.fit(200, 300) will fit the image in a rectangle (width=200, height=300)


getHeight(image: org.obeonetwork.m2doc.element.MImage) = Integer

Sets the height of the image.

Expression Result
myImage.getHeight() 300


getWidth(image: org.obeonetwork.m2doc.element.MImage) = Integer

Gets the width of the image.

Expression Result
myImage.getWidth() 300


setConserveRatio(image: org.obeonetwork.m2doc.element.MImage, conserve: java.lang.Boolean) = MImage

Sets the conserve ratio of the image.

Expression Result
myImage.setConserveRatio(false) set the conserve ratio to false


setHeight(image: org.obeonetwork.m2doc.element.MImage, height: java.lang.Integer) = MImage

Sets the height of the image.

Expression Result
myImage.setHeight(300) set the height to 300


setWidth(image: org.obeonetwork.m2doc.element.MImage, width: java.lang.Integer) = MImage

Sets the width of the image.

Expression Result
myImage.setWidth(300) set the witdh to 300