Forum Discussion
Creating downloadable pdf files in Storyline - an update on earlier methods
๐ณ๐๐พ๐๐พ ๐๐บ๐๐พ ๐ป๐พ๐พ๐ ๐๐บ๐๐ ๐พ๐๐ผ๐พ๐ ๐ ๐พ๐๐ ๐๐๐๐๐ ๐๐๐พ๐ ๐๐๐พ ๐๐พ๐บ๐๐ ๐๐ ๐ผ๐๐พ๐บ๐๐๐๐ ๐๐ฝ๐ฟ ๐ฟ๐๐ ๐พ๐ ๐ป๐ ๐๐๐๐๐ ๐ฉ๐บ๐๐บ๐ฒ๐ผ๐๐๐๐ ๐ฟ๐๐๐ ๐๐๐๐๐๐ ๐ฒ๐๐๐๐๐ ๐๐๐พ (๐พ.๐. Saving Storyline Variables to a PDF - Articulate Storyline Discussions - E-Learning Heroes) ๐บ๐๐ฝ ๐จ ๐๐บ๐๐พ ๐๐บ๐ฝ ๐๐พ๐ ๐ ๐ฟ๐๐๐ ๐๐บ๐๐ ๐๐พ๐๐๐พ๐ ๐๐ ๐๐๐๐ ๐๐๐๐พ ๐๐๐พ๐ ๐จ ๐๐บ๐ ๐๐๐๐๐๐บ๐ ๐ ๐ ๐๐๐๐๐๐ ๐๐ ๐ฟ๐๐๐๐๐พ ๐๐ ๐๐๐ ๐ฟ๐๐ ๐๐๐๐พ๐ ๐ฟ.
๐ฌ๐๐๐ ๐๐ฟ ๐๐๐พ ๐บ๐๐๐๐ผ๐ ๐พ๐ (๐ ๐๐๐พ ๐๐๐พ ๐๐๐พ ๐บ๐ป๐๐๐พ) ๐บ๐๐พ ๐ฟ๐บ๐๐๐ ๐ ๐๐ ๐ฝ ๐๐๐ ๐บ๐๐ฝ ๐บ๐ฝ๐๐๐ผ๐บ๐๐พ ๐๐๐๐๐ ๐๐๐พ ๐ฉ๐บ๐๐บ๐ฒ๐ผ๐๐๐๐ ๐ผ๐๐ฝ๐พ ๐ ๐๐ป๐๐บ๐๐ "๐๐๐ฏ๐ฝ๐ฟ". ๐ ๐๐๐๐๐ผ๐บ๐ ๐บ๐๐๐๐๐บ๐ผ๐ ๐๐๐๐ ๐ฝ ๐ป๐พ ๐๐ ๐ผ๐บ๐๐๐๐๐พ ๐๐๐๐ ๐ ๐พ๐บ๐๐๐พ๐'๐ ๐๐๐๐๐ ๐๐๐๐๐ ๐๐พ๐๐ ๐พ๐๐๐๐ ๐๐บ๐๐๐บ๐ป๐ ๐พ๐ ๐๐ ๐ฒ๐๐๐๐๐ ๐๐๐พ - ๐บ๐ ๐๐๐พ ๐พ๐๐ฝ ๐๐ฟ ๐๐๐พ ๐ผ๐๐๐๐๐พ ๐๐๐ ๐๐๐ผ๐ ๐๐ฝ๐พ ๐บ ๐ป๐๐๐๐๐ ๐๐๐บ๐ ๐๐๐๐๐๐พ๐๐ ๐๐๐๐พ ๐ฉ๐บ๐๐บ๐ฒ๐ผ๐๐๐๐ ๐๐๐๐ผ๐ ๐๐๐๐ ๐ฝ ๐๐๐พ๐ ๐๐พ๐๐๐๐พ๐๐พ ๐๐๐พ ๐ฒ๐๐๐๐๐ ๐๐๐พ ๐๐บ๐๐๐บ๐ป๐ ๐พ๐, ๐๐พ๐บ๐ฝ ๐๐ ๐บ ๐๐๐ ๐๐ ๐๐๐ ๐๐๐บ๐๐พ ๐๐ฟ ๐บ ๐๐ฝ๐ฟ ๐ฟ๐๐ ๐พ ๐๐บ๐๐พ, ๐๐๐๐พ๐๐ ๐๐๐พ ๐๐พ๐๐๐๐๐พ๐ฝ ๐๐พ๐๐ ๐บ๐ ๐๐๐พ ๐บ๐๐๐๐๐๐๐๐บ๐๐พ ๐ ๐บ๐๐ฝ ๐ ๐ผ๐๐๐๐ฝ๐๐๐บ๐๐พ๐ ๐๐ ๐๐๐พ ๐๐บ๐๐พ, ๐บ๐๐ฝ ๐๐๐พ๐ ๐ผ๐บ๐ ๐ ๐บ ๐ฟ๐๐๐ผ๐๐๐๐ ๐๐ "๐๐บ๐๐พ" ๐๐๐พ ๐๐พ๐๐๐ ๐๐บ๐๐ ๐ผ๐๐๐๐ ๐พ๐๐พ๐ฝ ๐๐ฝ๐ฟ.
๐ณ๐๐พ ๐ ๐พ๐บ๐๐๐พ๐ (๐ฝ๐พ๐๐พ๐๐ฝ๐๐๐ ๐๐ ๐๐๐พ๐๐ ๐ป๐๐๐๐๐พ๐) ๐๐๐๐ ๐ฝ ๐ป๐พ ๐๐๐พ๐๐พ๐๐๐พ๐ฝ ๐๐๐๐ ๐บ๐ ๐๐๐๐๐๐ ๐๐ '๐๐บ๐๐พ' ๐๐ '๐ฝ๐๐๐๐ ๐๐บ๐ฝ' ๐๐๐พ ๐ฟ๐๐ ๐พ.
๐ข๐๐พ๐บ๐๐๐๐ ๐๐๐ ๐๐๐๐ ๐พ ๐๐บ๐๐พ ๐๐ฝ๐ฟ'๐ ๐๐บ๐ ๐ผ๐๐๐๐ ๐๐ผ๐บ๐๐พ๐ฝ - ๐ป๐๐ ๐บ๐ ๐๐ ๐๐๐๐๐๐ป๐ ๐พ. ๐จ'๐๐พ ๐๐พ๐๐๐๐๐บ๐ ๐ ๐ ๐ฝ๐๐๐พ ๐๐บ๐๐ ๐๐๐ผ๐ผ๐พ๐๐๐ฟ๐๐ ๐๐๐๐๐พ๐ผ๐๐ ๐๐๐๐๐ ๐๐๐๐ ๐บ๐๐๐๐๐บ๐ผ๐ ๐ฟ๐๐ ๐ฝ๐๐๐๐ ๐๐บ๐ฝ๐๐๐ ๐ผ๐๐๐๐๐พ ๐๐๐๐พ๐, ๐๐๐๐๐พ๐ ๐๐พ๐๐๐ ๐๐ ๐๐ ๐ผ๐พ๐๐๐๐ฟ๐๐ผ๐บ๐๐พ๐.
๐ฆ๐ผ ๐๐ต๐ ๐ฎ๐บ ๐ ๐ป๐ผ๐ ๐ฎ๐ฑ๐๐ผ๐ฐ๐ฎ๐๐ถ๐ป๐ด ๐ฎ ๐ฑ๐ถ๐ณ๐ณ๐ฒ๐ฟ๐ฒ๐ป๐ ๐ฎ๐ฝ๐ฝ๐ฟ๐ผ๐ฎ๐ฐ๐ต?
๐ถ๐พ๐ ๐ , ๐ ๐๐๐พ ๐๐๐พ ๐บ๐๐๐๐ผ๐ ๐พ๐, ๐๐๐ฏ๐ฝ๐ฟ ๐๐ ๐บ ๐ ๐๐ป๐๐บ๐๐ ๐๐๐บ๐ ๐๐บ๐ ๐ป๐พ๐พ๐ ๐บ๐๐๐๐๐ฝ ๐๐๐๐พ ๐๐๐๐พ. ๐จ๐ ๐ฝ๐๐พ๐ ๐บ ๐๐๐๐ฝ ๐๐๐ป ๐บ๐๐ฝ ๐๐๐๐๐๐บ๐๐ฝ๐ ๐๐ฟ ๐ฉ๐บ๐๐บ๐ฒ๐ผ๐๐๐๐ ๐๐๐๐๐๐บ๐๐๐พ๐๐ ๐๐พ๐ ๐ ๐๐ ๐๐. ๐จ๐ ๐ผ๐บ๐ ๐ผ๐๐พ๐บ๐๐พ, ๐บ๐๐ฝ ๐๐บ๐๐พ ๐๐ฝ๐ฟ'๐ ๐๐๐๐ ๐ฟ๐๐๐พ. ๐ง๐๐๐พ๐๐พ๐, ๐บ ๐๐๐๐พ ๐๐พ๐ผ๐พ๐๐ ๐ฉ๐บ๐๐บ๐ฒ๐ผ๐๐๐๐ ๐ ๐๐ป๐๐บ๐๐ "๐๐ฝ๐ฟ-๐ ๐๐ป" ๐๐บ๐ ๐บ ๐ซ๐ฎ๐ณ ๐๐๐๐พ ๐ฟ๐๐๐ผ๐๐๐๐๐บ๐ ๐๐๐. ๐จ๐ ๐๐บ๐๐๐๐ผ๐๐ ๐บ๐, ๐๐ ๐ผ๐บ๐
๐๐๐ฝ๐๐ฟ๐ ๐พ๐๐๐๐๐๐๐ ๐๐ฝ๐ฟ'๐
๐ผ๐๐พ๐บ๐๐พ, ๐ฟ๐๐ ๐ ๐บ๐๐ฝ ๐ฟ๐ ๐บ๐๐๐พ๐ ๐๐ฝ๐ฟ ๐ฟ๐๐๐๐
๐บ๐ฝ๐ฝ, ๐๐๐๐พ๐๐ ๐บ๐๐ฝ ๐๐พ๐๐๐๐พ ๐๐บ๐๐พ๐ ๐ฟ๐๐๐ ๐บ ๐๐ฝ๐ฟ
...๐บ๐๐ฝ ๐บ ๐๐๐๐ ๐พ ๐ ๐๐ ๐๐๐๐พ.
๐ณ๐๐๐ ๐๐พ๐บ๐๐ ๐๐๐บ๐ ๐๐๐๐๐พ๐บ๐ฝ ๐๐ฟ ๐๐บ๐๐๐ฟ๐๐ ๐ ๐ ๐๐๐๐๐๐๐ ๐๐๐ ๐๐๐พ๐๐พ ๐๐๐ ๐๐พ๐พ๐ฝ ๐๐ ๐๐ ๐บ๐ผ๐พ ๐๐๐พ ๐๐พ๐๐ ๐๐ ๐พ๐บ๐ผ๐ ๐๐บ๐๐พ ๐๐ฟ ๐๐๐พ ๐๐ฝ๐ฟ, ๐๐๐ ๐ผ๐บ๐ ๐๐๐๐๐ ๐ ๐ฝ๐พ๐๐๐๐ ๐บ ๐๐ฝ๐ฟ ๐ฟ๐๐๐, ๐๐บ๐๐พ ๐๐๐พ ๐ฟ๐๐พ๐ ๐ฝ๐ ๐บ๐๐ฝ ๐๐๐พ๐ ๐๐๐พ ๐๐๐พ ๐๐พ๐๐๐๐พ๐๐พ๐ฝ ๐๐บ๐๐๐บ๐ป๐ ๐พ๐ ๐ฟ๐๐๐ ๐ฒ๐๐๐๐๐ ๐๐๐พ ๐๐ '๐ฟ๐๐ ๐ ' ๐๐๐ ๐๐๐พ ๐ฟ๐๐๐.
๐ถ๐พ ๐๐บ๐๐พ ๐ป๐พ๐พ๐ ๐บ๐๐บ๐๐พ ๐๐ฟ ๐๐ฝ๐ฟ-๐ ๐๐ป ๐ฟ๐๐ ๐๐๐๐พ ๐๐๐๐พ ๐ป๐๐ ๐๐พ๐๐พ๐ ๐ฟ๐๐๐๐ฝ ๐๐๐พ ๐๐๐๐พ ๐๐ ๐ฝ๐ ๐บ๐๐๐๐๐๐๐ ๐บ๐ป๐๐๐ ๐๐ (๐๐๐๐๐ ๐๐๐พ ๐๐ ๐ฝ ๐๐๐๐๐๐บ๐๐๐พ๐๐' ๐บ๐ฝ๐บ๐๐พ "๐๐ฟ ๐๐๐๐ ๐ผ๐๐ฝ๐พ ๐๐ ๐๐๐๐๐๐๐ ๐ฝ๐๐'๐ ๐๐๐ ๐บ๐๐ฝ ๐ฟ๐๐ ๐๐"). ๐ฎ๐๐พ๐ ๐๐๐พ ๐ข๐๐๐๐๐๐๐บ๐ ๐ป๐๐พ๐บ๐ ๐๐-๐ป๐พ๐๐๐พ๐พ๐ ๐ผ๐พ๐ ๐พ๐ป๐๐บ๐๐๐๐๐ (๐บ๐๐ฝ ๐๐๐๐ป๐บ๐ป๐ ๐ ๐ฟ๐๐พ๐ ๐พ๐ฝ ๐ป๐ ๐๐๐ ๐๐๐ผ๐ ๐ฟ๐พ๐๐๐๐๐พ ๐๐๐๐๐๐ ๐๐ ๐๐ผ๐ผ๐บ๐๐๐๐๐) ๐๐พ ๐๐พ๐๐พ ๐บ๐ป๐ ๐พ ๐๐ ๐๐พ๐ ๐บ ๐๐พ๐ (๐ป๐๐ ๐๐พ๐๐ ๐ป๐บ๐๐๐ผ) ๐ฝ๐พ๐๐๐๐๐๐๐บ๐๐๐๐ ๐๐๐๐๐๐๐ ๐๐๐๐ผ๐ ๐ผ๐บ๐ ๐ป๐พ ๐๐๐พ๐๐พ๐ฝ ๐๐พ๐๐พ:
https://demo5.profilelearning.com
๐ฎ๐, ๐๐๐๐ ๐๐๐'๐ ๐บ ๐๐พ๐๐ ๐๐๐๐๐พ๐๐๐๐๐พ ๐ฝ๐พ๐๐ - ๐ป๐๐ ๐๐พ ๐บ๐๐พ ๐๐๐๐๐๐๐ ๐๐ ๐๐ - ๐บ๐๐ฝ ๐๐๐ ๐ ๐๐๐ป๐ ๐๐๐ ๐๐๐ ๐๐ ๐๐๐๐พ๐พ ๐๐๐๐พ ๐บ๐๐๐๐ผ๐ ๐พ๐ ๐พ๐๐๐ ๐บ๐๐๐๐๐ ๐บ ๐ป๐๐ ๐๐๐๐พ ๐บ๐ป๐๐๐ ๐๐๐๐ ๐ผ๐๐ฝ๐พ ๐ ๐๐ป๐๐บ๐๐ ๐บ๐๐ฝ ๐บ๐ ๐๐ ๐บ๐ป๐๐๐ '๐๐๐ฝ๐พ๐๐ ๐ฉ๐บ๐๐บ๐ฒ๐ผ๐๐๐๐'
๐๐๐๐ ๐๐ผ ๐๐ต๐ฒ๐ ๐๐ผ๐๐ฟ ๐ฎ๐ฝ๐ฝ๐ฒ๐๐ถ๐๐ฒ ๐ฎ ๐น๐ถ๐๐๐น๐ฒ ๐ณ๐๐ฟ๐๐ต๐ฒ๐ฟ ๐๐ผ ๐ฏ๐ผ๐ผ๐ธ๐บ๐ฎ๐ฟ๐ธ ๐๐ต๐ถ๐ ๐ฝ๐ผ๐๐ - ๐๐ฒ ๐ฎ๐น๐๐ผ ๐ต๐ฎ๐๐ฒ ๐๐ต๐ฒ ๐ฎ๐ฏ๐ผ๐๐ฒ ๐ฑ๐ฒ๐บ๐ผ๐ป๐๐๐ฟ๐ฎ๐๐ถ๐ผ๐ป ๐๐ผ๐ฟ๐ธ๐ถ๐ป๐ด ๐ถ๐ป ๐ฅ๐๐ฆ๐....
86 Replies
- NedimCommunity Member
Thank you very much, John!
- HunterBlakeCommunity Member
I am late to the party, but REALLY want to pull this off. I am working on a Roles and Actions course that will culminate in a "Now go do it!" kind of sheet. I would love for them to be able to download it. I worked the JS into what I needed(Story attached). I have the document(attached as well). I think all of it looks good. I am publishing to a LMS from Storyline and telling it to create a Zip file. I have put my document ALL OVER the zip file to try to make sure it found the document. When I preview it or load it into the LMS and go through it, when I click the button nothing happens.
Now, interesting fact, I loaded your notes demo in the LMS and in preview from Storyline and nothing happens with it either. SO, I am think my code my be good, but it is not finding a file.
I have also changed the URL for the document to our SharePoint site and that does nothing too.
Help me Obi-Won Kenobi!
PS: I added triggers to fill out what you can see on the screen and then I got smart with the things your can't but are on the PDF and added it to the variable default. :)- MichaelGallagheCommunity Member
Hi HunterBlake,
There were a few things wrong in your course.
In the Javascript code in the StoryLine course you tell the code that the pdf document is named "Roles_Goals.pdf" but the PDF document you created is named Goals_Actions.pdf. To fix, rename the PDF document "Roles_Goals.pdf"
Next, in the Javascript code in StoryLine you have the following code:
Body = player.GetVar("Body");
Mind = player.GetVar("Mind");
Spirit = player.GetVar("Spirit");
Heart = player.GetVar("Heart");but you named the variables in StoryLine Self_Care_Body,Self_Care_Mind, Self_Care_Spirit, and Self_Care_Heart
The fix here is to rename the variables in StoryLine to Body, Mind, Spirit, and Heart.
Cheers!
Mike G
- ToddVillariCommunity Member
There was a Chrome security update that stopped this from working at my company. That could by why loading the demo to your LMS doesn't work either.
- NedimCommunity Member
Replace the following part of the code with the one below. Ensure that const formUrl = ''; exactly matches the name of the PDF file located in the root folder.
var player = GetPlayer(); Role1 = player.GetVar("Role1") ?? ""; Role2 = player.GetVar("Role2") ?? ""; Role3 = player.GetVar("Role3") ?? ""; Role4 = player.GetVar("Role4") ?? ""; Role5 = player.GetVar("Role5") ?? ""; Role6 = player.GetVar("Role6") ?? ""; Role7 = player.GetVar("Role7") ?? ""; Role8 = player.GetVar("Role8") ?? ""; RolePicked1 = player.GetVar("RolePicked1") ?? ""; RolePicked2 = player.GetVar("RolePicked2") ?? ""; RolePicked3 = player.GetVar("RolePicked3") ?? ""; Action1 = player.GetVar("Action1") ?? ""; Action2 = player.GetVar("Action2") ?? ""; Action3 = player.GetVar("Action3") ?? ""; Body = player.GetVar("Body") ?? ""; Mind = player.GetVar("Mind") ?? ""; Spirit = player.GetVar("Spirit") ?? ""; Heart = player.GetVar("Heart") ?? ""; Time1 = player.GetVar("Time1") ?? ""; Time2 = player.GetVar("Time2") ?? ""; Time3 = player.GetVar("Time3") ?? "";- HunterBlakeCommunity Member
What does this part
?? ""
do?
- SoutheyBlantonCommunity Member
Hi, I know this thread is fairly ancient but I have implemented this PDF creation and it worked fantastically a week ago. I went back to review the course I'm using it in and all of a sudden it doesn't work, it didn't work in Chrome, Firefox, or Edge so I was wondering if anyone else ran into the same problem, did something on the open source Javascript end get changed or blocked? Thanks again as this was a great resource that my team loved when I got it up and running.
- JohnCooper-be3cCommunity Member
Having originally started this thread 3 years ago - I'm glad to have the opportunity to post this very important update as it may affect anyone using the code I loaded. In my original example, I used an 'import' statement to fetch the necessary JavaScript library modules at runtime from unpkg.com and this code started throwing up CORS-related errors in certain browsers last week.
The root cause lies in unpkg.com not consistently sending an "Access-Control-Allow-Origin: *" CORS header with all its returned files. This header is now a mandatory requirement for ESM imports. As browsers enhance their security protocols, this previously functional code may now encounter failures.I've posted a fuller discussion of this issue in the JavaScript discussion group - with some simple ways to fix the problem.
In fairness to PhilMayor, I think he did point out, at the time, some potential risks in using dynamic loading of JavaScript libraries - I certainly seem to remember a discussion with a couple of super heroes on that subject ๐ - but it is just so much more convenient to load code in this way if you don't have easy access to modify the published HTML.
- PhilMayorSuper Hero
Have you looked at the console? Do you get any errors?
- SoutheyBlantonCommunity Member
Hi Phil, I was able to troubleshoot it finally, it was a local server issue and not the code, it's back up and running. Thank you!
- JMorrisonCommunity Member
This is the best thread I've EVER seen in the articulate community. Thanks John! I created a 3 page stunning PDF. However when I put it on the client's lms it fails when it tries to dynamically load the library using unpkg. Is there any way to get a hard copy of pdf-lib that I can include with my published files so I don't need to call to the latest version through unpkg?
- JohnCooper-be3cCommunity Member
Hi JMorrison
It's unfortunate the way the discussion thread works. I posted this as a reply to an earlier post - but it then gets obscurred within the thread:
"Having originally started this thread 3 years ago - I'm glad to have the opportunity to post this very important update as it may affect anyone using the code I loaded. In my original example, I used an 'import' statement to fetch the necessary JavaScript library modules at runtime from unpkg.com and this code started throwing up CORS-related errors in certain browsers last week.
The root cause lies in unpkg.com not consistently sending an "Access-Control-Allow-Origin: *" CORS header with all its returned files. This header is now a mandatory requirement for ESM imports. As browsers enhance their security protocols, this previously functional code may now encounter failures.I've posted a fuller discussion of this issue in the JavaScript discussion group - with some simple ways to fix the problem.
In answer to your question - can you embed the code rather than loading it dynamically? The answer is yes, you can! Just include the JavaScript in your story.html or index .html - something like:
<script src="https://cdn.jsdelivr.net/npm/pdf-lib@1.17.1/dist/pdf-lib.min.js"></script>
(this uses the jsdelivr CDN - which is the repository that works if you use it to load the code dynamically (see the detailed article).
PS - I updated demo5.profilelearning.com from the original post so it now uses jsdelvr.net - it was failing with the same problem as above.
- JMorrisonCommunity Member
Thanks so much John!!
- PhilMayorSuper Hero
If it works in review it will
work in rise no need to embed externally
- EvelineHolmes-0Community Member
JohnCooper-be3cโ I'm really interested in finding out about the coding required to get notes on separate SL files embedded in different locations in a RISE course to print out in one final document at the end. Do you have any notes or a tutorial you could share on this?
Related Content
- 10 months ago
- 5 months ago