Insert Images and Charts

Publisher supports several methods for including images in the published document.

The following sections describe these options:

Directly Insert Images

Insert the jpg, gif, or png image directly in the template.

Note that if you insert an image to an RTF template, and set the Wrap Text property of the image to a value other than In Line With Text, the PowerPoint output won't contain the image.

Insert Images with URL References

Include an alternative text link for an image.

To insert images with URL references:

  1. Insert a dummy image in the template.
  2. In Microsoft Word's Format Picture dialog box select the Web tab. Enter the following syntax in the Alternative text region to reference the image URL:

    url:{'http://<image location>'}

    For example, enter:

    url:{'http://www.example.com/images/ora_log.gif'}

Insert Images with an Element Reference from an XML File

Include a link to an XML file for an image.

To insert images with element references:

  1. Insert a dummy image in the template.
  2. In Microsoft Word's Format Picture dialog box select the Web tab. Enter the following syntax in the Alternative text region to reference the image URL:

    url:{IMAGE_LOCATION}

    where IMAGE_LOCATION is an element from the XML file that holds the full URL to the image.

    You can also build a URL based on multiple elements at runtime. Just use the concat function to build the URL string. For example:

    url:{concat(SERVER,'/',IMAGE_DIR,'/',IMAGE_FILE)}

    where SERVER, IMAGE_DIR, and IMAGE_FILE are element names from the XML file that hold the values to construct the URL.

    This method can also be used with the OA_MEDIA reference as follows:

    url:{concat('${OA_MEDIA}','/',IMAGE_FILE)}

Render an Image Retrieved from BLOB Data

You can include an image stored as a BLOB in a form.

If results XML contains image data that had been stored as a BLOB in the database, then use the following syntax in a form field inserted in the template where you want the image to render at runtime:

<fo:instream-foreign-object content-type="image/jpg">
<xsl:value-of select="IMAGE_ELEMENT"/>
</fo:instream-foreign-object>

where

image/jpg is the MIME type of the image (other options might be: image/gif and image/png)

and

IMAGE_ELEMENT is the element name of the BLOB in the XML data.

Note that you can specify height and width attributes for the image to set its size in the published report. The image fits the box size that you define. For example, to set the size of the example above to three inches by four inches, enter the following:

<fo:instream-foreign-object content-type="image/jpg" height="3 in" width="4 in">
<xsl:value-of select="IMAGE_ELEMENT"/>
</fo:instream-foreign-object>

Specify in pixels as follows:

<fo:instream-foreign-object content-type="image/jpg" height="300 px" width="4 px">
...

or in centimeters:

<fo:instream-foreign-object content-type="image/jpg" height="3 cm" width="4 cm">
...

or as a percentage of the original dimensions:

<fo:instream-foreign-object content-type="image/jpg" height="300%" width="300%">
...