Printing User Input to a PDF

Greetings - 

I've seen multiple threads on this, tried one (it did not work). 

Anyone know if I can allow the user to print their text input?

So, I have an activity with a number of text input areas. At the end I would like to provide a print results button that, when clicked, will take all of the user inputs (held in a number of variables), open a new window and dispay the user  text in a PDF. 

I have taken this JavaScript (from someone else's solution, which did not work for me) and put it on a button (execute JavaScript when clicked). I have also included two files that I was told to, a print.html, and a logo.png in the folder main output folder. 

I know little of JavaScript, any help is appreciated. 

JavaScript is:

var player = GetPlayer();
var header = "CL700 Mod 3 Free Online Research~~"
var args =(
"Question 1~~" +
player.GetVar("Q1") +
"~~Question 2~~" +
player.GetVar("Q2") +
"~~Question 3~~" +
var url = ("print.html?=" + header + args);,”_blank”,”width=800,height=600,menubar=no,scrollbars=yes”);

12 Replies
Glenn Jones

Hi Amy

I tried to figure this one out myself a while solution I could find required the end user having some specific piece of software installed at their end - so I gave up!

I've found this today which talks about saving variables to a text file which gets saved locally - no idea if it's of any use to you... 

Patty Brandt

Hi all, I am wondering if you could help me figure out a problem I am having with a Storyline 360 interaction. I created a "cover page" activity and when done, I want the users to print their cover page to a PDF, which I am able to do with the Print button function. No problem there whatsoever. However, when I tested printing to a PDF on my desktop yesterday, the PDF print out looked perfect, but today when I printed my cover page to a PDF from my laptop, the PDF is distorted.