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...
MichaelAmbech
7 years agoCommunity Member
For those of you who work in an international setting I have the following UTC time code running in my certificate.html:
// Get todays date in format dd/mm/yyyy
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth() + 1; //January is 0!
var yyyy = today.getFullYear();
if (dd < 10) {
dd = '0' + dd
}
if (mm < 10) {
mm = '0' + mm
}
date = today.toUTCString();
And further down when defining the body of the document:
// Include date
{
text: '\n\n\n\n\nAwarded on: ' + date,
fontSize: 16,
alignment: 'center',
margin: [0, 0, 0, 0]
},
]
};