Creating a pdf file from Storyline running under an LMS

I know there are many excellent examples of how to create a pdf file in Storyline using javascript libraries such as jspdf and I have done this successfully in projects compiled for the web...

...but has anyone tackled this with an lms version? I know you could pass data to the lms using xAPI - but I really just want to click a button and "save" the pdf file created within the course using variables collected during the course.

Any ideas would be welcome.

29 Replies
John Cooper

Hi Mark

I haven't had the need to create multi-page pdf's yet but I see no problem in doing what you suggest. Just generate a new page and then use addimage.

Coincidentally, I submitted a proposal last week to a client that will require multi-page pdf's - so I may have to come to you to find out how to do it :)

I'm also looking at a more extensive javascript library pdf-lib which allows you to modify existing pdf files including filling out pdf forms. It looks really interesting. If I make progress with it I will create an article and publish it here.

John Cooper

Just started work on a multi-page pdf document to be produced at the end of a course for my client. The requirement is that there are four screens in the course where the learner is asked to "reflect" on the section they have just covered and decide what they will do as a result.

Each of these screens has two questions - so there are 8 text responses which I have stored in variables in the course. At the end of the course, the learner will click a button to download a 4-page pdf. Each page has a summary of the section, the questions the learner was asked and their responses.

Code similar to that I published earlier works fine for the first page - the notes page is loaded as an image and the learner responses are positioned on the page to fill in the boxes.

I have added:

doc.addPage('landscape');

to the end of the first page and this successfully throws a pagebreak (there are actually two parametrs to this call - the page size is A4 by default but you can specify a different size as well as the orientation).

I will let you know how I get on...

John Cooper

OK - not trivial JavaScipt as it turns out - but I have solved it and can successfully produce a multi-page 'Notes' pdf document including the learner's own notes collected from text entry boxes through the course.

I will post a separate article on how to do this here on eLearning Heroes and post the link here when I have done it.