在IE 10浏览器中打印问题 [英] Print issues in IE 10 Browser
问题描述
我需要从HTML页面的iframe容器标签中取出pdf文件:
使用IE 10浏览器我已经尝试过按照经典asp页 <中的Javascript br $>
document.frameToPrint.focus();
document.frameToPrint.print();
window.frames [frameToPrint]。focus();
window.frames [frameToPrint]。print();
两个都不适合我在IE 10中工作。
我收到此错误:无法获取未定义或空引用的属性click。
我怎么解决这个问题请帮帮我......
I need to take print out of pdf file from iframe container tag of HTML page:
using IE 10 Browser I have tried by following Javascript in classic asp page
document.frameToPrint.focus();
document.frameToPrint.print();
window.frames["frameToPrint"].focus();
window.frames["frameToPrint"].print();
Both are not working in IE 10 for me.
I got this error: Unable to get property 'click' of undefined or null reference.
how i can solve this please help me ...
推荐答案
你好,
下面是一个小型测试工具。看看是否有帮助。
Hello,
Below is a small test harness. See if that helps.
<!DOCTYPE html>
<html>
<head>
<title>Test PDF Print</title>
<script type="text/javascript">
var t;
function startPrint() {
t = window.setTimeout(printPdf, 100, "JavaScript");
}
function printPdf() {
window.clearTimeout(t);
var f = document.frames ? document.frames['pdfFrame'] : document.getElementById('pdfFrame');
var iw = f.contentWindow || f;
iw.focus();
iw.print();
return false;
}
</script>
</head>
<body onload="startPrint()">
<iframe id="pdfFrame" name="pdfFrame" src="docs/events.txt" width="100%" height="160"></iframe>
</body>
</html>
注意: 浏览器必须安装PDF插件,并且可以打开pdf文档在里面,否则它将无法工作
问候,
Note : The browser must have a PDF plugin installed and shlould be able to open pdf document inside, else it won't work
Regards,
这篇关于在IE 10浏览器中打印问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!