1
I used jQuery and jsPDF to generate PDF of the content of a DIV, the code created:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.5/jspdf.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.min.js"></script>
<div id="geraPDF">
[conteudo1]
[conteudo2]
[conteudo3]
</div>
<button class="btn btn-danger" id="btnPDF">Gerar PDF</button>
<script type='text/javascript'>
$(document).ready(function(){
$('#btnPDF').click(function() {
var doc = new jsPDF('landscape');
doc.addHTML($('#geraPDF'), function() {
doc.save("relatorio_pesquisa.pdf");
});
});
});
</script>
But the PDF displays only part of the content, only [content1], [content2]. [content3] is not being exported.
I believe that because the content is extensive, is generating only one page and I do not know how to configure the parameters of jsPDF to continue the number of pages, or continuous page, I have read the content of the official website but is lacking information.