Click here to Skip to main content
11,430,274 members (73,301 online)
Rate this: bad
good
Please Sign up or sign in to vote.
Hi, experts
Am using below mentioned javascript to print a div
that div also contains one image except image all contents are coming in print preview
but image is not displaying please help me solve this issue
----------------------------------------------------------------


function PrintPanel() {
var panel = document.getElementById("<%=div_print.ClientID %>");
var printWindow = window.open('', '', 'height=800,width=800');
console.log(printWindow);
try {
printWindow.document.write('<html><head><title>/title>');
printWindow.document.write('</head><body öncontextmenu = new Function("return false") >');
printWindow.document.write(panel.innerHTML);
printWindow.document.write('</body></html>');
printWindow.document.close();
}
catch (e) {
console.dir(e);
}
setTimeout(function() {
printWindow.focus();
printWindow.print();
}, 500);
return false;
}
Posted 5-Aug-14 0:15am
Edited 5-Aug-14 0:23am
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Read the full Article. You will be able to do that.

http://aspsnippets.com/Articles/Export-Paging-enabled-Gridview-to-PDF-with-Formatting-using-iTextSharp-in-ASPNet.aspx[^]

Please Mark as answered if you got a help
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web03 | 2.8.150428.2 | Last Updated 5 Aug 2014
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100