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

170
Visualizações
PDF Form fill using javascript library

I'm building a web app in which I need to fill PDF forms dynamically. At the end result I want the editable PDF forms with Dynamically set values.

I had used PDFTK to fill the pdf forms in PHP but I'm unable to run it on Live server and does not meet the requirement of Editable PDF form Output. That's why I'm finding the JavaScript library so I can fill PDF forms remaining as PDF form Editable.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

This literally drove me insane about 2 months ago. So basically, there are 2 approaches here:

  1. Have a backend that you'd send values to, and it would fill out the PDF, upload it somewhere and send you a link. Or just send you the file itself as a blob. (fail-safe if all the other solutions fail. Way more robust from my experience)
  2. What you're looking for-- a frontend solution that would take user input, fill out a PDF template that you prepared beforehand.

I implemented both, but since you're more interested in option 2, here's how I did it:

I used this package

https://github.com/phihag/pdfform.js/blob/master/README.md

Alongside with a PDF form template. The way I filled it out was by passing an array of values that match up the PRF form's fields names!

Like this:

let filledPdf = pdfform().transform(arrayBuffer, {"field1Name":[field1Value],"field2Name" : [field2Value]  })
                const blob = new Blob([filledPdf], {type: "application/pdf"});

            setBlobContents(blob);

            pdfFile = blob;

            setBlobLink(URL.createObjectURL(blob))

It should be straight forward if you look at the documentation of the link I provided.

about 4 years ago · Juan Pablo Isaza Relatório
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