External HTML Object and JavaScript to create a PDF
February 24, 2016 12:00 AM
Hi,
So I've read a couple of posts here in the forums about creating a pdf certificate/learning journal in Lectora, and I've kinda gotten the logic of how to go about it, but I think I've hit a wall.
Here's what I have right now:
Page 1: one question and an entry field, a "save" button, and a "view" button
Entry field details go into variable Entry001
Save button has an action that modifies a variable "Answer01" to be equal to Entry001.
view button goes to next page.
Page 2: shows text with the same question and a text box that, on page show, has its contents changed to Answer01. There's also a button called "Download to PDF".
undefined
Using jsPDF, I know I'm supposed to create an external html object that includes the .js files I need, and in the external html object, I write a function that:
- creates a pdf file
- brings the variable Answer01 into the pdf
- and then on the "Download PDF" button, I hook up an action that runs the function that I created to save the PDF.
undefined
How do I go about this? Has anybody had any luck generating something like this?
Discussion (3)
There you go: https://dl.dropboxusercontent.com/u/11433463/trivantis/jsPDF/html/index.html
Also, here's the source: https://dl.dropboxusercontent.com/u/11433463/trivantis/jsPDF/source.zip
This is exactly what I was looking for! Thanks Sergey!
I want to print all variables in a single pdf. Please help me out. How can I do this?
Discussions have been disabled for this post