Google Chrome浏览器中的打印事件 [英] Print Event in Google chrome

查看:901
本文介绍了Google Chrome浏览器中的打印事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从HTML页面的iframe容器标签中取出pdf文件中的打印内容:

我正在整理以下代码,以使用 javascript
Html按钮单击上打印

I need to take print out of pdf file from iframe container tag of HTML page:

I am caling following code to take print on Html button click using javascript

document.getElementById("Idname").focus();
window.print();


这些代码可以在ie8中成功运行,但不能在google chrome中运行
在google chrome中成功完成
请帮助我..............


these code successfully working in ie8 but not working in google chrome how we can
do it successfully in google chrome
Please help me..............

推荐答案

您好rajanngnagarajan我认为您只需要window.print()即可打印页面在chrome中,然后使用CSS获取要打印的选定元素,而其他元素则隐藏.

Hi rajanngnagarajan i think you just need window.print() to print the page in chrome, and then use CSS to get selected element to be printed and others to be hidden.

 <style type="text/css">
   @media print
{
    #non-printable { display: none; }
    #printable { display: block; }
}
 </style>



希望对您有帮助



Hope this help you


这篇关于Google Chrome浏览器中的打印事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆