How to embed pdf in moodle (v 1.9.11+)

How to embed pdf in moodle (v 1.9.11+)

by Muhammad Omer Saleem -
Number of replies: 4

I want to embed pdf in moodle as an embedded application.

1. When i am trying to link a pdf using "Link to a file or web site", nothing is showing on the page except summary text.

2. When i am trying to link pdf using "Compose a web page" using this code

"<object height="400" width="500" src="http://localhost/moodle/file.php/2/How_to_use_Source.pdf" type="application/x-pdf">&nbsp;
</object>"

it shows an empty screen without pdf file on clicking "Save and Display" button and code gets disappear in the resource updation screen on next view in internet explorer.

Please suggest any solution to embed pdf in moodle.

Average of ratings: -
In reply to Muhammad Omer Saleem

Ang: How to embed pdf in moodle (v 1.9.11+)

by Bente Olsen -
Picture of Testers Picture of Translators

Hi Muhammad

You can not 'embed' pdf files to Moodle the same way that you can embed videos or images. But it is very common that people have a plugin in their browser that can show the pdf. So you must just create a common link to the file or add it as a ressource.

In reply to Muhammad Omer Saleem

Re: How to embed pdf in moodle (v 1.9.11+)

by Andrei Băutu -
Picture of Plugin developers

Hi Muhammad,

As stated by Bente, if your PDF software has a browser plugin, you'll be able to view PDF files directly in your browser. For example, Adobe Acrobat Reader has this option available in Preferences, under the Internet section (look for "Display PDF in browser" option). In this case, I recommend you use the first option (Link to a file) because Moodle will protect the PDF file against deletion.

Another way to do this, is to convert your PDF file into an Flash file. Search on Google for "flash printer". It is software that simulates a printer, but creates a swf (flash) file that you can embed.

Cheers,
Andrei

In reply to Andrei Băutu

Re: How to embed pdf in moodle (v 1.9.11+)

by Muhammad Omer Saleem -

Thanks for reply,

I have Adobe Acrobat 7.0 Professional, Internet Explorer 8 and Moodle 1.9.11+ installed on my PC. "Display PDF in browser" option in Adobe Acrobat is enabled by defalut. After uploading pdf file on moodle i linked it using "Link to a file or web site" as suggested by Andrei, but still pdf is not showing. "Embedded" option for pdf has also been set to "true" in resource.class.php.

In reply to Muhammad Omer Saleem

Re: How to embed pdf in moodle (v 1.9.11+)

by Grant Swaim -

Muhammad,

I too was having this problem and found a bug report that indocates this could be due to a theme incompatibility. When I switched back to a core theme, it worked.

Try switching to something like "Basic White" and see if it works. I was using a NewSchool theme and it would not display the PDF. I have a support request posted to them about this.

Good Luck.