Forum Discussion
Storyline 2 Example - Generating a PDF Certificate for users who successfully complete a quiz
Hi Ryan,
This is amazing what you have pulled together. I have just had a request for something in-house and this is what I needed.
I have tried to amend both the Storyline file and the Certificate file as I need to create a Risk Assessment, which once completed I need it to create a PDF document which they can download or if possible email over to their manager. I can't seem to get the PDF to display. I have added a very basic SL file where there are some questions and then based on a checkbox, it will change the variable to a value of Yes or No followed by a comment box for additional information.
If you had a free minute, could you give some guidance on where I have gone wrong please?
Thank you in advance, once I know where I have gone wrong, this could easily be adapted for so much, would be great.
Best wishes,
Aaron
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-97b7 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.