Is there any function where I can mount a header in a pdf, through the javascript language?

Asked

Viewed 109 times

2

I’m starting to mess with the HTML/Javascript language now and I need to generate a pdf with a header, but I don’t know how, I just found code in php and I don’t know if it works.

1 answer

1

There is a plugin called jsPDF, try using it. Example:

window.onload = function() {

  var doc = new jsPDF();

  doc.text(20, 20, 'Criando um cabeçalho.');

  doc.setFont("courier");
  doc.setFontType("normal");
  doc.text(20, 30, 'Escrevendo num pdf.');


  doc.save('Teste.pdf');
}
<script src="http://mrrio.github.io/jsPDF/dist/jspdf.min.js"></script>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.