There are several ways to add images to a DITA topic, depending on if you want to create a figure element (with a title and caption), just insert an image inline, or if you want to use multiple versions of a graphic depending on the situation. For instance, you might want to use a specific image for each different product version or output media.
Use the following procedure to add an image inline:
Select the
Insert
Image action. The Insert Image dialog box
appears.
Configure the options in this dialog box and click Insert.
@href attribute inside the <image>
element. You can type the URL of the image you want to insert or use browsing
actions in the
Browse drop-down menu (there is also a history drop-down).@keyref attribute inside the <image>
element. All keys that are presented in the dialog box are gathered from the root map of the current
DITA map. You can use the
Choose Key Reference button to open
the Choose Key dialog box that presents the list of keys
available in the selected root map.<title> and
<image> element inside a
<fig>.<alt> element inside the
<image>. @width,
@height, and @scale attribute, respectively.
@placement and
@align attributes into the <image>
element.@href attribute in a DITA <image>
element:<image href="../images/image_file.png"/>To add an image in a figure:
<fig> element to your document at the appropriate
place.<title> and/or <desc> element to
<fig>, according to your needs. <image> element to the <fig>
element.<fig> element has a number of other child elements that may
be appropriate to your content. See the DITA documentation for complete information about
<fig>.<image>,
<title>, and <desc> elements will appear in
the output is determined by the output transformation. If you want to change how they
appear, you may have to modify the output transformation, rather than your source
content.Oxygen XML Author Eclipse plugin provides the possibility of floating an image to the left or right of blocks of content in DITA topics, for both PDF and XHTML output.
@outputclass attribute on the
<image> element. The possible values are:<p><image href="../../images/Lilac.jpg" scale="45" outputclass="float-right"/>
<b>Lilac</b> (<b>Syringa</b>) is a genus of about 20–25 species of flowering plants
in the olive family (<b>Oleaceae</b>), native to Europe and Asia.
</p>
Search
References from the contextual menu. The result depends on how the image is
defined, as follows:<image> element that contains an
@href attribute but does not include an @id attribute,
all direct references to the image are reported. If the <image>
element does have an @id attribute, all links to the specified ID
are also reported.<image> element that contains a
@keyref attribute but does not include an @id
attribute, all direct references to the image are reported along with all instances
where the key is used. If the <image> element does have an
@id attribute, all links to the specified ID are also
reported.