So I basically want to create a form and then when the person presses the button it will create a pdf with that info and with a already made pdf basically will fill the document but I cant make it work and also wanted to see the preview before exporting but dont work too
<!DOCTYPE html>
<html>
<head>
<title>JSPDF</title>
</head>
<body>
<form id="form">
<input type="number" id="day" placeholder="Dia"/>
<input type="number" id="month" placeholder="Mês"/>
<input type="text" id="nome" placeholder="Nome Completo"/>
<button id="button">GenTest</button>
</form>
</body>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.0.272/jspdf.debug.js"></script>
<script>
var form = document.getElementById('form')
form.addEventListener('submit',function(event){
event.preventDefault()
var day = document.getElementById('day').value
var month = document.getElementById('month').value
var nome = document.getElementById('nome').value
var doc = new jsPDF()
doc.text(day,20,20)
doc.save("cert.pdf")
})
</script>
</html>