Forum Discussion
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.
- SaraBean-da7305Community Member
I have been able to get this to work with outstanding results. The only things I am still struggling with, and it seems like a small detail but will impact the UX in the end, is text wrapping.
I know how to set text wrapping in Storyline and I know how to set text wrapping in Adobe. Somehow, the two aren't working together. When the text comes over in the PDF, if I set the Adobe form as "Auto" size and "Multi line", text that would normally overflow and, therefore, wrap, does not. It just disappears.
I've tried looking at some forums to paste some additional script into storyline to help prior to it coming over but then the form doesn't execute at all.
Anyone have anything like this happen and, if so, what did you do?
- JohnCooper-be3cCommunity Member
Hi Sara
When I started this thread I was using the jsPDF library to create pdf's - for reasons explained in this thread (and others I have posted) I now use pdf-lib.
Can I just check? You mention the 'Adobe Form' so I'm guessing this question relates to using pdf-lib?
I don't know the answer to your question, but I'm also hoping someone else might be ableto suggest a solution.
AS I understand it, the problem is that, when setting the field properties in the receiving pdf form, these would appear to be the options:
I know there are problems if we try and set the "Allow Rich Text Formatting" flag - and my understanding (but I may be wrong) is that the pdf-lib JavaScript library just doesn't support RTF. In which case this might be related to your issue.
Basically, you lose all formatting when you capture the text entry in Storyline and then write it to the pdf form field via pdf-lib. Meaning this is not an approach that is really suited to long-form answers. THIS IS NOT TRUE - SEE POST BELOW
In our design we just stick to short (one paragraph) answer type questions in Storyline.
BUT - this does raise an interesting challenge of how to overcome this restriction if anyone is up for it??
- SaraBean-da7305Community Member
Hi John,
Thanks for the speedy response.
I have read the other thread in detail - SO MUCH great stuff there. And I am using pdf-lib for all the reasons you mentioned here and on that thread.
The boxes I have checked in the dialog above are "Check spelling" (not that it applies to this issue) and "multi-line". "Scrolling" is not checked, nor is "Rich text", as I understand those cause issues.
My submissions are a mix between short form and long form.
I too put the challenge out to the group!
- JohnCooper-be3cCommunity Member
You need to check both "Multi-line" and "Scroll Long Text" as this will (a) left justify the output text and (b) ensure you get word wrapping.
But, as you say, leave "Allow Rich Text Formatting" unchecked. I have confirmed that pdf-lib doesn't support RTF.
- JohnCooper-be3cCommunity Member
In the post I removed I was looking at the output text in a demonstration I was working on and, in my case, line breaks were not being transferred to the output pdf...
...and I was trying to explain this - BUT then I realised, the demo I was testing was a RISE course where the text input was being stored in SCORM 2004 memory before being retrieved and then written to the pdf - and, in this case, I was losing the line breaks.
When I tested on a straightforward demo just using Storyline, the line breaks appear fine. I obviously have more work to do on my RISE demo. :)
It would appear that plain text formatting (NOT rich text formatting) gets transferred to the output pdf. So my earler comments about losing ALL formatting are WRONG - you just can't use Rich Text formatting.
Sorry
- SaraBean-da7305Community Member
John! It worked! Thank you!!!! Every other forum (regarding Adobe) suggested NOT checking "scrolling" so I didn't, thank you for including this.
This wraps up a long, interesting learning experience that once again showed me the value of this forum.
Now that it is "fixed", I'm including a link to a resource that I made for my team showing how to do this. I'm a senior instructional designer at New York Life and often train my team on different bits and bobs of the technical aspects of the job so I put this little thing together for them and held a short training session.
I'll put a link to download the .story and the PDF file in the comments on Review.
https://360.articulate.com/review/content/3b3e97ba-fa9a-4dcd-a378-aba59cde4898/review
- JohnCooper-be3cCommunity Member
You are most welcome. Glad it worked.
Profile Learning Technologies
Hi John!
I just wanted to pop in and share that it looks like part of your e-mail signature came through when you replied via e-mail. You can remove that if needed by clicking ‘Edit’ beneath your response.
- Here’s a quick Peek video if you need help!