Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

222
Visualizações
How can I have like a base pdf with jsPDF

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>
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda