Working with Images

Information and tips regarding the image handling features.

When an image is added by inserting an image or fig element, the anchored frame is “shrink-wrapped” to the size of the image. The relative path to the image file is added to the href attribute and the height/width in pixels is added to the height and width attributes. When an image is added the initial value of the placement attribute matches that specified as the default in the EDD, unless the image is auto-inserted as the result of inserting a fig element in which case the placement attribute is set to “break.” For images where the placement attribute value is “break,” the initial alignment is set to match that of the default value of the align attribute as defined in the EDD; no alignment value is set for “inline” images.

You can change the alignment after inserting the image by editing the value of the align attribute or by selecting an alignment option in the Anchored Frame dialog (Special > Anchored Frame). The height and width cannot be set through the attribute value; they can only be changed by re-importing the image using a different scaling, or by changing the properties through the Object Properties dialog. The href attribute also cannot be changed through the attribute value.

If you do not want any height/width values associated with an image, deleting those attributes in the XML or Frame document will result in the image element being written with no values for height and width which uses the “native” (default) size of the image. This is often desirable for output being generated as HTML.

If you want to use the native size of raster images for output generated through the Open Toolkit but want to use a specific DPI for output generated from FrameMaker, add an “fmdpi:<DPI>” attribute value to the image/@otherprops attribute, where <DPI> is the DPI value. Adding this value to the otherprops attribute allows the DPI setting to round trip from XML to Frame and it will only be used by FrameMaker; other output processes will see no height and width values and will use the native image size. Adding this value to the otherprops attribute deletes any value set to the height or width attributes.

If you want to use the fmdpi feature for all raster images, enable the “Use fmdpi” setting in the Options dialog. This will set the fmdpi value to the DPI value you select when importing the image. The fmdpi value is only set for raster images; this feature is not avalable for vector images.

Note: If your images sizes are not round-tripping properly, your read/write rules file probably needs to be updated. Refer to the image topic for the proper rules, especially with regard to the height and width attribute definitions.

Baseline Offset of Inline Images

By default, the baseline offset for inline images is set to “2pts” (this shifts the image 2 pts below the baseline of the surrounding text). If you want to set this property to a different value, set the value of the BaselineOffset key in the INIOnly section of the ditafmx.ini file to the appropriate value. This property is only applied to inline images. Setting the “baseline offset” property in the read/write rules file has no effect.

Special Handling of Alternative Text (image/alt)

Content of an image/alt element is stored in the image/@alt attribute while being edited in FrameMaker. To modify the alt element content edit the @alt attribute. Because this content is stored in an attribute, any attributes on the alt element or child elements of the alt attribute are discarded when the file is opened in FrameMaker.

Graphic Overlay Objects

As of DITA-FMx 1.1, you can now include callouts and other graphic overlay objects in your DITA files. Although this is not specifically supported in DITA, the data to round-trip these objects is stored in nested data elements immediately following the image element within a fig. This support is only available for images that are child elements of a fig element.

DITA-FMx supports the following types of graphic objects as overlay objects within an anchored frame:

Note that a Text Frame can only contain a single paragraph and the only property that will be saved is the horizontal alignment. Other types of nested frames are not currently supported. Additionally, the object grouping mechanism is not supported.

If you plan to edit callouts as XML (for localization or other purposes) you should not use the Text Line object. The dimensions of the text are stored in the data elements and will not update when you change the actual text. The result will be that the callout remains the same size with the text stretched or compressed to fit into the same area. If you plan to edit the callout text as XML, you should use the Text Frame object which defines the bounds of a region in which the text will flow.

The data stored in the nested data elements is very FrameMaker-specific, but can be translated into other formats such as SVG with a little effort. If your image element is within a fig element and contains graphic overlay objects, a data element will be inserted immediately following the image element. This data element will have the @datatype attribute set to “fm:imagedata”. Within this data element will be a child data element for each of the graphic overlay objects, and each will have a @datatype attribute set to a value appropriate for the object type (e.g. “fm:textline” for a TextLine object and “fm:polyline” for a Polyline object).

When written to XML, all of these data elements will be empty elements (just specifying @name and @value attribute values) except for the text of a Text Frame object. Because this content is likely to be modified for localization purposes, it is written to XML as content of the data element. On import to FrameMaker, this is converted to a data/@value.

Within each of the child data elements will be additional data elements that represent the properties of that object. The @name attribute will be set to the property name and the @value attribute will be set to the proper value. For some properties the value may be a very large numeric value, this is a FrameMaker “MetricT” value (this has nothing to do with the metric measurement system). When used for linear measurement, value of 65536 is equal to a point (1/72 inch).