Forum Discussion
Storyline 2 Example - Generating a PDF Certificate for users who successfully complete a quiz
Hi all,
I've been experimenting with a JavaScript PDF library (pdfmake) to generate PDF certificates client side for learners who have successfully completed a quiz in Storyline 2.
You can see an example at http://rlowry.github.io/certificate/story.html
The 1st slide of the example provides a brief overview of how this works. I've tested this successfully in Internet Explorer, Chrome, Firefox, Chrome on Android and Safari on iOS.
I've attached a simple source file that contains a basic .story file as well as a folder (certificate) that includes the required HTML and JavaScript that needs to be included within a web object within the project. Feel free to have a look and re-use if it's useful.
The generated PDF certificate is very basic at the moment, you'll need to refer to the pdfmake documentation to update the design.
UPDATE: Originally this example only worked with the HTML5 output. I've tweaked it so it now works with the Flash output as well. I've updated the attached files to reflect this change.
UPDATE 2: I've updated the attached source files so they now use the latest version of pdfmake (v0.1.27).
Cheers,
Ryan
- KarinFernandesCommunity Member
Thank you very much for your help. You're a star!
- DanielBoliaCommunity Member
Hi Ryan,
Thank you for sharing this method and for taking time to answer questions posted in this forum.
I was able to create a custom certificate solution using your method and technique. However, Once the SL output was loaded on a Gov webserver the PDFmake function would not work. Nothing happens when the function is called.
I noticed that there is a server-side version of the PDFmake, however, the organization I work for will not allow the PDFMake package to be installed on the server. I wonder if you might have experience with this issue and more importantly, a solution.
Thank you for your time,
Dan
- RyanLowryCommunity Member
Hi Dan,
Do you get any error messages in the browser console when the call to PDFmake fails? Does this happen in all browsers or a specific one?
Cheers,
Ryan
- DanielBoliaCommunity Member
Hi Ryan,
Allow me to clarify, your method and my SL file worked as designed. It is only when it's accessed from a government computer, which is running IE-11 on Windows 7 that it doesn't work. From the same government computer using Chrome, it also worked as designed.
The trigger I have for calling the html and pdfmake function doesn't do anything. Because I also have a trigger to advance to the next slide immediately after the pdf trigger, I can't really trouble shoot for error messages.
I have also tested two other certificate methods posted on the forum; https://community.articulate.com/discussions/building-better-courses/create-a-course-certificate-in-storyline-with-java-and-html?page=3#reply-359742 and https://community.articulate.com/discussions/articulate-storyline/saving-storyline-variables-to-a-pdf. In both of these cases, I am also experiencing problems with creating the certificate as designed when I used IE-11. But as in the case above, the certificate function worked as designed in Chrome.
I'd be very pleasantly surprised if you would have any trouble-shooting tip for my problem, as I think it's all related to the configuration of IE-11 installed on the Government computers.
Thank you for your time,
dan
- RyanLowryCommunity Member
Hi Dan,
As you suggest it is probably an IE11 configuration issue on these particular machines.
This method works without issue on my machine with IE11 on Windows 7.
Do you have a sample storyfile I could have a look at?
One other thing, are the users on the government machines accessing the content over an intranet? I've had problems in the past with a compatibility view setting in IE that forces all intranet content to be viewed in compatibility view. I realise you have no control over this setting but it could be the cause of your problems.
Cheers,
Ryan
- DanielBoliaCommunity Member
Hi Ryan,
I suspect that all the issues I'm seeing on IE is related to their flash player configuration, in which case I don't think there is anything I can do about it. I do wonder if it would make any difference to have the administrator add the course url to the exception list.
Regarding your question about users accessing info over the intranet, yes they are. I will certainly check on the compatibility view settings and see if that will make a difference.
One other point I've been curious about, you had mentioned in your post that this method has to published to a server for the script to function. I've always been able to publish to my local hd and able to see the result. Is this due to my less secured settings on IE?
My SL example is attached.
Thank you for your assistance,
dan
Hi Dan. To quickly build on what Ryan brought up about viewing content locally... we don't recommend it. If you view an Articulate Storyline course on your local hard drive (or send it to someone else to view on their local hard drive), you'll encounter security restrictions from the computer, web browser, Flash Player, and network that'll cause various features of your content to fail.
So we always say have a final look at it in its intended final destination (web, LMS, etc)! Here's our knowledge base article about publishing and sharing your project, including ways to view the content offline if you need to do so.
- RyanLowryCommunity Member
Hey Dan,
Had a quick look at your file and all looks good. Have you got the users to try accessing the html5 version? It seems to work in IE11 despite it not been a browser officially supported for html5. Bare in mind I've only tested a very basic file.
My point about publishing to a server only applies to Chrome. Storyline automatically disables web objects and custom javascript when content is viewed locally in chrome as it is not supported by the browser.
Hope you find a solution. Not sure I can help any further. If you do figure it out please post back and let me know.
Cheers,
Ryan
- DanielBoliaCommunity Member
Hi Ryan,
Thank you very much for your time. I will certainly share and post any info I discover. I really do like your method for creating a pdf certificate and I hope that I will be able to use it with our courses.
Best regards,
dan
- DanielBoliaCommunity Member
Hi Ryan,
Although I have not found a solution to the problem of accessing the course certificate when using IE in a citrix environment, I have determined the cause to be the "var Player=GetPlayer" script. Please see my detailed post at https://community.articulate.com/discussions/articulate-storyline/getplayer-script-does-not-work-in-citrix-environment.
Thank you,
dan
- RyanLowryCommunity Member
- GregWaltersCommunity Member
Hi Ryan,
Thank you so, so much - will let you know how I get on.
Have a great day.
Many thanks,
Greg
Thanks Ryan for coming back to share the file for Greg.
- MakaylaPrevosyCommunity Member
Hi all, I am using this for a course that clients will view without any internet access. I am publishing to CD and when I launch the Launch_Story.exe file and get to the last screen with the download button....to no avail----no pdf instantly downloads. I took the exact Storyline template from the original post and published it to test. Any ideas/thoughts why its not working for me?