External HTML Object and JavaScript to create a PDF

rabano9900
Community Member Posts: 7
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".
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.
How do I go about this? Has anybody had any luck generating something like this?
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".
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.
How do I go about this? Has anybody had any luck generating something like this?
Comments
-
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 -
-
Categories
- 35.8K All Categories
- 109 ✫ Announcements
- 33.1K Lectora®
- 31.1K Lectora Discussions
- 28.9K Lectora Desktop
- 2K Lectora Online
- 2K Lectora Feature Requests
- 71 Lectora User Groups
- 36 Lectora Accessibility User Group (LAUG)
- 22 ELB Learning Content
- 22 ELB Learning Content Discussions
- 323 CenarioVR®
- 190 CenarioVR Discussions
- 133 CenarioVR Feature Requests
- 41 Rockstar Learning Platform®
- 38 Rockstar Learning Platform Discussions
- 108 CourseMill®
- 108 CourseMill Discussions
- 47 ReviewLink®
- 47 ReviewLink Discussions
- 7 The Training Arcade®
- 7 The Training Arcade Discussions
- 934 All Things eLearning
- 36 eLearning Development
- 546 Learning Management System (LMS) Integration
- 332 Web Accessibility
- 1.2K ♪ The Green Room
- 9 Additional Learning Products