Forum Discussion
Print ANYTHING in StoryLine
By adding a new tab in the player properties panel and assigning it to execute the "window.print();" JavaScript, you can allow your participants to print any/every slide in your StoryLine projects including "Notes" or "Certificate" slides! No need to create a complex JavaScript course certificate solution, simply build a beautiful slide and let your users print it directly from the StoryLine player!
For SL 3 and 360 users, you can also move, reformat, hide, and reveal the button so you can take control over what users can print.
I've included the screen shots I used in the video in the attached Word document along with the JavaScript code snippets and an SL3 .story file.
- onEnterFrameCommunity Member
@doug,
Maybe you can post a link to your course and I can take a look?
- JeffreyMuiseCommunity Member
I know this is an old thread but harbour hope someone might still be able to help.
I'm having no trouble executing the "window.print();" command, but what I'd like to do is print/save and entire survey built on a single slide within a scroll pane.
I've tried to tweak the code using various element names (like "scroll.area.print();") but to no avail.
If somebody could help me hack this I would be eternally grateful. This printed survey is intended to be a pretty big takeaway for the learner.
Can we print what's in the scroll area div even if it's not all on the screen at once?
- onEnterFrameCommunity Member
For something like that I would probably recommend building a new HTML page that pulls the data from the course. That way you can format/style the page however you wish and use placeholder text. Then when it it is launched use JS to get the values from SL and replace your placeholders. This is also useful when learners are entering free form text because you never know how much (or little) they might enter.
I like to use this HTML2PDF library as it bundles html to canvas conversion with PDF creation and the ability to save/download the file.
[EDIT]
I should add that the library referenced above does not work very well within SL which is another reason why I recommend creating a new HTML page. SL slide content is very layered and much of it is converted to SVG using CSS classes. Those are hard for that library to render correctly.
- LindsayMaiselCommunity Member
This walkthrough is the greatest. Thank you so much, worked flawlessly. <3
- JosephMacriCommunity Member
I am using Storyline 360, and when I go to create a new player tab for a print screen, it does not open a Trigger Wizard-it opens up a Player Tab. Where on the player to I create the trigger?
- MarekJedrykaCommunity Member
Does anyone know if this solution still works? I had it set up in a course 2-3 months ago, and it stopped working after the last Storyline update. Is there a workaround? The thing is that player buttons don't show up in developer tools as separate elements anymore.
- OwenHoltSuper Hero
Are you using the modern player? This was set up with the classic player.
- MarekJedrykaCommunity Member
Hi Owen,
Yes, I am using the modern player. However it did work few months ago, and now I can't see specific buttons in the developer tools so I can't even check if the JavaScript uses the right button names. Do you have any idea how to tackle this? I tried different browsers, but it makes no difference.
- PhilMayorSuper Hero
The underlying player code was revamped in latest build
- Kristin_HatcherCommunity Member
Hi all, I just stumbled across this thread and really appreciate the Javascript to print any page. Now that a recent update to Storyline has "broken" some Javascript, will this still work? Or are there updates we'd need to make to allow it to work? I had originally updated to the latest version of Storyline, but had to roll it back because I need to use some Javascript that has JQuery in it.
- JonWakeman-6a5cCommunity Member
Thanks Owen,
This is great information. Forgive me if this answer is in here, but is it possible to locate the print button at the course end, and have certain slides print - say slide 2, 7, 12, 16 and 20 into a single PDF?
- OwenHoltSuper Hero
"... is it possible to locate the print button at the course end, and have certain slides print - say slide 2, 7, 12, 16 and 20 into a single PDF?"
I don't believe so, at least not without some very elaborate javascript.