如水博客提供网络营销顾问服务与电子商务系统实施!

火狐WEB自动打印插件

检测插件是否安装代码:

try{
    v = jsPrintSetup.getVersion();
} catch(e) {
    if(confirm('请先安装打印插件,安装插件否则将不能打印!你可以进入点击firefox,工具->插件,搜索"JSPrintSetup "安装,或者点击确定进入插件首页安装!')){
        window.location.href="http://jsprintsetup.mozdev.org/installation.html";
    }
}

调用方式:

    function print(){
        jsPrintSetup.setOption('orientation', jsPrintSetup.kPortraitOrientation);
        //jsPrintSetup.definePaperSize(in short jspid, in short pd, in wstring pn, in wstring pwg, in wstring name, in double w, in double h, in short m);
       
        // set top margins in millimeters
        jsPrintSetup.setOption('marginTop', 0);
        jsPrintSetup.setOption('marginBottom', 0);
        jsPrintSetup.setOption('marginLeft', 0);
        jsPrintSetup.setOption('marginRight', 0);
  // set page header
  jsPrintSetup.setOption('headerStrLeft', '');
  jsPrintSetup.setOption('headerStrCenter', '');
  jsPrintSetup.setOption('headerStrRight', '');
  // set empty page footer
  jsPrintSetup.setOption('footerStrLeft', '');
  jsPrintSetup.setOption('footerStrCenter', '');
  jsPrintSetup.setOption('footerStrRight', '');

        jsPrintSetup.clearSilentPrint();
        jsPrintSetup.setOption('printSilent', 1);
        jsPrintSetup.print();       
    }

 

标签:web自动打印JSPrintSetup
分类:技术专栏| 发布:如水| 查看: | 发表时间:2015/4/17
原创文章如转载,请注明:转载自如水博客 http://www.rushui.net/
本文链接:http://www.rushui.net/article/426.htm

相关文章

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

沪ICP备09044163号  

神奇网络 如水