前端实现调动打印机部分打印界面

下载地址  http://doersguild.github.io/jQuery.print/

github地址 https://github.com/DoersGuild/jQuery.print

使用时直接引入js文件

<script type="text/JavaScript" src="path/to/jquery.print.js"></script>

<div id="ele">
       <h1>印刷</h1>
</div>
//使用时div的样式不可设置为隐藏,可先隐藏,执行打印方法时利用js切换显示效果,打印结束再隐藏
$("#ele").print(/*options*/);
或者使用下面的代码
$("#ele").print({
        globalStyles: true,
        mediaPrint: false,
        stylesheet: null,
        noPrintSelector: ".no-print",
        iframe: true,
        append: null,
        prepend: null,
        manuallyCopyFormValues: true,
        deferred: $.Deferred(),
        timeout: 750,
        title: null,
        doctype: '<!doctype html>'
 });

  

 
原文地址:https://www.cnblogs.com/zzc666/p/11136162.html