Dataform is able to provide protected PDF files?

Dataform is able to provide protected PDF files?

by Otávio Melo -
Number of replies: 5
Hi,

I'm a bit new using Moodle, and was looking for a way to provide my PDF files in Moodle with the file protection (watermark, username, etc) on each pdf page and ended up finding this page https://moodle.org/mod/forum/discuss.php?d=269859

Then I inserted the Dataform and Dataformview_PDF in Moodle but found some difficulty to understand and configure. I looked for some documentation/tutorials to try to understand how it works the Dataform but not had much success.
I will detail my scenario:
I have a store that sells online courses and use Moodle as the learning platform. I would also sell ebooks, creating a new course in Moodle only to put the ebook of each course. However, I wouldn't want my ebook was copied, and for that, I would put some information on each page of my ebook (PDF). For example: watermark, name of the user who is downloading, etc.

Attached is how I would provide for my clients. When he clicked, open the PDF file with the watermark and user name on each page.

Like I said, I don't quite understand how the DataForm works, and if possible, could someone explain to me if it (or some other tool) is able to do this?

I'm using Moodle 2.7.1+

Thanks
Attachment Exemplo PDF.png
Average of ratings: -
In reply to Otávio Melo

Re: Dataform is able to provide protected PDF files?

by Itamar Tzadok -

Dataform documentation can be found at Dataform module. Essentially the Dataform allows you to create a Moodle activity where the user can add and view content entries. The Dataform PDF view type allows for exporting the activity content (one or more entries) as a downloadable pdf file.

If your requirement is feasible with the Dataform you would add a pdf view, enter the file content in the Entry template (HTML) editor, add some field patterns to capture entry author name, add pdf watermark and other pdf settings. Then when the user is granted permission to download he/she would go into the activity, add an entry and click export to download the content as a pdf file.

Here are some considerations. The content is entered as html and styling depends on css. The pdf library the Dataform uses (which is already included in standard Moodle) doesn't have particulary good support of css. So creating pdf content this way may not produce high quality result. Also, I see in your attached image that some files may be as large as 5 M. I'm not sure that the moodle form html editor would be able to work with that.

You may need a professional solution for creating pdf content if your content is rich or has to be high quality (e.g. Adobe Acrobat Pro). With the files created you can allow users to download them via a Dataform activity, such that the user gets access to the download link only after adding an entry which in turn records the user's access to the file. With a bit of further development we can add functionality that will set the metadata of the user's copy of the pdf file and add the user's name or some other info to the file's properties before downloading.

hth smile

In reply to Itamar Tzadok

Re: Dataform is able to provide protected PDF files?

by Otávio Melo -

Thanks for answering.

Then it generates a PDF content, right? I would not quite what I wanted. I already have all PDF files
ready.

Let's forget the watermark. Is there any tool that I can upload the PDF file and when the user is downloading, his name is on every page? Something that read the PDF, enter the name (or other data), and create a new one?

In reply to Otávio Melo

Re: Dataform is able to provide protected PDF files?

by Itamar Tzadok -

Quick googling suggests that this is a fairly common requirement so there should be solutions out there. See for instance http://www.setasign.com/products/fpdi/demos/tcpdf-demo/. Am not familiar with something that is integrated with Moodle but should be possible with some development. smile

In reply to Itamar Tzadok

Re: Dataform is able to provide protected PDF files?

by Chris P. -

Hi Itamar!

It's a long time since your latest post regarder this comme requirement about moodle community: add visual tags inside PDF before student can download it (university name, user name, etc...)

Do you know if there's something working at this time? I've searched a lot but without success but Moodle community is so huge that I may miss something here smile

Kind regards.

In reply to Chris P.

Re: Dataform is able to provide protected PDF files?

by Itamar Tzadok -

I haven't come across any such Moodle functionality public or private. The required pdf library is not included in Moodle core but can be added via a plugin. How exactly depends on the requirement. It looks doable but then again someone has to comission it. smile