Lesson PDF Export

General plugins (Local) ::: local_lessonexport
Maintained by Adam King
This plugin allows lesson modules to be exported to PDF documents with optional protection.
Latest release:
453 sites
298 downloads
64 fans
Current versions available: 2

This plugin visually displays the option to output lesson modules as PDF documents.

There are many settings that come with the PDF export plugin including custom font, footer texts, document protection, cover colours, password protection, strict exporting and more. 

Document pages are ordered the same as each lesson and question pages are also supported, although some answers are not shown (such as short answer questions).

This plugin was developed for use on the SHEilds eLearning platform. If this plugin does not match your use-case, please open a ticket on Github detailing what you require for this to become a useful addition to your Moodle plugins.

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3

Contributors

Adam King (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Comments

  • Adam King
    Fri, 24 Mar 2017, 10:34 PM
    I've no reason to believe why this wouldn't work on Moodle 3.2 but I've just not tested it yet, if you have an instance and are willing to do so before I manage to get around to it then I'd be thrilled to see the result. I'm more than happy to make changes for 3.2 support though!
  • Adam King
    Thu, 30 Mar 2017, 9:51 PM
    Latest release should solve the $settingsnav issue as well as a better regex for finding elements with the class "pagebreak". Please don't put content in the elements with the pagebreak class as regular expressions are not useful for parsing HTML (it's an irregular language). I had issues whilst using the DOMDocumentFragment to manipulate pagebreaks but I will make a better effort to improve breaking in the future!
  • Ladislav Pliska
    Mon, 17 Apr 2017, 2:34 AM
    Hey,
    I have a problem with special (national) characters in pdf exports, but in epub format is OK. Charset is UTF-8, czech language. In pdf file, there's symbol ? instead of the local letters ř, č or š.

    Can you help me ?
    Thanks
  • Ramzi Jildeh
    Wed, 19 Apr 2017, 4:19 PM
    Hi,
    i am working with Arabic lessons , when i want to export the lesson, i get it all ????? , i tried different fonts , but did not work out, is there a way to fix it or add Arabic fonts to use in the Plugins?
    Thanks.
  • Jose Luis Martin Jimenez
    Wed, 19 Apr 2017, 8:16 PM
    Hello, Adam.
    About the $settingsnav issue, I think it's related to the configuration of "Navigation block".
    You can read my contribution in the Github forum thread about this issue.

    Thanks
  • Adam King
    Tue, 25 Apr 2017, 4:35 PM
    Hey, thanks for the heads-up! I believe that issue is now fixed. As for other languages; I've added a right-to-left optional feature and the "?" issue is a font issue. Using "freeserif" as a font-face works, but I'm working on allowing you to upload your own fonts to be used for the next release.
  • Ramzi Jildeh
    Thu, 27 Apr 2017, 2:58 PM
    Hi Adam, thank you for your help, it works now with the "freeserif" when we add that to the default font for the plug-in, and the Arabic text prints well to PDF using that font, but there remains a small thing that the Arabic in the PDF header and footer still showing "???" Is that taking a font from somewhere else? Do you know when the next release will be ready, because we would like to be able to change fonts as you indicated? Thank you for your time and help.
  • Adam King
    Thu, 27 Apr 2017, 5:16 PM
    Hey, I just fixed the issue with the title using its own font; didn't see that one slip past me! I'll release today, but finding a good way to allow font uploads is proving hard. Mostly just because of the nature of the Moodle Files API. I highly recommend downloading this repository https://github.com/tecnickcom/tcpdf and extracting the "fonts" directory to your Moodle data directory (/path/to/moodledata/fonts). This will allow TCPDF to use the fonts it was originally designed to be shipped with such as dejavusans, which works great with Arabic. I will be looking to get these fonts either included with my plugin or uploadable via your own means. Thanks for your patience, in the meantime!
  • Ramzi Jildeh
    Tue, 9 May 2017, 3:24 PM
    Many thanks for your reply and hard work. It seems you've not yet released the new version (as of 9 May). When you do, presumably we can add other Arabic fonts as well in the same way. We have not been able to update the plug-in from the github files for tcpdf. There does not seem to be a fonts folder inside our moodledata folder. Are we doing anything wrong? Do you know if the TCPDF project will make your plug-in obsolete? And could you please advise when ExportPDF might have support for Moodle 3.2.X or 3.3? Thank you so much.
  • Ramzi Jildeh
    Tue, 9 May 2017, 3:42 PM
    A different issue with the plug-in (using the 11 April version): when we use the lesson as a student, and fill in answers and multiple choice questions etc. the answers are submitted, but then do not print when we try to Export the Lesson to PDF. Is there a way that student answers can be printed alongside the lesson text and questions?
  • Adam King
    Fri, 12 May 2017, 5:00 PM
    Hey, apologies for the delay! I've had other projects on the go and it's been a little consuming. I'd love to work on a means to upload fonts from the user interface however fonts need to be converted before being added to the /tcpdf/fonts/ directory. You can convert them online yourself if you want to, http://fonts.snm-portal.com/ but I can also do it with code. The only issue is I need to look into creating a separate page for this, the standard moodle settings from adminlib don't seem to handle uploading to the moodledata directory very well without abstracting the files (hashing, etc), definitely want to move forward with this though.

    TCPDF is a programming library and, as such, shall never replace any project that uses it; it's not something you can use on it's own as somebody needs to write code that incorperates it.

    Regarding your issue, do you want the PDF to include the answers the student submitted? This could prove problematic, given how TCPDF writes HTML but it's not impossible, I imagine it might cause some issues if I start writing code that touches more Moodle internals though as it will date the plugin (make it very easy for it to become incompatible with older or newer versions).

    As it stands, the plugin uses some outdated functionality that will not be there in future versions (YUI, for example), but I want to support as many versions as possible before I have to re-write to use AMD modules and JQuery, among other standards. I'll have to see what needs to change for it to work with 3.2 and 3.3 (if it doesn't already), but I am definitely going to support it as Moodle is moving forward fast and great. It may already work, it may not, I haven't set up a development platform for it yet sadly.
  • Adam King
    Mon, 15 May 2017, 8:13 PM
    Sorry, I should clarify; your Fonts directory is likely under /lib/tcpdf/fonts
  • Adam King
    Tue, 11 July 2017, 9:46 PM
    Custom fonts are now able to be uploaded for use in the plugin (with TCPDF). TCPDF can only convert .ttf and .otf files at the moment, I believe. There is a new version of TCPDF, called tc-lib-pdf, which has the ability to convert fonts on-the-fly, but that's on Moodle to adopt it or not. The new project for TCPDF can be located here https://github.com/tecnickcom/tc-lib-pdf if you want to look into it at all.
  • Adam King
    Wed, 12 July 2017, 11:08 PM
    I've updated the plugin to use AMD modules for 3.0+ support, all changes made can be seen here https://github.com/SHEilds/moodle-local_lessonexport/commit/f3f63266e17ec0eb93705653fc68541db43001fa
  • Arno Wilhelm-Weidner
    Thu, 12 Oct 2017, 5:42 PM
    Hi, is there a possibility to use the plugin with the MathJax-Filter so formulas are displayed correctly?
Please login to post comments