Hi,
After a little frustating in embeding swf files into moodle (i.e. the fixed size of embeded window of 400x300), I want to share here on how I add swf pdf-based file as a resource and hope someone can teach and show me in better way. The main idea was to directly/automatically opened document on a course page with approriate window size (1000px of height and 100% of width).
Following are the steps and I'm sure it was not effective yet, little time consuming and not practical for novice users (teachers relatively new with moodle).
- Prepare a PDF file.
- Convert the PDF file into swf file with pdf2swf (from swftools - http://www.swftools.org/). The result are 2 files: swf file and HTML file with basic <embed> flash format.
- Upload the swf file into a new topic of course. This step actually just want to know what is the "proxy" URL.
- After it has uploaded, click the link of the file (with swf icon on the left of filename description) in course page. It will open a new page with a small embeded swf window at top. The size is only 400x300, where it's hard for us to read a swf pdf-based document .
- View the page source of swf file - point 4 above in your browser. Then we know the actual path how the moodle displaying the swf file. It's a "proxy" page of moodle: "http://yourdomain.com/pluginfile.php/163/mod_resource/content/1/yourfile.swf". Just look at the red fonts of complete codes below.
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="400" height="300"> <param name="movie" value="http://yourdomain.com/pluginfile.php/163/mod_resource/content/1/01-01.swf" /> <param name="autoplay" value="true" /> <param name="loop" value="true" /> <param name="controller" value="true" /> <param name="scale" value="aspect" />
<param name="base" value="." /> <!--[if !IE]>--> <object type="application/x-shockwave-flash" data="http://yourdomain.com/pluginfile.php/163/mod_resource/content/1/01-01.swf" width="400" height="300"> <param name="controller" value="true" /> <param name="autoplay" value="true" /> <param name="loop" value="true" /> <param name="scale" value="aspect" /> <param name="base" value="." /> <!--<![endif]--> Click <a href="http://yourdomain.com/pluginfile.php/163/mod_resource/content/1/01-01.swf" >01-01.swf</a> link to view the file.
<!--[if !IE]>--> </object> <!--<![endif]--> </object>
- Open the HTML code of pdf2swf converter. It shows similar like this:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%" codebase="http://active.macromedia.com/flash5/cabs/swflash.cab#version=8,0,0,0"> <param name="MOVIE" value="01-01.swf"> <param name="PLAY" value="true"> <param name="LOOP" value="true"> <param name="QUALITY" value="high"> <param name="FLASHVARS" value="zoomtype=3"> <embed src="01-01.swf" width="900" height="1300" play="true" ALIGN="" loop="true" quality="high" type="application/x-shockwave-flash" flashvars="zoomtype=2" pluginspage="http://www.macromedia.com/go/getflashplayer"> </embed> </object>
- Create a new Label page into the same topic area of swf file (point 3). Change the editor view to HTML source format (click the HTML icon) and paste the HTML code of pdf2swf (point 6 above) into the editor.
- Change the following values to correct path and new window size of swf file.
- File PATH. In the code point 6 above, from "01-01.swf" to "http://yourdomain.com/pluginfile.php/163/mod_resource/content/1/01-01.swf"
- Window SIZE on <embed> tag, from width="900" height="1300" to width="100%" height="1000". Or adjust with your best size. - Save the Label by clicking the "Update" icon of HTML source code editor and finally click "Save and return to course" icon of Label editor page. And finally you can show the swf pdf-based document in comfort window size .
- Last, hide the swf file by clicking the file's eye icon in order not to shown in the course. Since it only need to see the moodle proxy page displaying a media file.
That's what I did
I really hope this "dirty jobs" will replace with effective and easy way. Your ideas are most welcome!
Thanks,
[bayu]
ps: my Moodle version is 2.0.3.