2
I’m using the jsPDF to make a report from some user input data, however I am having many difficulties to make the report beautiful even more due to the fact that I do not know how to customize much with the jsPDF. So there are templates ready for that tool?
In addition it has support to generate graphics and put in the report (PDF)?
Below I left as this my code at this time:
var doc = new jsPDF();
doc.setFontSize(22);
doc.text(40, 20, 'Relatorio - Departamento de Projetos');
doc.setFontSize(18);
doc.text(20, 40, 'Mes Anterior');
doc.setFontSize(12);
doc.text(20, 50, 'Data Inicio: ' + dtInicio1);
doc.text(100, 50, 'Data Fechamento: ' + dtFechamento1);
doc.text(20, 60, 'Projetos em Desenvolvimento: ' + pDesen1);
doc.text(20, 70, 'Projetos em Analise: ' + pAnalise1);
doc.text(20, 80, 'Projetos Cancelados: ' + pCancel1);
doc.setFontSize(18);
doc.text(20, 120, 'Mes Atual');
doc.setFontSize(12);
doc.text(20, 130, 'Data Inicio: ' + dtInicio2);
doc.text(100, 130, 'Data Fechamento: ' + dtFechamento2);
doc.text(20, 140, 'Projetos em Desenvolvimento: ' + pDesen2);
doc.text(20, 150, 'Projetos em Analise: ' + pAnalise2);
doc.text(20, 160, 'Projetos Cancelados: ' + pCancel2);
doc.save('Relatorio-DP.pdf');
Welcome. I think the question would be even more interesting if you create a Snippet and post the Jspdf documentation link.
– Marconi
Well I’ll put the link to the documentation, but what would be a Snippet?
– Jean Santos
Not officially, but since it accepts images and a bit of HTML then it might be better to look for specific libraries like Fabric.js or Raphal.js and take the generated Graphics to export to image and add to your PDF.
– Guilherme Nascimento
Vlw by tip, but in the case of templates or pdf templates there is some ready to use?
– Jean Santos