Forum Discussion
Creating a pdf file from Storyline running under an LMS
OK - So I finally got round to looking at the JavaScript library pdf-lib.
The reason I was interested in this library as opposed (or as well as) jsPdf is that it provides code that can modify an existing pdf or, importantly, fill in a pdf form.
The latter is what I was really after. I create a lot of Storyline courses that capture learner input throughout the course and then they provide a button to allow the learner to download the course notes (including their input) as a pdf at the end of the course. There is a demo on our website:
Downloadable Learner Notes (profilelearning.com)
This demo - and the courses we have done so far use the jsPdf library. The multipage pdf is created by adding each page as a png image and then using x and y coordinates (read from a table) to position the learner's input on each page. As you can see from the demo, this works just fine. BUT it is a bit of a chore working out and adjusting the position of each text block and truncating the text if it exceeds the character count.
Filling in a pdf form would make this MUCH easier.
As per the discussion above I also wanted to experiment incorporating 'modern' JavaScript modules into Storyline.
I have got the first test working - I have created a simple form with three text fields, created a single storyline screen to capture three input fields and then used pdf-lib routines to fill in the pdf form
Developing Others 1 (profilelearning.com)
So far so good - this works for web publishing - and it is using the latest pdf-lib ES6 modules. I will now test it as a SCORM package and make sure I can make that call to the ES6 modules work.
I will post my findings
Related Content
- 2 months ago