Forum Discussion
Example files: Generating a certificate from Storyline
This example demonstrates how you can take user input and generate a certificate for printing. Any Storyline variable or score can be used to generate the output. The file and file add-ins are both simple and straight forward. This will only work in the Flash based output. This will not work in the iOS output or HTML5.
To replicate this on your end:
1) Modify the story file to your liking.
2) Extract the add-in zip file above (certificate.html and certificateBG.gif)
3) Copy these two files into your published output directory. You'll need to do this each time you publish.
This is a really basic example. You really can do quite a bit with this including adding a print button, extra fields, collecting values from the LMS like the user's first and last name.
** I noticed a bug when playing with this file setup. I initially thought I would be able to include the certificate files as resources to avoid copy / paste surgery after publish. Unfortunately, Storyline mangled the HTML file on publish. Will be submitting this as a bug.
- FredJanssensCommunity Member
Hi all,
I have the same issue as Shyam and cannot figure out why the Certificate only shows the image and not the content of the javascript (the name and the text replacing - you have passed The Grueler!For that feat, you deserve a break. Take 30 seconds. Then get back to work!)
No nails left, please help!
Thanks in advance.
- JeffreyHurtCommunity Member
Hi Fred,
You have to place the file on a web-based server before the JavaScript works. It doesn't work on your local machine or network. Once I uploaded mine to the LMS, it worked just fine. It's slightly frustrating because you have to upload it to see any changes/modifications. Hope that helps you.
- KathKinchCommunity Member
Hi
I'm really keen to learn how to print certificates - however the links in the first post seem to be broken. Has the content been moved?
Kath
- SteveFlowersCommunity Member
Hi, Kath -
Those are in a shared public Dropbox folder. I'll add them as attachments to this thread later today It's easy to forget that some IT environments block Dropbox.
- KathKinchCommunity Member
Thanks Steve
- SteveFlowersCommunity Member
- SteveFlowersCommunity Member
- JeffreyHurtCommunity Member
Hi Leslie,
I was trying to do the same thing, but it seems that the HTML code is less than perfect for this because not all browsers will force the page to print in landscape. In the style section there is a command you can use that looks like this:
@page {
size: landscape; /* auto is the initial value */}It works on some browsers, but not all. There may be a way to get more browsers to respond, but my HTML knowledge is limited. We opted for help files telling people how to print landscape.- JerryRiskenCommunity Member
Hi Jeffrey,
I apologize for the novice questions, but what do you mean by "style section"? Is this in the print dialog box javascript?
Thanks,
Jena
- JeffreyHurtCommunity Member
Hi Jena,
The "style section" is in the head section of an HTML file, usually where the styles are found.
<html>
<head>
<style>
h1 {color:red;}
p {color:blue;}
</style>
</head>
<body><h1>A heading</h1>
<p>A paragraph.</p></body>
</html>There are several different styles you can apply, but unfortunately most HTML codes/commands for forcing something to print landscape instead of portrait (really anything related to printing) depends on the browser you are using. The ideal solution is to convert to a PDF because that is a standard. While HTML5 is a "standard" Safari, FIrefox, Chrome, and Edge have styles they like and others they ignore.
One of the many reasons the death of Flash is a true tragedy. Hope that helps!
- NeeluBera-2f144Community Member
Hi Jeffrey,
Could you please share a sample storyline file with this functionality? I need to download the certificate with the learner's name on it, to print just as it appears in the storyline slide. Please help.
- LeslieAdamsCommunity Member
Thanks Jeffrey - it's too bad this can't be fixed universally. A limitation of HTML code I guess!
- SteveFlowersCommunity Member
In newer browsers you could rotate your print elements so that it displayed vertically. You could get a portrait print this way with some careful planning. Again, would depend on the browser We've gotten away from the portrait certificate expectation. Most folks won't hang these up anyway, so we modeled a certificate that could easily be punched into a binder for safe keeping. Most folks want these for their records.