Want to Share: embed swf pdf-based file into a course

Want to Share: embed swf pdf-based file into a course

by Bayu Widyasanyata -
Number of replies: 7
Picture of Translators

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).

  1. Prepare a PDF file.
  2. 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.
  3. Upload the swf file into a new topic of course. This step actually just want to know what is the "proxy" URL.
  4. 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 sad.
  5. 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>
  6. 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>
  7. 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.
  8. 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.
  9. 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 smile.
  10. 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 smile

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.

Average of ratings: -
In reply to Bayu Widyasanyata

Re: Want to Share: embed swf pdf-based file into a course

by Yvonne van Lingen -

Hi Bayu

It's a long way to get to your destination!

Actually, I played around with this same question this morning in Moodle 2.1.

I solved it by using code to embed my swf file. Put his code in the HTML-area, e.g.  the label or page activity:

<iframe align="middle" width="100%" height="1000" src="http://yourdomain.com/pluginfile.php/163/mod_resource/content/1/yourfile.swf" border="0"></iframe>

Hope this helps!

Regards

Yvonne van Lingen


Average of ratings: Useful (1)
In reply to Yvonne van Lingen

Re: Want to Share: embed swf pdf-based file into a course

by Bayu Widyasanyata -
Picture of Translators

Hi Yvonne,

Great! smile

Thanks, I've tested and works!

BTW, do you know how the quick way to find the file's path from file picker like in common CMS (e.g. wordpress, etc.).

[bayu]

In reply to Bayu Widyasanyata

Re: Want to Share: embed swf pdf-based file into a course

by Bayu Widyasanyata -
Picture of Translators

Hi Yvonne,

This is the correct one, especially on "border" tag of IFRAME; the correct one was frameborder.

<iframe src="http:/yourdomain.com/pluginfile.php/163/mod_resource/content/1/file.swf" frameborder="0" height="1000" width="100%"></iframe>

see: http://www.w3schools.com/tags/tag_iframe.asp

Anyway, thanks!

[bayu]

In reply to Bayu Widyasanyata

Re: Want to Share: embed swf pdf-based file into a course

by Yvonne van Lingen -

Hi Bayu,

Thanks for this correction.

Your question about the filepicker was discussed in posts to this forum last week. The philosophy has completely changed.

Regards,

Yvonne

In reply to Yvonne van Lingen

Re: Want to Share: embed swf pdf-based file into a course

by Bayu Widyasanyata -
Picture of Translators

Hi,

Could you share the link?

AFAIK the philosophy to put file on each course, reusable, etc. are fine for me. But what I need is simple to get its URL. Hence we can put easily such as on IFRAME's URL.

If not so, then I should hide it after upload and get the file URL :|

In reply to Bayu Widyasanyata

Re: Want to Share: embed swf pdf-based file into a course

by phillip lucass -

I met the same problem before,and search a soft can convert pdf to flash(.swf),effect is good,here's its link http://www.axppt.com

Just insert its url to the frame.

In reply to Yvonne van Lingen

Re: Want to Share: embed swf pdf-based file into a course

by vijaykanth dondapati -

Hi 

  This is vijay as i have tried this it's working for book  uploading.Can you provide any solution for uploading file in activity and resource.