Copy code code 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.dtddd" ">>
<Html>
<Head>
<Title> JavaScript Print-Print page Settings-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>
fuinction propsetup () {
// Print page settings
wb.execwb (8,1);
}
fuinction propreview () {{)
// Print page preview
wb.execwb (7,1);
}
Function Printit ()
{{
if (Confirm ('Are you printed?') {
wb.execwb (6,6)
}
}
</Script>
</Head>
<body>
<Div align = center>
<Object ID = WB Height = 0 Width = 0
classid = clsid: 8856F961-340A-11D0-A96B-004FD705A2 name = wb> </objection>
<Input OnClight = Javascript: Printit () Type = Button Value = Print Name = Button_print />
<Input onClight = javascript: PrintSetup (); Type = Button Value = Print page Setting name = Button_Setup />
<Input onClight = javascript: PrintpreView (); Type = Button Value = Print preview name = Button_show />
</Div>
111 </br>
111 </br>
111 </br>
<div> </div>
222 </br>
222 </br>
222 </br>
<div> </div>
333 </br>
333 </br>
333 </br>
<div> </div>
444 </br>
444 </br>
444 </br>
<div> </div>
555 </br>
555 </br>
555 </br>
</Body>
</Html>
Copy code code as follows:
<html>
<Title> JS paging batch printing solution (only supports IE) </Title>
<script language = "javascript">
Function Printwithalert () {
document.all.webbrowser.execwb (6,1);
}
Function Printwithoutorert () {
document.all.webbrowser.execwb (6,6);
}
fuinction propsetup () {
document.all.webbrowser.execwb (8,1);
}
function propprieview () {
document.all.webbrowser.execwb (7,1);
}
function printimdiaately () {
document.all.webbrowser.execwb (6,6);
window.close ();
}
</script>
<Object ID = webbrowser classid = clsid: 8856F961-340A-11D0-A96B-004FD705A2 style = "display: none">
</Object>
</noScript>
<Style Media = Print>
.Noprint {display: none;} .pagenext {page-break-act: always;}
</style>
<Table Align = "Center" class = notrint>
<tr>
<td Align = "Center"> <Button Title = Print onClick = Printwithalert ()> Print </Button>
<Button title = Directly print onClick = Printwithoutorert ()> Print directly </Button>
<input type = Button value = "Print settings" OnClick = "PrintSetup ()">
<Button OnClick = 'Printprieview ()' Title = 'Print Preview ...'> Print Preview </Button> </TD>
</tr>
</table>
<div class = notrint> below is the print area: <br>
</div>
<hr size = 1 noShadow color = black class = noprint>
<Table>
<tr>
<td colorpan = 2>
The content of the first page
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
</td>
</tr>
</table>
<hr size = 1 noShadow color = black class = noprint>
<div>
Second page content
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
</div>
<hr size = 1 noShadow color = black class = noprint>
Third page content
</html>