Is there a function in which I can put a header in a pdf, using the javascript language?

2

I am now starting to tweak the HTML / Javascript language and need to generate a pdf with a header, but I do not know how, I just found code in php and I do not know if it works.

    
asked by anonymous 27.06.2015 / 16:59

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>
    
27.06.2015 / 17:44