标签:
第一步先引入插件所用到的JS,插件官网http://www.lodop.net/
放到head里面
<script language="javascript" src="js/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_lodop.exe"></embed>
</object>
第二步:LODOP=getLodop(document.getElementById(‘LODOP_OB‘),document.getElementById(‘LODOP_EM‘));
LODOP.PRINT_INIT("打印控件功能演示_Lodop功能_装载背景图");
LODOP.ADD_PRINT_TEXT(104,125,75,24,data[0].swname);//寄件人姓名
LODOP.ADD_PRINT_TEXT(137,136,195,24,"郑州市景安网络科技股份有限公司");//寄件人单位名称
LODOP.ADD_PRINT_TEXT(168,110,61,24,"河南");//寄件人省
LODOP.ADD_PRINT_TEXT(168,192,66,24,"郑州");//寄件人市
LODOP.ADD_PRINT_TEXT(168,279,60,24,"金水");//寄件人县
LODOP.ADD_PRINT_TEXT(199,85,165,24,"花园路144号信息大厦七层 ");//寄件人地址
LODOP.ADD_PRINT_TEXT(230,141,88,24,"0371-9618961");//寄件人电话
LODOP.ADD_PRINT_TEXT(230,233,88,24,"");//寄件人手机号
//LODOP.ADD_PRINT_HTM(225,335,30,20,"<input type=‘checkbox‘ checked/>");
LODOP.ADD_PRINT_TEXT(255,113,250,24,"");//寄件人姓名
//LODOP.ADD_PRINT_HTM(278,100,22,20,"<input type=‘checkbox‘ checked/>");
LODOP.ADD_PRINT_TEXT(279,306,24,24,"");//金额万
LODOP.ADD_PRINT_TEXT(279,338,24,24,"");//金额千
LODOP.ADD_PRINT_TEXT(279,372,24,24,"");//金额百
LODOP.ADD_PRINT_TEXT(279,406,24,24,"");//金额十
LODOP.ADD_PRINT_TEXT(279,447,24,24,"");//金额元
//LODOP.ADD_PRINT_HTM(302,97,22,20,"<input type=‘checkbox‘ checked/>");
//LODOP.ADD_PRINT_HTM(302,279,22,20,"<input type=‘checkbox‘ checked/>");
//LODOP.ADD_PRINT_HTM(302,375,22,20,"<input type=‘checkbox‘ checked/>");
LODOP.ADD_PRINT_TEXT(352,99,189,24,"");//寄件人证件号
LODOP.ADD_PRINT_TEXT(326,124,95,24,"");//输入框寄件人签名
LODOP.ADD_PRINT_TEXT(377,181,100,19,mytime);//输入框寄件日期
LODOP.ADD_PRINT_TEXT(102,462,75,24,data[0].sjr);//收件人姓名
LODOP.ADD_PRINT_TEXT(133,453,237,24,"");//收件人单位名称
LODOP.ADD_PRINT_TEXT(200,401,320,24,data[0].dz);//收件人地址
LODOP.ADD_PRINT_TEXT(102,602,115,24,data[0].province+data[0].city);//收件目的地
LODOP.ADD_PRINT_TEXT(167,448,67,24,data[0].province);//收件省份
LODOP.ADD_PRINT_TEXT(167,530,67,24,data[0].city);//收件市
LODOP.ADD_PRINT_TEXT(167,616,77,24,"");//收件县
//LODOP.ADD_PRINT_HTM(279,614,22,20,"<input type=‘checkbox‘ checked/>");//收件人勾选
LODOP.ADD_PRINT_TEXT(104,268,100,24,"河南省郑州市");
LODOP.ADD_PRINT_TEXT(230,495,96,24,data[0].dh);//收件人手机号码
LODOP.ADD_PRINT_TEXT(230,615,96,24,"");//收件人电话
LODOP.ADD_PRINT_SETUP_BKIMG("<img border=‘0‘ src=‘http://www.zzidc.com/images/evaluation/photo/siwu.jpg‘>");
//LODOP.ADD_PRINT_SETUP_BKIMG("<img border=‘0‘ src=‘<img src=‘" + basePath + "images/siwu.jpg‘/>");
LODOP.SET_SHOW_MODE("BKIMG_LEFT",1);
LODOP.SET_SHOW_MODE("BKIMG_TOP",1);
LODOP.SET_SHOW_MODE("BKIMG_WIDTH","315mm");
LODOP.SET_SHOW_MODE("BKIMG_HEIGHT","120mm");
LODOP.PRINT_DESIGN();       
标签:
原文地址:http://my.oschina.net/liujiawan/blog/496884