本文介绍了在打印预览中显示图像时出现问题。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

专家

使用下面提到的javascript来打印div

div还包含一张图像,除了图像所有内容都在打印预览中

但是图片没有显示请帮我解决这个问题

--------------------------- -------------------------------------





函数PrintPanel(){

var panel = document.getElementById(<%= div_print.ClientID%>);

var printWindow = window.open('','','height = 800,width = 800');

console.log(printWindow);

尝试{

printWindow.document.write('< html>< head>< title> / title>');

printWindow.document.write(' < / head><bodyöncontextmenu= new Function(return false)>');

printWindow.document.write(panel.innerHTML);

首席tWindow.document.write('< / body>< / html>');

printWindow.document.close();

}

catch(e){

console.dir(e);

}

setTimeout(function(){

printWindow.focus();

printWindow.print();

},500);

返回false;

}

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;
}

推荐答案


这篇关于在打印预览中显示图像时出现问题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-01 04:12