I am trying to save PDF using print option.But for some reason 1st time it doesn't work,it comes up with an empty page.i have googled got some solutions yet no luck .Please help me for a solution.
thanks in advance
$("#btnPrint").click(function () {
// alert("hi");
$(".accordion-content").css('display','block');
var printWindow = window.open('', '', 'height=400,width=1200');
var strin="";
printWindow.document.write('<html><head><link rel="stylesheet" type="text/css" href="css/print.css"/></head><body onload="window.focus();" onbeforeunload="window.close();">');
//alert($(".logoHolder").html());
printWindow.document.write($(".logoHolder").html());
$('input[class="subCheck"]:checked').each(function() {
strin += $("#"+this.value).html()+"<br><br><br>";
});
printWindow.document.write(strin);
//alert();
printWindow.document.write('</body></html>');
printWindow.print();
printWindow.close();
//$( "#btnPrint" ).trigger( "click" );
});
Aucun commentaire:
Enregistrer un commentaire