pagination to achieve a lot of printing, this article for you to introduce the use of JS to complete this demand, interested friends can refer to the following
The code is as follows: <%@ page language= "java" contenttype= "text/html; Charset=utf-8 " pageencoding=" UTF-8 "%> <! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" > <html > <HEAD> <title>javascript Print-print page setup-print Preview code </TITLE> <meta http-equiv= Content-type content= "text/html; charset=gb2312 "/> <style media=print> . Noprint{display:none;} . Pagenext{page-break-after:always;} </style> <script language=javascript> function Printsetup () { //print Page Setup WB . EXECWB (8,1); } function PrintPreview () { /print Page preview WB.EXECWB (7,1); } Ction printit () { if (Confirm (' OK to print?) ') { WB.EXECWB (6,6) } } </SCRIPT> </HEAD> <BODY> <div align=center> <object id=wb height=0 width=0 CLASSID=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 name=wb></object> <INPUT Onclick=javascript: PrintIt () Type=button value= print name=button_print/> <input onclick=javascript:printsetup (); Type=button value= Print Page Setup name=button_setup/> <input onclick=javascript:printpreview (); Type=button value= Print Preview name=button_show/> </DIV> 111</br> 111</br> 111 </br> <div class= "Pagenext" ></div> 222</br> 222</br> 222</ br> <div class= "Pagenext" ></div> 333</br> 333</br> 333</br > <div class= "Pagenext" ></div> 444</br> 444</br> 444</br> <div class= "Pagenext" ></div> 555</br> 555</br> 555</br> </BODY> </HTML> code as follows: <html> <title>js Paging Bulk Printing solution (branchHolding IE) </title> <script language= "javascript" > function Printwithalert () { Document.all.WebBrowser.ExecWB (6,1); } function Printwithoutalert () { Document.all.WebBrowser.ExecWB (6,6); } function Printsetup () { Document.all.WebBrowser.ExecWB (8,1 ); } function Printprieview () { Document.all.WebBrowser.ExecWB (7,1); } function printimmediately () { Document.all.WebBrowser.ExecWB (6,6); window.close (); } </script> <object id=webbrowser classid=clsid:8856f961-340a-11d0-a96b-00c04fd705a2 style= "Display:none" > </OBJECT> </noscript> <style media=print> . Noprint{display:none}. Pagenext{page-break-after:always;} </style> <table align= "center" class=noprint> <tr> <td align= "center" ><button title= Print Onclick=printwithalert () > Print </BUTTON> <button title= Direct Print ONCLICk=printwithoutalert () > Direct printing </BUTTON> <input Type=button value= "Print Setup" onclick= "Printsetup ()" > <button onclick = ' Printprieview () ' title= ' Print preview ... ' > Print preview </button></td> </tr> </table> <div class=noprint> The following is the print area:<br> </div> <hr size=1 Noshadow color=black class=noprint > <table class= "Pagenext" > <tr> <td colspan=2 > the content of the first page 1111111111111111111111111111111111111111111111111111111111111111111111111 1111111111111111111 1111111111111111111111111111111111111111111111111111111111111111111111111 1111111111111111111 1111111111111111111111111111111111111111111111111111111111111111111111111 1111111111111111111 1111111111111111111111111111111111111111111111111111111111111111111111111 1111111111111111111 1111111111111111111111111111111111111111111111111111111111111111111111111 1111111111111111111 1111111111111111111111111111111111111111111111111111111111111111111111111 1111111111111111111 </td> </tr> </table> <hr size=1 Noshadow color=black class=noprint > <div class= "pagenext" > second page content 1111111111111111111111111111111111111111111111111111111111111111111111111 1111111111111111111 1111111111111111111111111111111111111111111111111111111111111111111111111 1111111111111111111 1111111111111111111111111111111111111111111111111111111111111111111111111 1111111111111111111 1111111111111111111111111111111111111111111111111111111111111111111111111 1111111111111111111 1111111111111111111111111111111111111111111111111111111111111111111111111 1111111111111111111 1111111111111111111111111111111111111111111111111111111111111111111111111 1111111111111111111 </div> <HR size=1 Noshadow color=black class=noprint > third page content </html>