Forum Discussion
RyanLowry
10 years agoCommunity Member
Storyline 2 Example - Generating a PDF Certificate for users who successfully complete a quiz
Hi all,
I've been experimenting with a JavaScript PDF library (pdfmake) to generate PDF certificates client side for learners who have successfully completed a quiz in Storyline 2.
You can see a...
RyanLowry
Community Member
It's an easy fix to get this working. In my version the title variable which you've removed is used as part of the filename for the generated PDF. You'll need to amend line 169 in certificate.html so it doesn't include this variable. See below:
//Original
function generatePDF() {
pdfMake.createPdf(docDefinition).download(title + '.pdf');
}
//Fixed
function generatePDF() {
pdfMake.createPdf(docDefinition).download('RiskAssessment.pdf');
}
Hope that helps!
aaronkapala-97b
7 years agoCommunity Member
Hi Ryan,
Thanks again for your help, completely missed that. Again thank you for supplying this, I don't have much experience with JavaScript and now I know the basics from this it is really going to help improve things.