Forum Discussion
Storyline 360 - Generating a PDF Certificate using JavaScript
Hi Doug, it looks like you replaced the background image certificate.jpg with certificate.png. In the browsers console we can see this is causing an error as the image file cannot be found.
You either need to convert your image to a .jpg called certificate.jpg or update line 53 of certifciate.js in the web object source files to reflect the filename of the image you wish to use for the certificates background.
You also need to update line 35 of certificate.js to reflect the name of the variable you are using for the learners name ("uName").
Remember you will need to first delete and then re-add the web object when you make any changes to it.
- DougDewan3 years agoCommunity Member
Hi Ryan, thank you so much for your assistance and patience in walking me through this. I've been able to make it generate the PDF certificate! The formatting is off for the text placement and paper size but think we can fix that. I assume we would update the "certificate.js file for this correct and not the js in the Storyline trigger?
I think this is where I get confused, there are two places for the js content, one in the Storyline course success layer that executes the js file that is in the web object folder. The one in Storyline is just used to trigger the js in the folder, any modifications to the certificate and content on the certificate would be then done to the file in the folder, would this be an accurate assumption?
- RyanLowry3 years agoCommunity Member
No problem at all Doug.
You're right, the JavaScript in the storyline trigger only calls the generatePDF function in certificate.js which generates the PDF.
Any changes you need to make to the format of the certifcate should be made in certificate.js.
- DougDewan3 years agoCommunity Member
Hi Ryan, just curious, are you aware of any way to make the course email a participant their certificate rather than download it?