pagelodop.jsp 5.73 KB
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
	<head>
		<title>index.html</title>
		<meta name="decorator" content="default"/>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<script language="javascript" src="${ctxStatic}/lodop/LodopFuncs.js" type="text/javascript"></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>
		<link rel="stylesheet" style="text/css" href="${ctxStatic}/modules/reg/css/regcss.css" />
	</head>

	<body> 
		<script language="javascript">
			var LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
		</script>
		<br>
<font color="#0000FF">NewPage</font>实现分页,                     
				看一下<a href="javascript:prn1_preview()">打印预览1</a>
		<br>
		<div id="div1_2_3">

			<div id="div1">
			  <table border="1" width="300" id="tb01" bgcolor="#CCFFCC" style="border:solid 1px black"><tr><td width="133" id="mtb001" style="border:solid 1px">
			  <font face="黑体" color="#FF0000" size="3">《带底色表单》</font></td></tr></table>
			  <table border="1" width="300" height="106" cellspacing="0" bgcolor="#CCFFFF" style="border-collapse:collapse;border:1px solid black"><tr>
			  <td width="66" height="16" style="border:1px solid black"><font color="#0000FF">A</font><font color="#0000FF"></font></td>
			<td width="51" height="16" style="border:1px solid black"><font color="#0000FF">B</font><font color="#0000FF"></font></td>
			<td width="51" height="16" style="border:1px solid black"><font color="#0000FF">C</font><font color="#0000FF"></font></td></tr> 
			  <tr><td width="66" height="12" style="border:1px solid black">A001</td><td width="51" height="12" style="border:1px solid black">B001</td><td width="51" height="12" style="border:1px solid black">C001</td></tr> 
			  <tr><td width="66" height="16" style="border:1px solid black">A002</td><td width="51" height="16" style="border:1px solid black">B002</td><td width="51" height="16" style="border:1px solid black">C002</td></tr> 
			  <tr><td width="66" height="16" style="border:1px solid black">A003</td><td width="51" height="16" style="border:1px solid black">B003</td><td width="51" height="16" style="border:1px solid black">C003</td></tr> </table>
			</div>
			
			<p style="page-break-after:always">&nbsp;分页元素不能空,可以是空格或普通内容</p>
			
			<div id="div2">
			  <table border="1" width="300" height="106" cellspacing="0" style="border-collapse: collapse; border:double 3px black;" borderthin="true"> 
			  <tr><td width="168" height="12" colspan="3" style="border:1px solid black;"><font face="黑体" color="#FF0000" size="3">双细线表格</font></td></tr> 
			    <tr>
			  <td width="66" height="16" style="border:1px solid black"><font color="#0000FF">X等</font></td>
			<td width="51" height="16" style="border:1px solid black"><font color="#0000FF">Y等</font></td>
			<td width="51" height="16" style="border:1px solid black"><font color="#0000FF">Z等</font></td>
			    </tr>
			  <tr><td width="66" height="12" style="border:1px solid black">X001</td><td width="51" height="12" style="border:1px solid black">Y001</td><td width="51" height="12" style="border:1px solid black">Z001</td></tr> 
			  <tr><td width="66" height="16" style="border:1px solid black">X002</td><td width="51" height="16" style="border:1px solid black">Y002</td><td width="51" height="16" style="border:1px solid black">Z002</td></tr> 
			  <tr><td width="66" height="16" style="border:1px solid black">X003</td><td width="51" height="16" style="border:1px solid black">Y003</td><td width="51" height="16" style="border:1px solid black">Z003</td></tr> </table>
			</div>
			
			<div id="div3" style="page-break-before:always">
			  <table border="1" width="100%" id="tb01" style="border-collapse:collapse" bordercolor="#000000">
			  <tr><td colspan="3" style="border:1px solid black"><font face="黑体" color="#FF0000"  size="3">《单线表单》</font></td></tr>
			  <tr>
			  <td width="66" height="4" style="border:1px solid black"><font color="#0000FF">R等</font></td>
			  <td width="51" height="4" style="border:1px solid black"><font color="#0000FF">S等</font></td>
			  <td width="51" height="4" style="border:1px solid black"><font color="#0000FF">T等</font></td>
			  </tr>
			  <tr><td width="66" height="12" style="border:1px solid black">R001</td><td width="51" height="12" style="border:1px solid black">S001</td><td width="51" height="12" style="border:1px solid black">T001</td></tr> 
			  <tr><td width="66" height="16" style="border:1px solid black">R002</td><td width="51" height="16" style="border:1px solid black">S002</td><td width="51" height="16" style="border:1px solid black">T002</td></tr> 
			  <tr><td width="66" height="16" style="border:1px solid black">R003</td><td width="51" height="16" style="border:1px solid black">S003</td><td width="51" height="16" style="border:1px solid black">T003</td></tr> 
			  </table>
			</div>
			
		</div>
	<script type="text/javascript">
	 
		function prn1_preview() { 
			LODOP.PRINT_INIT("打印控件功能演示_Lodop功能_分页输出一");
			LODOP.ADD_PRINT_HTM(88,200,350,600,document.getElementById("div1").innerHTML);
			LODOP.NewPage();
			LODOP.ADD_PRINT_HTM(88,200,350,600,document.getElementById("div2").innerHTML);
			LODOP.NewPage();
			LODOP.ADD_PRINT_HTM(88,200,350,600,document.getElementById("div3").innerHTML);
			LODOP.PREVIEW();	
		};
		
	</script>
		
	</body>
</html>