Next question, I have a javascript code that makes it impression of a div by id, but the following is a form, I would like to customize with header and images, it is possible without me having to insert the data into the div ?
La goes the script:
<script type = 'text/javascript'>
$(document).ready(function(){
//IMPRESSÃO - A O CONTEUDO QUE SERÁ IMPRESSO DEVERA ESTAR DENTRO DE UMA //DIV CHAMADA print
$("#imprimir").click(function () {
$("#botoes").hide();
$("#print").show();
window.print();
$("#botoes").show();
});
EXPORTAR PARA PDF - O CONTEUDO DA EXPORTAÇÃO DEVERÁ ESTAR DENTRO DE UMA DIV CHAMADA PRINT
$("#pdf").click(function () {
var pdf = new jsPDF('p','pt','letter');
var specialElementHandlers = {
'#print': function (element, renderer) {
return true;
}
};
pdf.addHTML($('#print').first(), function() {
pdf.save("RelatorioPdf.pdf");
});
});
EXPORTAR EXCEL - O CONTEUDO DA EXPORTAÇÃO DEVERÁ ESTAR DENTRO DE UMA DIV CHAMADA PRINT
$("#excel").click(function () {
var htmltable= document.getElementById('print');
var html = htmltable.outerHTML;
window.open('data:application/vnd.ms-excel,' + encodeURIComponent(html));
});
});
There is another doubt taking advantage of, how do I apply UTF-8 to this export? Doubt beast I know, but I am only a new Padawan in this area of development. Thanks and thank you for being able to help.