SOLUTION: Print A Certificate From Storyline 2 With JavaScript

Jan 27, 2016

With the help of a little JavaScript and HTML trickery, you can get a printed certificate from Storyline 2.  Note that JavaScript is not supported by Articulate, so please don’t harass them if you have problems!

The JavaScript pulls variables from the Storyline Player for the user’s first and last name, as well as the system date and time.  Using this information, it opens a new browser window and writes a very simple Web page to it.  It’s this window that gets printed, and should appear nicely on a 8.5"x11" page.  The window even closes itself for convenience.

You’ll need to copy the logo.jpg and border.jpg files into the Storyline output directory (where you would find the story.html or story.swf file).  These files will disappear if you publish to the same location—keep that in mind if you’re like me and publish frequently to preview things!

There are plenty of ways to customize this to your liking.  You can apply inline Cascading Style Sheets (CSS) to adjust the sizing and positioning of the text, change the text color, alter the fonts, and much more—check out W3Schools to learn more about CSS.  For users comfortable with JavaScript and HTML, you can also optimize this down to a single document.write statement, but I’ve left it in multiple statements to make it easier to understand.  (The second text file has comments to help explain what’s happening each step of the way.)

Hope this helps a lot of folks!

1 Reply
Christie Pollick

Hi, C.L. -- This is great, and thanks for adding "SOLUTION" to your thread title, as that really helps differentiate between questions and contributions!

Thank you for also noting that Articulate is not able to provide support for JS coding, but for those who may need it, here is our JavaScript Best Practices info sheet. :)

This discussion is closed. You can start a new discussion or contact Articulate Support.