lodoop打印控件详解
生活随笔
收集整理的這篇文章主要介紹了
lodoop打印控件详解
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
[java]?view plain?copy 注意:使用此打印控件需要引入(在我上傳的Demo中都有):?? ????install_lodop32.exe?? ????install_lodop64.exe?? ????LodopFuncs.js?? ????jquery-1.10.0.min.js?? ?? 具體Demo下載地址:?http://download.csdn.net/download/l294333475/7697807??
[java]?view plain?copy <%@?page?language="java"?import="java.util.*"?pageEncoding="UTF-8"%>?? <%?? String?path?=?request.getContextPath();?? String?basePath?=?request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";?? %>?? <!DOCTYPE?HTML?PUBLIC?"-//W3C//DTD?HTML?4.01?Transitional//EN">?? <html>?? ??<head>?? ????<base?href="<%=basePath%>">?? ????<title>My?JSP?'TestLodoop.jsp'?starting?page</title>?? ????<meta?http-equiv="pragma"?content="no-cache">?? ????<meta?http-equiv="cache-control"?content="no-cache">?? ????<meta?http-equiv="expires"?content="0">?????? ????<meta?http-equiv="keywords"?content="keyword1,keyword2,keyword3">?? ????<meta?http-equiv="description"?content="This?is?my?page">?? ?????? ?? ?? ????<script?language="javascript"?src="<%=basePath%>lodop/LodopFuncs.js"></script>?? ????<script?src="<%=basePath%>js/jquery-1.10.0.min.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></embed>?? ????</object>?? ?????? ????<script?language="javascript">?? ????????var?LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'),"<%=basePath%>lodop/");?? ????????$(document).ready(function(){?? ????????????if(LODOP?==?null?||?(typeof(LODOP.VERSION)=="undefined")){?? ????????????????$("#btnPrintView").attr("disabled","disabled");?? ????????????????$("#btnPrint").attr("disabled","disabled");?? ????????????????$("#btnNext").attr("disabled","disabled");?? ????????????}?? ????????????else{?? ????????????????CreatePrinterList();?? ????????????}?? ????????});?? ?????????? ????????//打印?? ????????function?print(){?? ????????????document.getElementById("showInstall").innerHTML?=?"";?? ????????????Create();?? ????????????//LODOP.SET_PRINT_COPIES(2);?? ????????????LODOP.SET_PRINT_MODE("CATCH_PRINT_STATUS",true);?? ????????????var?code?=?LODOP.PRINTA();?? ????????????alert(code);?? ????????????var?ret?=?LODOP.GET_VALUE("PRINT_STATUS_OK",code);?? ????????????alert(ret);?? ????????????if(ret){?? ????????????????$("#btnNext").attr("disabled","none");?? ????????????}?? ????????????else{?? ????????????????document.getElementById("showInstall").innerHTML?=?"<font?color='#FF00FF'>打印失敗</font>";?? ????????????}?? ????????}????????? ?????????? ?????????? ????????//加載打印機(jī)?? ????????function?CreatePrinterList(){?? ????????????if?(document.getElementById('PrinterList').innerHTML!="")?return;?? ????????????LODOP=getLodop();??? ????????????var?iPrinterCount=LODOP.GET_PRINTER_COUNT();?? ????????????for(var?i=0;i<iPrinterCount;i++){?? ?????? ????????????????var?option=document.createElement('option');?? ????????????????option.innerHTML=LODOP.GET_PRINTER_NAME(i);?? ????????????????option.value=i;?? ????????????????document.getElementById('PrinterList').appendChild(option);?? ????????????};???? ????????};?? ?????????? ????????//打印預(yù)覽?? ????????function?preview()?{?? ????????????Create();?? ????????????LODOP.SET_PREVIEW_WINDOW(1,0,0,0,0,"");?? ????????????LODOP.PREVIEW();?? ????????};?? ?????????? ????????function?Create(){?? ????????????LODOP.PRINT_INIT("");????? ????????????LODOP.SET_PRINT_MODE("WINDOW_DEFPRINTER",getSelectedPrintIndex());//設(shè)置打印機(jī)?? ????????????LODOP.SET_PRINT_MODE("WINDOW_DEFPAGESIZE:"+getSelectedPrintIndex(),"A4");//設(shè)置打印紙張為A4?? ?????????????? ????????????LODOP.ADD_PRINT_HTM(10,30,700,1080,document.getElementById("tRequest").innerHTML);?? ?????????????? ????????????LODOP.NewPage();?????????????????????????????? ????????????CreateDataBill();?? ?????????????? ????????????LODOP.NewPage();?????????????? ????????????CreateDataSeal();?? ?????????????? ????????????LODOP.NewPage();?? ????????????LODOP.ADD_PRINT_HTM(30,30,700,1080,document.getElementById("tDeal").innerHTML);?? ????????}?? ?????????? ????????//選擇打印機(jī)?? ????????function?getSelectedPrintIndex(){?? ????????????return?document.getElementById("PrinterList").value;?? ????????};?? ?????????? ????????//法人代表授權(quán)書?? ????????function?CreateDataBill()?{?? ?????????? ????????????LODOP.ADD_PRINT_TEXT(97,220,500,20,"法人代表授權(quán)書");?? ????????????LODOP.SET_PRINT_STYLEA(0,"FontSize",30);?? ????????????LODOP.SET_PRINT_STYLE("FontSize",14);?? ????????????LODOP.ADD_PRINT_TEXT(190,150,300,20,"本授權(quán)書聲明:總部設(shè)在(地址)");?? ????????????LODOP.ADD_PRINT_LINE(205,420,?205,?600,0,?1);?? ????????????LODOP.ADD_PRINT_TEXT(190,600,150,20,",(公司名稱)");?? ?????????????? ????????????LODOP.ADD_PRINT_LINE(255,100,?255,?250,0,?1);????????????? ????????????LODOP.ADD_PRINT_TEXT(240,250,200,20,"公司(法人代表)");?? ????????????LODOP.ADD_PRINT_LINE(255,400,?255,?500,0,?1);?? ????????????LODOP.ADD_PRINT_TEXT(240,500,250,20,"(即下面簽字的授權(quán)人),");?? ?????????????? ????????????LODOP.ADD_PRINT_TEXT(290,100,300,20,"代表本公司授權(quán)(被授權(quán)人)");?? ????????????LODOP.ADD_PRINT_LINE(315,350,?315,?450,0,?1);?? ????????????LODOP.ADD_PRINT_TEXT(290,450,400,20,"(即下面簽字的被授權(quán)人)");?? ????????????LODOP.ADD_PRINT_TEXT(340,100,600,20,"為本公司合法代理人,到貴方辦理CFCA數(shù)字證書相關(guān)事宜。");?? ?????????????? ????????????LODOP.ADD_PRINT_TEXT(420,150,550,20,"本公司承認(rèn)該代表所簽署文件及提交公司文件的法律效力。");?? ?????????????? ????????????LODOP.ADD_PRINT_TEXT(500,100,100,20,"被授權(quán)人:");?? ????????????LODOP.ADD_PRINT_TEXT(500,400,100,20,"授權(quán)人:");?? ????????????LODOP.ADD_PRINT_TEXT(600,100,200,20,"填寫公司名稱(公章)");?? ????????????LODOP.ADD_PRINT_TEXT(650,100,200,20,"日期");?? ?????????????? ????????};?? ?????????? ????????//印章采集頁?? ????????function?CreateDataSeal(){?? ????????????LODOP.ADD_PRINT_TEXT(97,250,500,20,"印章采集");?? ????????????LODOP.SET_PRINT_STYLEA(0,"FontSize",30);?? ????????????LODOP.SET_PRINT_STYLE("FontSize",14);?? ????????????LODOP.ADD_PRINT_TEXT(190,100,550,20,"此印章僅用于辦理中國大唐集團(tuán)公司集采平臺電子鑰匙使用。");?? ????????????LODOP.ADD_PRINT_TEXT(240,100,550,20,"請將公章/合同專用章加蓋在以下方框內(nèi)。");?? ????????????LODOP.ADD_PRINT_RECT(290,?200,?200,?200,0,?1);?? ????????????LODOP.ADD_PRINT_TEXT(540,100,650,20,"此法人簽字/印章僅用于辦理中國大唐集團(tuán)公司集采平臺電子鑰匙使用。");?? ????????????LODOP.ADD_PRINT_TEXT(590,100,650,20,"請將法人簽字寫在以下方框內(nèi),或者將法人印章加蓋在以下方框內(nèi)。");?? ????????????LODOP.ADD_PRINT_RECT(640,?200,?200,?200,0,?1);?? ????????}?? ????</script>?? ?????? ?????? ??</head>?? ??<body>?? ??<!--?以下為設(shè)置打印內(nèi)容?-->?? ???<div>?? ????????<p?class="text1"><span>指定打印機(jī):<select?id="PrinterList"?size="1"></select></span></p>?? ????????<p?class="text1"><span>指定紙張:A4</span></p>?? ????????<p>?? ????????<button?id="btnPrintView"?οnclick="preview();">在線預(yù)覽</button>?? ????????<button?id="btnPrint"?οnclick="print();">在線打印</button>?? ????????</p>?? ????????<p><div?id="showInstall"></div></p>?? ????</div>?? ?????? ????<button?id="btnNext"?onClick="javascript:window.location.href='<%=basePath%>supplier/send.do'">下一步</button>?? ?????? ?????? ?????? ????<!--?以下為具體需要打印的內(nèi)容?-->?? ????<div?id?="tRequest"?style="display:none;">?? ????<p?style="margin:0px;text-align:center;font-size:30px;">企業(yè)證書申請表<img?src="01.jpg"?/></p>?? ??????<table?style="border-collapse:collapse;width:700px;">?? ????????<tr>?? ????????????<td?style="width:30px"></td>?? ????????????<td?style="width:70px"></td>?? ????????????<td?style="width:150px"></td>?? ????????????<td?style="width:100px"></td>?? ????????????<td?style="width:100px"></td>?? ????????????<td?style="width:100px"></td>?? ????????????<td?style="width:150px"></td>?? ????????</tr>?? ????????<tr>?? ????????????<td?colspan="2"?style="width:100px;border:?1px?solid?#000;height:50px;">申請日期</td>?? ????????????<td?colspan="2"?style="width:200px;border:?1px?solid?#000;">2014-07-31</td>?? ????????????<td?style="width:100px;border:?1px?solid?#000;">證書數(shù)量</td>?? ????????????<td?colspan="2"?style="width:290px;border:?1px?solid?#000;">2</td>?? ????????</tr>?? ????????<tr>?? ????????????<td?colspan="2"?style="border:?1px?solid?#000;height:50px;">證書種類</td>?? ????????????<td?colspan="5"?style="border:?1px?solid?#000;">?? ????????????????<input?type="checkbox"?/>高級證書<input?type="checkbox"?checked/>普通證書<input?type="checkbox"?/>Direct?Server證書?? ????????????????<input?type="checkbox"?/>Web?Server證書?? ????????????????<input?type="checkbox"?/>安全E-mail證書<input?type="checkbox"?/>CodeSigning證書<input?type="checkbox"?/>其它種類證書?? ????????????</td>?? ????????</tr>?? ????????<tr>?? ????????????<td?colspan="2"?style="border:?1px?solid?#000;height:25px;">所屬系統(tǒng)</td>?? ????????????<td?colspan="5"?style="border:?1px?solid?#000;">?? ????????????????<input?type="checkbox"?/>E-01<input?type="checkbox"?checked/>J-01?? ????????????</td>?? ????????</tr>?? ?????????????????? ?????????? ????????<tr>?? ????????????<td?style="width:30px;text-align:center;vertical-align:middle;border:?1px?solid?#000;"?rowspan="10">企業(yè)信息</td>?? ?????????? ????????????<td?colspan="2"?style="border:?1px?solid?#000;height:25px;width:150px;">中文名稱</td>?? ????????????<td?colspan="4"?style="border:?1px?solid?#000;">南京優(yōu)泰科技發(fā)展有限公司</td>?? ????????</tr>?? ????????<tr>?? ????????????<td?colspan="2"?style="border:?1px?solid?#000;height:25px;">英文/拼音簡稱</td>?? ????????????<td?colspan="4"?style="border:?1px?solid?#000;">utc</td>?? ????????</tr>?? ????????<tr>?? ????????????<td?colspan="2"?style="border:?1px?solid?#000;height:25px;">WEB域名</td>?? ????????????<td?colspan="4"?style="border:?1px?solid?#000;">www.utcsoft.com(僅限于服務(wù)器證書)</td>?? ????????</tr>?? ????????<tr>?? ????????????<td?colspan="2"?style="border:?1px?solid?#000;height:25px;">證件類型</td>?? ????????????<td?colspan="4"?style="border:?1px?solid?#000;">?? ????????????????<input?class="myradio"?type="checkbox"?name="radioCardType"?value="zzjg">組織機(jī)構(gòu)代碼證?? ????????????????<input?class="myradio"?type="checkbox"?name="radioCardType"?value="yyzz">企業(yè)營業(yè)執(zhí)照?? ????????????????<input?class="myradio"?type="checkbox"?name="radioCardType"?value="qt">其他?? ????????????</td>?? ????????</tr>?? ????????<tr>?? ????????????<td?colspan="2"?style="border:?1px?solid?#000;height:25px;">證件號碼</td>?? ????????????<td?colspan="4"?style="border:?1px?solid?#000;">1111</td>?? ????????</tr>?? ????????<tr>?? ????????????<td?colspan="2"?style="border:?1px?solid?#000;height:25px;">主管領(lǐng)導(dǎo)(簽名)</td>?? ????????????<td?colspan="3"?style="border:?1px?solid?#000;"></td>?? ????????????<td?rowspan="5"?style="width:150px;border:?1px?solid?#000;vertical-align:bottom;">(單位蓋章)</td>?? ????????</tr>?? ????????<tr>?? ????????????<td?colspan="2"?style="border:?1px?solid?#000;height:25px;">單位地址</td>?? ????????????<td?colspan="3"?style="border:?1px?solid?#000;">1111</td>?? ????????</tr>?? ????????<tr>?? ????????????<td?colspan="2"?style="border:?1px?solid?#000;height:25px;">省(市)</td>?? ????????????<td?colspan="3"?style="border:?1px?solid?#000;">1111</td>?? ????????</tr>?? ????????<tr>?? ????????????<td?colspan="2"?style="border:?1px?solid?#000;height:25px;">電話</td>?? ????????????<td?colspan="3"?style="border:?1px?solid?#000;">1111</td>?? ????????</tr>?? ????????<tr>?? ????????????<td?colspan="2"?style="border:?1px?solid?#000;height:25px;">傳真</td>?? ????????????<td?colspan="3"?style="border:?1px?solid?#000;">1111</td>?? ????????</tr>?? ????????<tr>?? ????????????<td?style="width:30px;text-align:center;vertical-align:middle;border:?1px?solid?#000;"?rowspan="8">辦理人信息</td>?? ?????????? ????????????<td?colspan="2"?style="border:?1px?solid?#000;height:25px;">姓名(簽名)</td>?? ????????????<td?colspan="4"?style="border:?1px?solid?#000;">劉鵬</td>?? ????????</tr>?? ????????<tr>?? ????????????<td?colspan="2"?style="border:?1px?solid?#000;height:25px;">證件類型</td>?? ????????????<td?colspan="4"?style="border:?1px?solid?#000;">?? ????????????????<input?type="checkbox"?checked/>身份證<input?type="checkbox"?/>軍官證<input?type="checkbox"?/>港澳通行證?? ????????????????<input?type="checkbox"?/>護(hù)照<input?type="checkbox"?/>其他?? ????????????</td>?? ????????</tr>?? ????????<tr>?? ????????????<td?colspan="2"?style="border:?1px?solid?#000;height:25px;">證件號碼</td>?? ????????????<td?colspan="4"?style="border:?1px?solid?#000;">${agent.agentCardNum}</td>?? ????????</tr>?? ????????<tr>?? ????????????<td?colspan="2"?style="border:?1px?solid?#000;height:25px;">電話</td>?? ????????????<td?colspan="4"?style="border:?1px?solid?#000;">1111</td>?? ????????</tr>?? ????????<tr>?? ????????????<td?colspan="2"?style="border:?1px?solid?#000;height:25px;">電子郵件</td>?? ????????????<td?colspan="4"?style="border:?1px?solid?#000;">1111</td>?? ????????</tr>?? ????????<tr>?? ????????????<td?colspan="2"?style="border:?1px?solid?#000;height:25px;">通信地址</td>?? ????????????<td?colspan="4"?style="border:?1px?solid?#000;">1111</td>?? ????????</tr>?? ????????<tr>?? ????????????<td?colspan="2"?style="border:?1px?solid?#000;height:25px;">郵政編碼</td>?? ????????????<td?colspan="4"?style="border:?1px?solid?#000;">1111</td>?? ????????</tr>?? ????????<tr>?? ????????????<td?colspan="2"?style="border:?1px?solid?#000;height:25px;">確認(rèn)意見</td>?? ????????????<td?colspan="4"?style="border:?1px?solid?#000;">?? ????????????????<input?type="checkbox"?checked/>上述信息屬實<input?type="checkbox"?/>上述信息不屬實?? ????????????</td>?? ????????</tr>?? ????????<tr>?? ????????????<td?style="width:30px;text-align:center;vertical-align:middle;border:?1px?solid?#000;"?rowspan="2">C<br>F<br>C<br>A<br>意見</td>?? ?????????? ????????????<td?colspan="2"?style="border:?1px?solid?#000;height:25px;">CFCA經(jīng)辦人:</td>?? ????????????<td?colspan="2"?style="border:?1px?solid?#000;">?? ????????????????<input?type="checkbox"?/>以上手續(xù)完備<br><input?type="checkbox"?/>以上手續(xù)完備?? ????????????</td>?? ????????????<td?colspan="2"?style="border:?1px?solid?#000;">?? ????????????????業(yè)務(wù)部審核員:<br>?? ????????????????業(yè)務(wù)審核日期:?? ????????????</td>?? ????????</tr>?? ????????<tr>?? ????????????<td?colspan="4"?style="border:?1px?solid?#000;height:25px;">分管領(lǐng)導(dǎo):<br><br><br><br></td>?? ????????????<td?colspan="2"?style="border:?1px?solid?#000;vertical-align:bottom;">?? ????????????????(CFCA蓋章)?? ????????????</td>?? ????????</tr>?? ????????<tr>?? ????????????<td?style="width:30px;text-align:center;vertical-align:middle;border:?1px?solid?#000;">操作</td>?? ?????????? ????????????<td?colspan="4"?style="border:?1px?solid?#000;height:25px;">?? ????????????????運(yùn)行部錄入人員:<br>?? ????????????????錄入日期:?? ????????????</td>?? ????????????<td?colspan="2"?style="border:?1px?solid?#000;">?? ????????????????運(yùn)行部審核人員:<br>?? ????????????????審核日期:?? ????????????</td>?? ????????</tr>?? ????????<tr>?? ????????????<td?style="width:30px;text-align:center;vertical-align:middle;border:?1px?solid?#000;">備注</td>?? ?????????? ????????????<td?colspan="6"?style="border:?1px?solid?#000;">?? ????????????????如您辦理電子鑰匙續(xù)費(fèi),請在此欄注明您所持有的電子鑰匙的DN號碼:<br><br>?? ????????????</td>?? ????????</tr>?? ??????</table>?? ????</div>?? ?????? ?????? ?????? ????<div?id="tDeal"?style="display:none;">?? ????????<p?style="text-align:center;font-size:30px;">購買協(xié)議</p>?? ????????<table?style="border-collapse:collapse;width:700px;">?? ????????????<tr>?? ????????????????<td?style="width:30px;"></td>?? ????????????????<td?style="width:150px;"></td>?? ????????????????<td?style="width:150px;"></td>?? ????????????????<td?style="width:200px;"></td>?? ????????????????<td?style="width:170px;"></td>?? ????????????</tr>?? ????????????<tr>?? ????????????????<td?rowspan="3"?style="width:30px;text-align:center;vertical-align:middle;border:?1px?solid?#000;">供方</td>?? ????????????????<td?style="width:80px;height:30px;border:?1px?solid?#000;">企業(yè)名稱</td>?? ????????????????<td?colspan="4"?style="height:30px;border:?1px?solid?#000;">南京優(yōu)泰科技發(fā)展有限公司</td>?? ????????????</tr>?? ????????????<tr>?? ????????????????<td?style="width:80px;height:30px;border:?1px?solid?#000;">開戶銀行</td>?? ????????????????<td?colspan="4"?style="height:30px;border:?1px?solid?#000;">工商銀行南京市新街口支行</td>?? ????????????</tr>?? ????????????<tr>?? ????????????????<td?style="width:80px;height:30px;border:?1px?solid?#000;">賬號</td>?? ????????????????<td?colspan="4"?style="height:30px;border:?1px?solid?#000;">4301010019101143205</td>?? ????????????</tr>?? ????????????<tr>?? ????????????????<td?rowspan="2"?style="width:30px;text-align:center;vertical-align:middle;border:?1px?solid?#000;">需方</td>?? ????????????????<td?style="width:150px;height:30px;border:?1px?solid?#000;">企業(yè)名稱</td>?? ????????????????<td?colspan="3"?style="height:30px;border:?1px?solid?#000;"></td>?? ????????????????<td?rowspan="2"?style="width:150px;height:150px;border:?1px?solid?#000;vertical-align:bottom;">(蓋章)</td>?? ????????????</tr>?? ????????????<tr>?? ????????????????<td?style="width:150px;height:30px;border:?1px?solid?#000;">聯(lián)系人/電話</td>?? ????????????????<td?colspan="3"?style="height:30px;border:?1px?solid?#000;"></td>?? ????????????</tr>?? ????????????<tr>?? ????????????????<td?colspan="2"?style="height:30px;border:?1px?solid?#000;">產(chǎn)品名稱</td>?? ????????????????<td?colspan="4"?style="height:30px;border:?1px?solid?#000;">優(yōu)泰電子簽章系統(tǒng)軟件V9.0</td>?? ????????????</tr>?? ????????????<tr>?? ????????????????<td?colspan="2"?style="height:30px;border:?1px?solid?#000;">數(shù)量</td>?? ????????????????<td?colspan="4"?style="height:30px;border:?1px?solid?#000;">優(yōu)泰電子簽章系統(tǒng)軟件V9.0</td>?? ????????????</tr>?? ????????????<tr>?? ????????????????<td?colspan="2"?style="height:30px;border:?1px?solid?#000;">金額</td>?? ????????????????<td?style="height:30px;border:?1px?solid?#000;">¥</td>?? ????????????????<td?colspan="3"?style="height:30px;border:?1px?solid?#000;">大寫</td>?? ????????????</tr>?? ????????????<tr>?? ????????????????<td?colspan="2"?style="height:30px;border:?1px?solid?#000;">日期</td>?? ????????????????<td?colspan="4"?style="height:30px;border:?1px?solid?#000;">優(yōu)泰電子簽章系統(tǒng)軟件V9.0</td>?? ????????????</tr>?? ????????????<tr>?? ????????????????<td?style="width:30px;text-align:center;vertical-align:middle;border:?1px?solid?#000;">備注</td>?? ????????????????<td?colspan="5"?style="height:200px;border:?1px?solid?#000;">?? ????????????????????1、??本軟件產(chǎn)品受著作權(quán)法及國際條約條款和知識產(chǎn)權(quán)保護(hù)法及條約的保護(hù)。<br>?? ????????????????????2、??本軟件產(chǎn)品用于大唐項目。<br>?? ????????????????????3、??本軟件在供方確認(rèn)收款后,三個工作日內(nèi)發(fā)出。<br>?? ????????????????????4、??請將此協(xié)議蓋章后與其他申請材料一同郵寄<br>?? ????????????????????5、??需方簽署本協(xié)議,表明需方已接受在辦理電子鑰匙時提供公章或者法人簽字的圖片,并保證其真實性。?? ?????????????????????? ????????????????</td>?? ????????????</tr>?? ????????</table>?? ????</div>?? ?????? ??</body>?? </html>??
總結(jié)
以上是生活随笔為你收集整理的lodoop打印控件详解的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 开一家旋转火锅多少钱 想要创业先要了解行
- 下一篇: 余额宝和余利宝的区别