I made a simple webpage (html) with several JavaScripts, something like a quiz. Users fill in text fields and press buttons for answers and when they click Submit button after which the JavaScrript calculates the score and presents it.
So, my page is index.html, and when user clicks submit, it is still on this page, but it show the results, something like: WELL DONE! Name, id, email etc (get from text fields) Your score is: 144 (this is calculated by JS).
So, now, I want to add a button below this result, that will say for example "PDF". And when user clicks it, it will open in new tab a pdf document with the results on index.html after calculating. And the pdf should be formated like an index.html page.
I was trying to find out how to do this pdf thing, and I couldn't find a solution. The problem is that I want this page to open locally, not on a server. Can you suggest me how to do that, maybe to use PHP (but it won't work locally). I just want to copy paste html file and JavaScripts on whatever computer, and need to work there locally also. Just open in browser and complete quiz, and then export results as pdf.
Thanx