General plugins (Local): Wiki export

local_wikiexport
Maintained by Davo Davo Smith
This plugin adds the ability to export Moodle wikis as either PDFs or epub documents.
90 sites
26 downloads
8 fans

Wiki export

This plugin adds the ability to export Moodle wikis as either PDFs or epub documents. It was commissioned by the Judicial Institute for Scotland, originally for their Totara LMS implementation, with Synergy Learning as the chosen partner, with Davo Smith providing the development work.

Many thanks to Jackie Carter - Learning Technology Manager, and the rest of the team, at the Judicial Institute for contributing this development back in to the Moodle community.

Further development of this plugin is planned for early 2015.

Usage

Once the plugin is installed, you can visit a wiki, then click on the new 'Export as epub' or 'Export as PDF' links that appear in the activity administration block (with javascript enabled, similar links are inserted on the top-right corner of the page).

Users with the 'mod/wiki:managewiki' capability also get a 'Sort pages for export' link, that allows them to choose the order in which pages will appear in the export.

There is an additional global setting which allows a copy of any wikis on the site to be sent (as a PDF) to a given email address, whenever they are updated (note, this will not export all wikis on the site the first time it is configured, it only sends those that have been updated since the email address was first entered).

Customising

If you want to add your organisation's logo to the front page of the exported wiki, please replace the file local/wikiexport/pix/logo.png with your logo. Do not alter the file dimensions, it must remain 514 by 182 pixels.

Customise the following language strings, to alter the embedded export information:
'publishername' - set the PDF 'publisher' field
'printed' - set the description on the front page 'This doucment was downloaded on [date]'

(see https://docs.moodle.org/en/Language_customization for more details)

Contact

Any enquiries, including custom Moodle development requests, should be sent to info@synergy-learning.com

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2

Contributors

Davo
Davo Smith (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Jürg Hoerner
    Fri, 11 Mar 2016, 4:50 AM
    WIth moodle 3.0.1 i receive the following error message:

    Notice: Undefined property: moodle_page::$settingsnav in /var/www/lms.alte-kanti-aarau.ch/moodle/local/wikiexport/lib.php on line 491 Fatal error: Call to a member function get() on a non-object in /var/www/lms.alte-kanti-aarau.ch/moodle/local/wikiexport/lib.php on line 492

    and later on as I tried some changes:
    local plugin navigation callback: Please rename 'local_wikiexport_extends_navigation' to 'local_wikiexport_extend_navigation'. Support for the old callback will be dropped in Moodle 3.1
    * line 1308 of /lib/navigationlib.php: call to debugging()
    * line 3426 of /lib/navigationlib.php: call to global_navigation->initialise()
    * line 718 of /lib/pagelib.php: call to settings_navigation->__construct()
    * line 768 of /lib/pagelib.php: call to moodle_page->magic_get_settingsnav()
    * line 6865 of /lib/adminlib.php: call to moodle_page->__get()
    * line 847 of /admin/index.php: call to admin_externalpage_setup()


  • Picture of Jürg Hoerner
    Fri, 11 Mar 2016, 5:06 AM
    error with the newest verstion on github
    Notice: Undefined property: moodle_page::$settingsnav in /var/www/lms.alte-kanti-aarau.ch/moodle/local/wikiexport/lib.php on line 495 Fatal error: Call to a member function get() on a non-object in /var/www/lms.alte-kanti-aarau.ch/moodle/local/wikiexport/lib.php on line 496
  • Picture of wt poon
    Sat, 29 Oct 2016, 1:11 PM
    I'm trying to export a WiKi in Chinese, but the characters always display as ? marks. Does anybody know how to get Chinese characters to show up in the PDF?
  • Davo
    Sat, 29 Oct 2016, 3:14 PM
    I've not tested, but I assume it is related to the font used to do the export not having any suitable characters in it. If you look in the code, you should be able to switch to using a different font (I don't have the code in front of me now, but if you search for 'setfont' you should find it - the available fonts are in lib/tcpdf/font, again, off the top of my head, without being able to check right now).
  • Picture of wt poon
    Sat, 29 Oct 2016, 10:02 PM
    Thank Davo for the suggestion of switching to a different font. I have followed the instructions given by Ciao in https://moodle.org/mod/forum/discuss.php?d=237702 to install a new font into the folder: my_moodle_path/lib/tcpdf/fonts. I also changed the font name of 'FreeSerif' to 'DroidSansFallback' in Line 73 of my_moodle_path\lib\pdflib.php. Chinese characters show perfectly now. Thanks!
  • Picture of Amaia Anabitarte
    Tue, 7 Feb 2017, 12:36 AM
    Thanks for this great plugin. Any previews for the moodle 3.2 version?
  • Davo
    Tue, 7 Feb 2017, 12:40 AM
    Hi Amaia - it's not quite clear what you're asking for. I've not developed a specific Moodle 3.2 version of this plugin (so there's nothing to offer previews of). At a guess, there is probably no reason not to use the 3.1 version, but I've not done any formal testing to find out.
  • Picture of Wiebke Müller
    Thu, 1 Jun 2017, 6:47 PM
    Dear Davo,

    thank you for providing this plugin which is very helpful in online teaching. At the moment we are facing a technical problem with one wiki which cannot be solved by our local development team. The wiki shows the following error when trying to export a pdf with the plugin. "Fehler: TCPDF ERROR: Empty font family". Have you heard about this before and could give us a hint where to look at? The error cannot be reproduced in a freshly opened wiki activity so I assume it is to with some content, formatting mistakes?

    Thank you in advance.
    Wiebke

    PS. We are using Moodle 3.2 and the latest version of your plugin.
  • Davo
    Thu, 1 Jun 2017, 6:51 PM
    Hi Wiebke - I don't know the answer to that problem off the top of my head. It sounds like somewhere in the content there is a 'font' tag or a 'style' tag with a 'font' style within it. There isn't much else I can offer, other than to suggest you look through each of the pages and remove any unwanted tags (by using the 'view html' button in the text editor.

    Davo
  • Picture of Wiebke Müller
    Tue, 6 Jun 2017, 5:28 PM
    Hi Davo, thanks for your quick answer - the same day! The problem was, and I'm only mentioning it here because it might happen also to other users who create their own content, that somebody inserted a table that crashed the page layout. Funny thing was that the epub export did work, and I only noticed the page explosion after re-converting the epub to pdf with an external tool - uuurgh smile Thank you anyway! Great plugin.
  • Davo
    Tue, 6 Jun 2017, 5:36 PM
    Thanks for the update Wiebke - unfortunately HTML allows for some very complex scenarios (and browsers have had years of practice at outputting something sensible with even the most mangled of content) - the TCPDF library (which does the actual PDF generation) is never going to be able to cope with every possible scenario that could occur; we just have to rely on it coping with most scenarios in a reasonable way.
  • Picture of wt poon
    Wed, 7 Jun 2017, 3:41 PM
    I couldn't agree with Davo more. HTML always causes complex and unexpected scenarios. Specially, when copying content from MS Word to Moodle HTML editor, I strongly recommend using some sort of online tools like http://html-cleaner.com/ to clean the HTML first.
  • Picture of Bert van der Hooft
    Mon, 2 Jul 2018, 1:19 AM
    Doesn’t work in 3.5
  • Davo
    Mon, 2 Jul 2018, 1:35 AM
    That's not the most helpful if descriptions - is there anything in particular that doesn't work in 3.5, is there an error message?
  • Miriam Fischer
    Thu, 16 Aug 2018, 4:13 PM
    Hi, is there a new release planned 3.4 / 3.5 onwards?
    Thanks you all for your great work so far!
1 2
Please login to post comments