Use mpdf in moodle lesson

Use mpdf in moodle lesson

by Manuel Ruano -
Number of replies: 2

Hi, I need use mpdf in a moodle 1.9 to generate pdf to page of a lesson.

I use this pakage (http://moodle.org/mod/data/view.php?d=13&rid=3907) and follow the instructuions (http://www.t6nis.com/moodle_plugins/Description.txt), but i don`t be abble to show pdf icon, i'm desesperated and i don't find any info in Internet,

Someone knows where add the lines to show pdf icon if i want to print some page of a moodle lesson?

This lines:

include($CFG->libdir.'/mpdf/print.php');

show_pdf_icon($data, false, true, 'absolute', '10px', '50px');

Thanks a lot and sorry about my english.

Average of ratings: -
In reply to Manuel Ruano

Vastus: Use mpdf in moodle lesson

by Tõnis Tartes -
Picture of Core developers Picture of Plugin developers Picture of Testers Picture of Translators

Hi,

I think its not that easy to use this hack for Lesson module. The Lesson module view or report view must be heavily modified to view result correctly in PDF format, using this hack.

Basically, this hack just prints out HTML data what's been added to $data, but in Lesson module the $data variable must be put together from many other variabales and items, which hold information in html form.

This hack works easy for printing books and html resources in PDF, but i would not recommend using it for Lesson module or other types of activities.

It also uses kinda hacky(not secure) way to get the images load into html passing the moodle file.php security, so remember using it on your own risk or dont use at all... (it was my first module, which i wrote, did'nt fell out that good as i found out later...)

I'm planning to rewrite this for Moodle 2.x version, but until that happens use it at your own risk.

In reply to Manuel Ruano

Re: Use mpdf in moodle lesson

by ben reynolds -

Hi, for 1.9, search this forum for Greg Johnson print.css which works for us in 1.9