Flash Objects

Top Previous Topic Next Topic  Print this topic

XF Rendering Server 2013 supports adding media objects to output file formats that supports them, specifically Flash objects (*.swf). Currently, PDF and HTML both support embedding Flash and are supported by XF Rendering Server 2013.

This section describes how to embed a Flash object in the output (if supported by the output format) using the xf:media-object and xf:media-parameter XSL-FO extensions.

 

Example of usage:

 

 

<?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 can be achieved as exemplified 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 output. The expected format is the Universal 3d File Format (*.u3d).
·The preview-src attribute specifies the preview image to be embedded in the PDF for the 3D object. Any image supported in XF Rendering Server 2013 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 in order to be properly recognized by the engine.
·The auto-play attribute has a Boolean value and specifies if the flash object must be automatically played when the PDF output document is opened.

 

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, the Flash parameters documentation is available.
·The name attribute specifies the parameter's name.
·The value attribute specifies the parameter's value.