XF Ultrascale 2011 supports adding media objects to outputs where supported, specifically Flash objects (*.swf). Currently, PDF and HTML both support embedding Flash and are supported by XF Ultrascale 2011.
This section describes how to embed Flash in your output (where supported by the output format) using our xf:media-object and xf:media-parameter XSL-FO extensions.
<?xml version="1.0" encoding="utf-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xf="http://www.ecrion.com/xf/1.0" xmlns:xc="http://www.ecrion.com/2008/xc" xmlns:svg="http://www.w3.org/2000/svg">
<fo:layout-master-set>
<fo:simple-page-master master-name="Letter Page" page-width="8.500in" page-height="11.000in">
<fo:region-body region-name="xsl-region-body" margin="0.700in"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="Letter Page">
<fo:flow flow-name="xsl-region-body" font-family="Times" font-size="12pt">
<fo:block>
<xf:media-object src="url(.\MyFlashFile.swf)" preview-src="url(.\PreviewImage.jpg)" fo:content-width="192px" fo:content-height="216px" fo:scaling="non-uniform">
<xf:media-parameter param-type="uri" name="myuriparam1" value="somevalue"/>
<xf:media-parameter param-type="uri" name="myuriparam2" value="someothervalue"/>
<xf:media-parameter param-type="player" name="myplayerparam1" value="somevaluefortheplayer"/>
<xf:media-parameter param-type="player" name="myplayerparam2" value="someothervaluefortheplayer"/>
</xf:media-object>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
Inserting a media object is done as shown above. A media object is typically included in an fo:block or an fo:inline, similar to fo:external-graphic.
The xf:media-object element's attributes have the following meaning:
| • | The src attribute specifies the source of the 3D object to be embedded in the PDF. The expected format is the Universal 3d File Format (*.u3d). |
| • | The preview-src attribute specifies the preview image to embed in the PDF for this 3D object. Any image supported in XF Ultrascale 2011 may be specified here. |
| • | The content-height, content-width and scaling attributes are the same as the standard XSL-FO attributes applied to fo:external-graphic and fo:instream-foreign-object. The attributes must be prefixed by the fo namespace to be properly recognized by the engine. |
The xf:media-parameter element is used to add optional parameters to the media object. Its attributes have the following meaning:
| • | The param-type attribute specifies whether this is an uri or player parameter. For more information on Flash parameters, see the Flash parameters documentation. |
| • | The name attribute specifies the parameter's name. |
| • | The value attribute specifies the parameter's value. |