Raw Survey Result to Score Index
Score Index:
Min Score: ${min}
Number of Responses: ${numbers.length}
`; document.getElementById("scoreOutput").innerHTML = outputHtml; document.getElementById("scoreResult").style.display = "block"; } document.getElementById("downloadScorePDF").addEventListener("click", function () { const { jsPDF } = window.jspdf; const content = document.getElementById("scoreOutput"); html2canvas(content, { scale: 2 }).then(canvas => { const imgData = canvas.toDataURL("image/png"); const pdf = new jsPDF("portrait", "pt", "a4"); const imgWidth = 500; const imgHeight = canvas.height * imgWidth / canvas.width; pdf.addImage(imgData, 'PNG', 40, 60, imgWidth, imgHeight); pdf.save("survey_score_index.pdf"); }); });