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.
Insert Images with URL References
Include an alternative text link for an image.
To insert images with URL references:
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:
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%">
...