当前位置: 首页 > 新闻动态 > 软件编程

jQuery打印图片pdf、txt示例代码

作者:用户投稿 浏览: 发布日期:2026-01-16
[导读]:本节主要介绍了jQuery打印图片pdf、txt,需要的朋友可以参考下

html加如下代码

<div style="display:none"> 
<div id="to_print"></div> 
<input type="button" id="print_button" value="Print" onclick="document.getElementById('FILEtoPrint').focus(); document.getElementById('FILEtoPrint').contentWindow.print();" /> 
</div> 

<script> 
function printSome(path){ //传入文件路径 
$("#to_print").html('<iframe src='+path+' id="FILEtoPrint"></iframe>'); 
setTimeout(function(){$("#print_button").click();}, 500); 
} 
</script>

web界面添加按钮调用js即可

免责声明:转载请注明出处:http://m.jing-feng.com.cn/news/344842.html

扫一扫高效沟通

多一份参考总有益处

免费领取网站策划SEO优化策划方案

请填写下方表单,我们会尽快与您联系
感谢您的咨询,我们会尽快给您回复!