Forum Discussion
Storyline 360 - Generating a PDF Certificate using JavaScript
Using the pdfmake JavaScript library involves including code that generates the pdf certificate from a base image and then carefully overlaying and positioning the text you want to appear on the page. This is a great approach but...
...there is an alternative approach which involves creating the certificate outside of Storyline just as a pdf form and then using the pdf-lib Javascript library inside Storyline to fill in the fields in the form.
This has a number of advantages:
- The JavaScript code is easier.
- You can change the certificate layout and edit the pdf without having to modify your JavaScript code.
- The same JavaScript code can be used for multiple certificate layouts so long as the field names are the same.
- The pdf-lib JavaScript library is built so you can load the rotines you need (and only those you need) at run-time. This means you don't need to modify the HTML after publishing.
I don't have a certificate example but I am running a FREE on-line workshop/ discussion next week (Tuesday) that will walk through and demonstrate the steps to create a downloadable course handout including learner's own notes using pdf-lib. The principle is the same as creating a certificate.
If anyone is interesting in joining this workshop please send me a message and I will provide a link.
- DougDewan9 months agoCommunity Member
Thanks John, I would be interested in attending that workshop, ideally I would like to get the existing solution working so we can close off this project and perhaps look at the alternative approach in follow up as everything is built currently. I think I'm just not recalling the step you need to perform prior to publishing that pulls the cert data into the publish file. (Should have made better notes 2 years ago) :)