Forum Discussion
Create a PDF form from responses with Articulate Storyline?
Hope this helps you.
Hi Joe, any chance you can explain this a little, it works perfectly on your slide, but i just copied and pasted the execute java for the pdf into mine and I can see I need to do something cos it showed a pdf but wasn't connected to my text fields.
- Joe_Dey3 years agoCommunity Member
Hi Jessica, here is your fixed code. To add new lines just copy what I have done in bold and change the numbers in Step 1 and 2 and the answer title in Step 2.
// Step 1. Connect JavaScript to the Storyline variables
var player = GetPlayer();
var textEntry1=player.GetVar("answerOne");
var textEntry2=player.GetVar("answerTwo");
var textEntry3=player.GetVar("answerThree");
// Step 2. The HTML Section - with the Storyline variables inserted
var contents = "<html><head></head><body style='width:650px;padding:20px;'>";
contents+="<div style='font-size:26px;font-weight:bold;margin-top:26px;margin-bottom:20px;'>Print or save as PDF</div>";
contents+="<div style='display:block;border-width:1px';><hr/></div>";
contents+="<div style='font-size:16px;font-weight:bold;'>Barriers</div>";
contents+="<p>"+textEntry1+"</p>";
contents+="<div style='font-size:16px;font-weight:bold;'>Managing Things</div>";
contents+="<p>"+textEntry2+"</p>";
contents+="<div style='font-size:16px;font-weight:bold;'>Answer Title</div>";
contents+="<p>"+textEntry3+"</p>";
contents+= "</body></html>";
// Step 3. Open the document window, write the HTML contents, and open the print window
var myWindow = window.open("","Print","width=810,height=900,scrollbars=1,resizable=1");
myWindow.document.write(contents);
Related Content
- 11 months ago