#filter_viewerjs
This is a Moodle filter that converts links to local PDFs, ODPs, ODTs, and ODSs into an embedded player powered by
ViewerJS. It uses the model from moodle-filter_jwplayer of
creating a Moodle core_media_player
renderer and using that to change links into an embedded player.
This plugin has only been tested on Moodle 2.8.
##Installation
Note that ViewerJS is licensed AGPLv3. To ease the licensing and distribution requirements of this filter, the ViewerJS library must be installed separately, instead of it being bundled with the filter.
- Place the files for this filter at
/filter/viewerjs
in your Moodle Installation - Download ViewerJS and extract the
viewerjs-*/ViewerJS/
to/filter/viewerjs/lib/viewerjs/
in your Moodle installation. If successful,/filter/viewerjs/lib/viewerjs
should contain files such asindex.html
. - Create a text file named
thirdpartylibs.xml
with the following content
<?xml version="1.0"?>
<libraries>
<library>
<location>lib/viewerjs</location>
<name>ViewerJS</name>
<version>VERSION_NUMBER</version>
<license>AGPL</license>
<licenseversion>3.0</licenseversion>
</library>
</libraries>
replacing VERSION_NUMBER
with the version of ViewerJS that was downloaded
4. Using a web browser, go to /admin
to complete installation
##Usage
- Create a page activity in a course
- Add some text
- Create a link to a PDF
- When you save and view the page, you should see the PDF displayed in the embedded player