您的位置:首页 > 运维架构

lodop打印插件用法

2017-08-14 09:33 288 查看
第一步 导入lodopfuncs.js

第二步 导入js头     <script language="javascript" type="text/javascript" src="${ctxStatic}/common/LodopFuncs.js"></script>

                               <object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0>

                               <embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0 pluginspage="install_lodop64.exe"></embed>

                               </object>

第三部  js方法  

                             function myPreview() {

                                         LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM')); 

                                         LODOP.PRINT_INIT("");

                                         var strStyle_title='<style> span{font-family:"微软雅黑"}</style>';

                                         var strStyle='<style> span{font-family:"微软雅黑"} p.txt{font-size:10.5pt;text-align:center}</style>';

                                         LODOP.ADD_PRINT_HTM(30,"0%","100%",300,strStyle_title+document.getElementById("div1").innerHTML);

                                         LODOP.PREVIEW();

                                        };
具体js 方法的使用 参考官方API
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: