Copier le code du code comme suit:
<% @ Page Language = "Java" ContentType = "Text / Html; Charset = UTF-8"
Pageencoding = "UTF-8"%>
<!
<html>
<adal>
<Title> JavaScript Print-Imprime Paramètres de prévisualité imprimé </TITAL>
<Meta http-equiv = content-type content = "text / html; charset = gb2312" />
<Style média = print>
.NOPRINT {affichage: aucun;}
.PageNext {Page-Break-après: toujours;}
</ style>
<Script Language = JavaScript>
fuinction propsetup () {
// Imprimer les paramètres de la page
wb.execwb (8,1);
}
Fuinction Propreview () {{)
// Aperçu de la page d'impression
wb.execwb (7,1);
}
Fonction pritIt ()
{{
if (confirmer ('Êtes-vous imprimé?') {
wb.execwb (6,6)
}
}
</cript>
</ Head>
<body>
<Div align = Center>
<Objet id = wb height = 0 largeur = 0
CLASSID = CLSID: 8856F961-340A-11D0-A96B-004FD705A2 Name = WB> </ Objection>
<Entrée onclight = javascript: printIt () type = Button Value = print name = Button_print />
<Entrée onclight = javascript: printSetUp ();
<Entrée onclight = javascript: printPreview ();
</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>
</docy>
</html>
Copier le code du code comme suit:
<html>
<Title> JS Solution d'impression par lots de pagination (ne prend en charge que IE) </Title>
<script linguisse = "javascript">
Fonction printwithAlert () {
document.all.webbrowser.execwb (6,1);
}
Fonction printwithoutOrert () {
document.all.webbrowser.execwb (6,6);
}
fuinction propsetup () {
document.all.webbrowser.execwb (8,1);
}
fonction propulview () {
document.all.webbrowser.execwb (7,1);
}
fonction printImDiaelyment () {
document.all.webbrowser.execwb (6,6);
window.close ();
}
</cript>
<Objet id = WebBrowser Classid = CLSID: 8856F961-340A-11D0-A96B-004FD705A2 Style = "Affichage: Aucun">
</ Objet>
</noscript>
<Style média = print>
.NOPRINT {Affichage: Aucun;} .PageNExt {Page -brebreak-Act: toujours;}
</ style>
<Table align = "Center" class = notrint>
<tr>
<td align = "Center"> <Button Title = Print onClick = printWithAlert ()> Print </utton>
<Button Title = Imprime directement onClick = printwithoutOrert ()> Imprimez directement </futton>
<entrée type = Button Value = "Print Settings" onClick = "printSetUp ()">
<Button onClick = 'printPriview ()' title = 'Print Preview ...'> Imprimer Aperçu </frutton> </td>
</tr>
</ table>
<div class = notrint> Voici la zone d'impression: <br>
</div>
<hr size = 1 noshadow color = noire class = no-noprint>
<ballage>
<tr>
<td colorpan = 2>
Le contenu de la première page
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
</td>
</tr>
</ table>
<hr size = 1 noshadow color = noire class = no-noprint>
<div>
Contenu de la deuxième page
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
</div>
<hr size = 1 noshadow color = noire class = no-noprint>
Contenu de la troisième page
</html>