源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

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

  • 时间:2022-07-25 14:52 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要: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即可
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部