[#picture] expression [/#picture]
where:
String.The picture tag can be used to insert an image. It makes sense to use this tag only when the path of the picture must be dynamically computed from expressions. If the path is static, you should rather insert the picture using the regular command in your authoring tool.
The expression evaluation must return a String.
This String denotes the path of a picture in the file system.
The picture formats handled by DocGen are:
bmp, emf, gif, jpg, png, and wmf.
If the file path is relative, it must be relative to the output file (see file tag).
For example, if the doc template specifies an output file "c:\output\output.xml"
and inserts a picture "images\myPicture.png",
then this picture must be located in the directory "c:\output\images\"
MDWorkbench inserts pictures using their original size (width and height). In some cases, pictures may be too large in the output document.
You can limit the size of the picture to insert using the following attributes:
maxWidth: determine the maximum width of the picture.maxHeight: determine the maximum height of the picture.The attribute maxWidth and maxHeight must be positive integers (pixel unit).
A picture is resized (both width and height to maintain the ratio) to fit these maximum values, if necessary.
For example, if a picture is 800 pixel long and maxWidth is set to 600,
the picture is resized to be 600 pixel long.
By default, MDWorkbench will embed the picture directly inside the generated document. That way, you have one document with no external reference.
However you may want to insert only a link to pictures in some cases
(to optimize document weight when multiple documents reference the same diagrams,
or to be able to update pictures without touching the document).
You can control the insertion mode using the attribute
insert.
The insert attribute can have the following values:
embedded: this is the default value. The picture is directly embedded in the document.link: the generated document just keeps a link to the original picture, somewhere in the file system.
If the picture or the document is moved, then the reference will be invalid.linkLocalCopy: the original picture is copied in the generated document directory,
and the document just keeps a link to this copy. The original file can then be deleted without impacting the document.This will insert a picture whose path is computed from a Class name, and will scale it to be 600 pixels long at most:
[#picture maxWidth="600"]images/[#expr]myClass.name[/#expr].png[/#picture]